17 lines
823 B
C#
17 lines
823 B
C#
|
|
using YD_Event.Application.ScoreRule.Dtos;
|
||
|
|
|
||
|
|
namespace YD_Event.Application.ScoreRule;
|
||
|
|
|
||
|
|
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();
|
||
|
|
}
|