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.
91 lines
2.5 KiB
91 lines
2.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)
|
|
{
|
|
List<string> SubCategoryIDList = new List<string>();
|
|
List<string> CountryIDList = new List<string>();
|
|
|
|
if (!string.IsNullOrEmpty(SubCategoryIDs)) {
|
|
SubCategoryIDList = JsonConvert.DeserializeObject<List<string>>(SubCategoryIDs);
|
|
}
|
|
|
|
if (!string.IsNullOrEmpty(CountryIDs))
|
|
{
|
|
CountryIDList = JsonConvert.DeserializeObject<List<string>>(CountryIDs);
|
|
}
|
|
|
|
|
|
// get authtoken
|
|
var SEToken = SETokenUtil.GetToken(this.Request);
|
|
var sAccount = SEToken.Email;
|
|
|
|
return new FavoriteService().GetFavoriteExhibition(Lang, sAccount, PageIndex, PageSize, SubCategoryIDList, CountryIDList);
|
|
}
|
|
|
|
}
|
|
}
|