using System.Collections.Generic; using System.Threading.Tasks; using GxPress.Auth; using GxPress.Request._AdminVerify; using GxPress.Request.App.AdminVerify; using GxPress.Result.App.AdminVerify; using GxPress.Service.Interface.AdminVerify; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; namespace GxPress.Api.AppControllers { /// /// 验证信息 /// [Route("api/web/admin-verify")] [ApiController] [Authorize] public class WebAdminVerifyController : ControllerBase { private readonly IAdminVerifyService _adminVerifyService; private readonly ILoginContext _loginContext; public WebAdminVerifyController(IAdminVerifyService adminVerifyService, ILoginContext loginContext) { _adminVerifyService = adminVerifyService; _loginContext = loginContext; } /// /// 清空 /// /// [HttpDelete("delete")] public async Task DeleteAllAsync() { return await _adminVerifyService.DeleteAllAsync(_loginContext.AccountId); } /// /// 修改 /// /// /// [HttpPut("update")] public async Task UpdateAsync(AdminVerifyUpdateRequest request) { return await _adminVerifyService.UpdateAsync(request.Id, request.AdminVerifyTypeConst); } /// /// 根据用户查询 /// /// [HttpPost("search")] public async Task> GetAllAsync() { return await _adminVerifyService.GetAllAsync(_loginContext.AccountId); } /// /// 查询未处理条数 /// /// [HttpPost("count")] public async Task GetUDisposeCount() { return await _adminVerifyService.GetUDisposeCount(_loginContext.AccountId); } /// /// 添加好友 /// /// /// [HttpPost("add-friend")] public async Task AddFriendAsync(AdminVerifyInFriendsRequest request) { request.UserId = _loginContext.AccountId; return await _adminVerifyService.AddFriendAsync(request); } } }