马梓彭 99a1857088 完善二期接口
补齐接口文档和上线SQL
优化底层保存逻辑
2026-08-30 21:46:05 +08:00

18 lines
864 B
C#

using YD_Event.Application.ScoreRule.Dtos;
namespace YD_Event.Application.ScoreRule;
[ApiDescriptionSettings("打分系统")]
public class ScoreRuleService : BaseService<YD_Event.Core.Entities.ScoreRule>, ITransient
{
private readonly ISqlSugarRepository<YD_Event.Core.Entities.ScoreRule> _repository;
public ScoreRuleService(ISqlSugarRepository<YD_Event.Core.Entities.ScoreRule> repository) : base(repository) => _repository = repository;
[DisplayName("获取可用计分规则")]
public async Task<List<ScoreRuleOutput>> GetList() => await _repository.AsQueryable()
.Where(x => x.Status == AvailabilityStatus.Enable)
.OrderBy(x => x.Sort)
.Select(x => new ScoreRuleOutput { Id = x.Id, RuleCode = x.RuleCode, RuleName = x.RuleName, JudgeRoleSchemaJson = x.JudgeRoleSchemaJson, Sort = x.Sort })
.ToListAsync();
}