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.

86 lines
2.3 KiB

  1. using EasyBL.WebApi.Filters;
  2. using EasyBL.WEBAPP.SYS;
  3. using Entity.ShowEasyDtos;
  4. using Entity.Sugar;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Net;
  9. using System.Net.Http;
  10. using System.Web.Http;
  11. namespace WebApp.Controllers
  12. {
  13. public class TestController : ApiController
  14. {
  15. [HttpGet]
  16. public HttpResponseMessage GetAllCity()
  17. {
  18. return new TestService().GetAllCity();
  19. }
  20. [HttpGet]
  21. public HttpResponseMessage GetAllCity1(string ID, string Name)
  22. {
  23. return new TestService().GetAllCityByID(ID, Name);
  24. }
  25. [HttpPost]
  26. public HttpResponseMessage InsertUser([FromBody] TestUser dto)
  27. {
  28. return new TestService().InsertUser(dto);
  29. }
  30. [HttpPost]
  31. public HttpResponseMessage SaveUser([FromBody] SETB_CMS_Member dto)
  32. {
  33. return new TestService().Insert(dto);
  34. }
  35. [HttpDelete]
  36. public HttpResponseMessage DelUser(string ID)
  37. {
  38. return new TestService().DeleteCity(ID);
  39. }
  40. [HttpGet]
  41. public HttpResponseMessage UpdStatus(string OrgID, string MemberID)
  42. {
  43. //注冊成功后點擊郵箱中的鏈接調用的Api,内容為修改Member狀態,和產生登錄的Token
  44. return new TestService().UpdStatus(OrgID, MemberID);
  45. }
  46. [HttpGet]
  47. [SEApiSecurityFilter]
  48. public HttpResponseMessage GetMemberInfo(string OrgID, string userId)
  49. {
  50. //根據參數取得Member的詳細信息,調用時需要在Header中添加token相關信息,包括orgId,userid,timestamp,token
  51. //需要驗證的token相關信息的Api,添加上 [SEApiSecurityFilter]即可
  52. return new TestService().GetMemberInfo(OrgID, userId);
  53. }
  54. [HttpGet]
  55. //[SEApiSecurityFilter]
  56. public HttpResponseMessage GetToken(string orgId, string userId, string pasWd)
  57. {
  58. //获取token
  59. return new TestService().GetToken(orgId, userId, pasWd);
  60. }
  61. [HttpPost]
  62. //[SEApiSecurityFilter]
  63. public HttpResponseMessage Login([FromBody] TestUser dto)
  64. {
  65. //登陸並返回token
  66. return new TestService().Login(dto);
  67. }
  68. }
  69. }