19 lines
889 B
C#
Raw Normal View History

2026-08-11 23:41:18 +08:00
using YD_Event.Application.ScoreRule.Dtos;
namespace YD_Event.Application.ScoreRule;
[ApiDescriptionSettings("打分系统")]
2026-09-08 16:27:27 +08:00
[Route("api/scorerule")]
2026-08-11 23:41:18 +08:00
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();
}