2026-08-11 23:41:18 +08:00
|
|
|
using YD_Event.Application.ScoreRule.Dtos;
|
|
|
|
|
|
|
|
|
|
namespace YD_Event.Application.ScoreRule;
|
|
|
|
|
|
2026-08-30 21:46:05 +08:00
|
|
|
[ApiDescriptionSettings("打分系统")]
|
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();
|
|
|
|
|
}
|