You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
123 lines
3.5 KiB
123 lines
3.5 KiB
using EasyBL;
|
|
using EasyBL.WebApi.Common;
|
|
using EasyBL.WebApi.Filters;
|
|
using EasyBL.WebApi.Message;
|
|
using EasyBL.WEBAPP;
|
|
using EasyBL.WEBAPP.SYS;
|
|
using EasyNet;
|
|
using Entity.ShowEasyDtos;
|
|
using Entity.Sugar;
|
|
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Net.Http;
|
|
using System.Web.Http;
|
|
|
|
namespace WebApp.Controllers
|
|
{
|
|
public class FavoriteController : ApiController
|
|
{
|
|
|
|
[HttpPost]
|
|
[SEApiSecurityFilter]
|
|
public HttpResponseMessage Favorite([FromBody] FavoriteDTO favorite)
|
|
{
|
|
|
|
// get authtoken
|
|
var SEToken = SETokenUtil.GetToken(this.Request);
|
|
favorite.MemberID = SEToken.Email;
|
|
|
|
return new FavoriteService().SaveFavorite(favorite);
|
|
}
|
|
|
|
[HttpGet]
|
|
[SEApiSecurityFilter]
|
|
public HttpResponseMessage Favorites()
|
|
{
|
|
|
|
// get authtoken
|
|
var SEToken = SETokenUtil.GetToken(this.Request);
|
|
|
|
// get MemberID from authtoken
|
|
|
|
FavoriteDTO favorite = new FavoriteDTO();
|
|
favorite.MemberID = SEToken.Email;
|
|
|
|
return new FavoriteService().GetFavorites(favorite);
|
|
}
|
|
|
|
[HttpGet]
|
|
[SEApiSecurityFilter]
|
|
public HttpResponseMessage Favorites(string Type)
|
|
{
|
|
|
|
// get authtoken
|
|
var SEToken = SETokenUtil.GetToken(this.Request);
|
|
|
|
FavoriteDTO favorite = new FavoriteDTO();
|
|
favorite.MemberID = SEToken.Email;
|
|
favorite.Type = Type;
|
|
|
|
return new FavoriteService().GetFavorites(favorite);
|
|
}
|
|
|
|
[HttpGet]
|
|
[SEApiSecurityFilter]
|
|
public HttpResponseMessage ExhibitionList(string Lang, int PageIndex, int PageSize, string SubCategoryIDs, string CountryIDs, string Status)
|
|
{
|
|
List<string> rsSubCategoryIDList = new List<string>();
|
|
List<string> rsCountryIDList = new List<string>();
|
|
List<string> rsStatusList = new List<string>();
|
|
|
|
if (!string.IsNullOrEmpty(SubCategoryIDs)) {
|
|
rsSubCategoryIDList = JsonConvert.DeserializeObject<List<string>>(SubCategoryIDs);
|
|
}
|
|
|
|
if (!string.IsNullOrEmpty(CountryIDs))
|
|
{
|
|
rsCountryIDList = JsonConvert.DeserializeObject<List<string>>(CountryIDs);
|
|
}
|
|
|
|
if (!string.IsNullOrEmpty(Status))
|
|
{
|
|
rsStatusList = JsonConvert.DeserializeObject<List<string>>(Status);
|
|
}
|
|
|
|
|
|
// get authtoken
|
|
var SEToken = SETokenUtil.GetToken(this.Request);
|
|
var sAccount = SEToken.Email;
|
|
|
|
return new FavoriteService().GetFavoriteExhibition(Lang, sAccount, PageIndex, PageSize, rsSubCategoryIDList, rsCountryIDList, rsStatusList);
|
|
}
|
|
|
|
[HttpGet]
|
|
[SEApiSecurityFilter]
|
|
public HttpResponseMessage ExhibitionCountryList(string Lang)
|
|
{
|
|
|
|
// get authtoken
|
|
var SEToken = SETokenUtil.GetToken(this.Request);
|
|
var sAccount = SEToken.Email;
|
|
|
|
return new FavoriteService().GetExhibitionCountryList(Lang, sAccount);
|
|
|
|
}
|
|
|
|
[HttpGet]
|
|
[SEApiSecurityFilter]
|
|
public HttpResponseMessage ExhibitionStatusList(string Lang)
|
|
{
|
|
|
|
// get authtoken
|
|
var SEToken = SETokenUtil.GetToken(this.Request);
|
|
var sAccount = SEToken.Email;
|
|
|
|
return new FavoriteService().GetExhibitionStatusList(Lang, sAccount);
|
|
|
|
}
|
|
|
|
}
|
|
}
|