|
@@ -0,0 +1,81 @@
|
|
|
+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
|
|
|
+{
|
|
|
+ /// <summary>
|
|
|
+ /// 验证信息
|
|
|
+ /// </summary>
|
|
|
+ [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;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 清空
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpDelete("delete")]
|
|
|
+ public async Task<bool> DeleteAllAsync()
|
|
|
+ {
|
|
|
+ return await _adminVerifyService.DeleteAllAsync(_loginContext.AccountId);
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 修改
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="request"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPut("update")]
|
|
|
+ public async Task<bool> UpdateAsync(AdminVerifyUpdateRequest request)
|
|
|
+ {
|
|
|
+ return await _adminVerifyService.UpdateAsync(request.Id, request.AdminVerifyTypeConst);
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 根据用户查询
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("search")]
|
|
|
+ public async Task<IEnumerable<AdminVerifySearchResult>> GetAllAsync()
|
|
|
+ {
|
|
|
+ return await _adminVerifyService.GetAllAsync(_loginContext.AccountId);
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 查询未处理条数
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("count")]
|
|
|
+ public async Task<int> GetUDisposeCount()
|
|
|
+ {
|
|
|
+ return await _adminVerifyService.GetUDisposeCount(_loginContext.AccountId);
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 添加好友
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="request"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("add-friend")]
|
|
|
+ public async Task<bool> AddFriendAsync(AdminVerifyInFriendsRequest request)
|
|
|
+ {
|
|
|
+ request.UserId = _loginContext.AccountId;
|
|
|
+ return await _adminVerifyService.AddFriendAsync(request);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|