PointsController.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using Hotline.Application.Snapshot.Contracts;
  2. using Hotline.Share.Dtos;
  3. using Hotline.Share.Dtos.Snapshot;
  4. using Microsoft.AspNetCore.Mvc;
  5. using System.ComponentModel;
  6. using Hotline.Repository.SqlSugar.Extensions;
  7. using Hotline.Share.Tools;
  8. namespace Hotline.Api.Controllers.Snapshot;
  9. /// <summary>
  10. /// 积分管理
  11. /// </summary>
  12. [Description("积分管理")]
  13. public class PointsController : BaseController
  14. {
  15. private readonly ISnapshotPointsApplication _pointsRecordApplication;
  16. public PointsController(ISnapshotPointsApplication pointsRecordApplication)
  17. {
  18. _pointsRecordApplication = pointsRecordApplication;
  19. }
  20. /// <summary>
  21. /// 积分集合
  22. /// </summary>
  23. /// <returns></returns>
  24. [HttpGet]
  25. public async Task<PagedDto<PointsItemsOutDto>> GetPointsItemsAsync([FromQuery]PointsItemsInDto dto)
  26. => (await _pointsRecordApplication.GetPointsItems(dto).ToPagedListAsync(dto)).ToPaged();
  27. /// <summary>
  28. /// 设置用户是安全卫士
  29. /// </summary>
  30. /// <returns></returns>
  31. [HttpPut("securitymax")]
  32. public async Task UpdateIsSecurityMaxAsync([FromBody] UpdateIsSecurityMaxAsync dto)
  33. => await _pointsRecordApplication.UpdateIsSecurityMaxAsync(dto, HttpContext.RequestAborted);
  34. }