using BPA.KitChen.GroupMeal.Application.BaseDto; using BPA.KitChen.GroupMeal.Application.Service.Authorization.Dtos; using BPA.KitChen.GroupMeal.Core.Entity; using Furion.DatabaseAccessor; using Furion.DynamicApiController; using Furion.FriendlyException; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BPA.KitChen.GroupMeal.Application.Service.Authorization { [ApiDescriptionSettings("授权管理", Tag = "授权管理")] public class AuthorizationServices: IDynamicApiController { private readonly Services.IAuthorizationService _authorizationService; public AuthorizationServices(Services.IAuthorizationService authorizationService) { _authorizationService = authorizationService; } /// /// 分页店铺授权码 /// /// /// [HttpPost("/api/authorization/pagestoreauthorization")] public async Task PageStoreAuthorization(PageInputBase input) { return await _authorizationService.PageStoreAuthorization(input); } /// /// 添加店铺授权码 /// /// [HttpPost("/api/authorization/addstoreauthorization")] public async Task AddStoreAuthorization(CreateOrUpDateStoreAuthorizationDto input) { return await _authorizationService.AddStoreAuthorization(input); } /// /// 修改店铺授权码 /// /// /// [HttpPost("/api/authorization/updatestoreauthorization")] public async Task UpdateStoreAuthorization(string id) { return await _authorizationService.UpdateStoreAuthorization(id); } /// /// 修改店铺授权时间 /// /// /// [HttpPost("/api/authorization/updatestoreauthtime")] public async Task UpdateStoreAuthTime(CreateOrUpDateStoreAuthorizationDto input) { return await _authorizationService.UpdateStoreAuthTime(input); } /// /// 删除店铺权限 /// /// /// [HttpPost("/api/authorization/delstoreauthorization")] public async Task DelStoreAuthorization(string id) { return await _authorizationService.DelStoreAuthorization(id); } /// /// 查询店铺授权信息 /// /// /// [HttpGet("/api/authorization/GetStoreAuthorizationById")] public async Task GetStoreAuthorizationById(string id) { return await _authorizationService.GetStoreAuthorizationById(id); } /// /// 查询店铺授权信息 更具KEY /// /// /// [HttpGet("/api/authorization/GetStoreAuthorizationByKey"), AllowAnonymous] public async Task GetStoreAuthorizationByKey(string key) { return await _authorizationService.GetStoreAuthorizationByKey(key); } /// /// CodeFirst /// /// public void CodeFirst() { _authorizationService.CodeFirst(); } } }