using EasyBL.WebApi.Filters; using EasyBL.WEBAPP.SYS; using Entity.ShowEasyDtos; using Entity.Sugar; 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 TestController : ApiController { [HttpGet] public HttpResponseMessage GetAllCity() { return new TestService().GetAllCity(); } [HttpGet] public HttpResponseMessage GetAllCity1(string ID, string Name) { return new TestService().GetAllCityByID(ID, Name); } [HttpPost] public HttpResponseMessage InsertUser([FromBody] TestUser dto) { return new TestService().InsertUser(dto); } [HttpPost] public HttpResponseMessage SaveUser([FromBody] SETB_CMS_Member dto) { return new TestService().Insert(dto); } [HttpDelete] public HttpResponseMessage DelUser(string ID) { return new TestService().DeleteCity(ID); } [HttpGet] public HttpResponseMessage UpdStatus(string OrgID, string MemberID) { //注冊成功后點擊郵箱中的鏈接調用的Api,内容為修改Member狀態,和產生登錄的Token return new TestService().UpdStatus(OrgID, MemberID); } [HttpGet] [SEApiSecurityFilter] public HttpResponseMessage GetMemberInfo(string OrgID, string userId) { //根據參數取得Member的詳細信息,調用時需要在Header中添加token相關信息,包括orgId,userid,timestamp,token //需要驗證的token相關信息的Api,添加上 [SEApiSecurityFilter]即可 return new TestService().GetMemberInfo(OrgID, userId); } [HttpGet] //[SEApiSecurityFilter] public HttpResponseMessage GetToken(string orgId, string userId, string pasWd) { //获取token return new TestService().GetToken(orgId, userId, pasWd); } [HttpPost] //[SEApiSecurityFilter] public HttpResponseMessage Login([FromBody] TestUser dto) { //登陸並返回token return new TestService().Login(dto); } } }