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.

AuthorizationServices.cs 3.8 KiB

пре 10 месеци
пре 10 месеци
пре 10 месеци
пре 10 месеци
пре 10 месеци
пре 10 месеци
пре 10 месеци
пре 10 месеци
пре 10 месеци
пре 10 месеци
пре 10 месеци
пре 10 месеци
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. 
  2. using BPA.KitChen.GroupMeal.Application.BaseDto;
  3. using BPA.KitChen.GroupMeal.Application.Service.Authorization.Dtos;
  4. using BPA.KitChen.GroupMeal.Core.Entity;
  5. using Furion.DatabaseAccessor;
  6. using Furion.DynamicApiController;
  7. using Furion.FriendlyException;
  8. using Microsoft.AspNetCore.Authorization;
  9. using Microsoft.AspNetCore.Mvc;
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Linq;
  13. using System.Text;
  14. using System.Threading.Tasks;
  15. namespace BPA.KitChen.GroupMeal.Application.Service.Authorization
  16. {
  17. [ApiDescriptionSettings("授权管理", Tag = "授权管理")]
  18. public class AuthorizationServices: IDynamicApiController
  19. {
  20. private readonly Services.IAuthorizationService _authorizationService;
  21. public AuthorizationServices(Services.IAuthorizationService authorizationService)
  22. {
  23. _authorizationService = authorizationService;
  24. }
  25. /// <summary>
  26. /// 分页店铺授权码
  27. /// </summary>
  28. /// <param name="input"></param>
  29. /// <returns></returns>
  30. [HttpPost("/api/authorization/pagestoreauthorization")]
  31. public async Task<PageUtil> PageStoreAuthorization(PageInputBase input)
  32. {
  33. return await _authorizationService.PageStoreAuthorization(input);
  34. }
  35. /// <summary>
  36. /// 添加店铺授权码
  37. /// </summary>
  38. /// <returns></returns>
  39. [HttpPost("/api/authorization/addstoreauthorization")]
  40. public async Task<bool> AddStoreAuthorization(CreateOrUpDateStoreAuthorizationDto input)
  41. {
  42. return await _authorizationService.AddStoreAuthorization(input);
  43. }
  44. /// <summary>
  45. /// 修改店铺授权码
  46. /// </summary>
  47. /// <param name="id"></param>
  48. /// <returns></returns>
  49. [HttpPost("/api/authorization/updatestoreauthorization")]
  50. public async Task<bool> UpdateStoreAuthorization(string id)
  51. {
  52. return await _authorizationService.UpdateStoreAuthorization(id);
  53. }
  54. /// <summary>
  55. /// 修改店铺授权时间
  56. /// </summary>
  57. /// <param name="input"></param>
  58. /// <returns></returns>
  59. [HttpPost("/api/authorization/updatestoreauthtime")]
  60. public async Task<bool> UpdateStoreAuthTime(CreateOrUpDateStoreAuthorizationDto input)
  61. {
  62. return await _authorizationService.UpdateStoreAuthTime(input);
  63. }
  64. /// <summary>
  65. /// 删除店铺权限
  66. /// </summary>
  67. /// <param name="id"></param>
  68. /// <returns></returns>
  69. [HttpPost("/api/authorization/delstoreauthorization")]
  70. public async Task<bool> DelStoreAuthorization(string id)
  71. {
  72. return await _authorizationService.DelStoreAuthorization(id);
  73. }
  74. /// <summary>
  75. /// 查询店铺授权信息
  76. /// </summary>
  77. /// <param name="id"></param>
  78. /// <returns></returns>
  79. [HttpGet("/api/authorization/GetStoreAuthorizationById")]
  80. public async Task<BPA_StoreAuthorization> GetStoreAuthorizationById(string id)
  81. {
  82. return await _authorizationService.GetStoreAuthorizationById(id);
  83. }
  84. /// <summary>
  85. /// 查询店铺授权信息 更具KEY
  86. /// </summary>
  87. /// <param name="key"></param>
  88. /// <returns></returns>
  89. [HttpGet("/api/authorization/GetStoreAuthorizationByKey"), AllowAnonymous]
  90. public async Task<BPA_StoreAuthorization> GetStoreAuthorizationByKey(string key)
  91. {
  92. return await _authorizationService.GetStoreAuthorizationByKey(key);
  93. }
  94. /// <summary>
  95. /// CodeFirst
  96. /// </summary>
  97. /// <param name="tableNames"></param>
  98. public void CodeFirst()
  99. {
  100. _authorizationService.CodeFirst();
  101. }
  102. }
  103. }