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.

68 lines
1.7 KiB

  1. using EasyBL.WebApi.Filters;
  2. using EasyBL.WEBAPP.SYS;
  3. using Entity.ShowEasyDtos;
  4. using Entity.Sugar;
  5. using Newtonsoft.Json;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Net;
  10. using System.Net.Http;
  11. using System.Web.Http;
  12. namespace WebApp.Controllers
  13. {
  14. public class HelloController : ApiController
  15. {
  16. [HttpGet]
  17. public HttpResponseMessage GetHello(string message)
  18. {
  19. return new HelloService().Echo(message);
  20. }
  21. [HttpPost]
  22. public HttpResponseMessage PostBody([FromBody] string dto)
  23. {
  24. System.Diagnostics.Debug.WriteLine(dto);
  25. return new HttpResponseMessage();
  26. }
  27. [HttpPost]
  28. public HttpResponseMessage PostParam(string param)
  29. {
  30. System.Diagnostics.Debug.WriteLine(param);
  31. return new HttpResponseMessage();
  32. }
  33. [HttpGet]
  34. [SEApiSecurityFilter]
  35. public HttpResponseMessage GetMemberInfo(string OrgID, string Account)
  36. {
  37. //根據參數取得Member的詳細信息,調用時需要在Header中添加token相關信息,包括orgId,userid,timestamp,token
  38. //需要驗證的token相關信息的Api,添加上 [SEApiSecurityFilter]即可
  39. return new TestService().GetMemberInfo(OrgID, Account);
  40. }
  41. [HttpPost]
  42. //[SEApiSecurityFilter]
  43. public HttpResponseMessage Login([FromBody] TestUser dto)
  44. {
  45. System.Diagnostics.Debug.WriteLine("Account" + ": " + dto.Account);
  46. System.Diagnostics.Debug.WriteLine("Password" + ": " + dto.Password);
  47. //登陸並返回token
  48. return new HttpResponseMessage();
  49. }
  50. }
  51. }