SnapshotUserController.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using Hotline.Application.Snapshot.Contracts;
  2. using Hotline.Repository.SqlSugar.Extensions;
  3. using Hotline.Share.Dtos;
  4. using Hotline.Share.Dtos.Snapshot;
  5. using Hotline.Share.Tools;
  6. using Microsoft.AspNetCore.Mvc;
  7. using System.ComponentModel;
  8. namespace Hotline.Api.Controllers.Snapshot;
  9. [Description("随手拍用户管理")]
  10. public class SnapshotUserController : BaseController
  11. {
  12. private readonly ISnapshotUserApplication _snapshotUserApplication;
  13. public SnapshotUserController(ISnapshotUserApplication snapshotUserApplication)
  14. {
  15. _snapshotUserApplication = snapshotUserApplication;
  16. }
  17. /// <summary>
  18. /// 安全志愿者列表
  19. /// </summary>
  20. /// <returns></returns>
  21. [HttpGet("citizen_relation")]
  22. public async Task<PagedDto<CitizenRelationSafetyTypeOutDto>> GetCitizenRelationSafetyType([FromQuery] CitizenRelationSafetyTypeInDto dto)
  23. => (await _snapshotUserApplication.GetCitizenRelationSafetyType(dto).ToPagedListAsync(dto)).ToPaged();
  24. /// <summary>
  25. /// 添加安全志愿者
  26. /// </summary>
  27. /// <param name="dto"></param>
  28. /// <returns></returns>
  29. [HttpPost("citizen_relation")]
  30. public async Task AddCitizenRelationSafetyTypeInDto([FromBody]AddCitizenRelationSafetyTypeInDto dto)
  31. => await _snapshotUserApplication.AddCitizenRelationSafetyType(dto, HttpContext.RequestAborted);
  32. }