Merge pull request '分页' (#37) from S01-轨迹中台 into dev

Reviewed-on: http://192.168.80.50:3000/Dotnet/SJZY.Track.Api/pulls/37
This commit is contained in:
liuwenxiang 2024-03-02 16:59:12 +08:00
commit b629aa6eaf
3 changed files with 4 additions and 4 deletions

View File

@ -190,7 +190,7 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("GetContentDropDownList")]
public async Task<List<DropdownListDataDto>> GetContentDropDownListAsync([FromBody] GetTrackTemplateContentDropDownListVO input)
public async Task<UnifyPageResultDto<DropdownListDataDto>> GetContentDropDownListAsync([FromBody] GetTrackTemplateContentDropDownListVO input)
{
return await _trackTemplateRepository.GetContentDropDownListAsync(input);
}

View File

@ -39,5 +39,5 @@ public interface ITrackTemplateRepository : IBasicRepository<TrackTemplateEntity
Task<bool> UpdateContentRangeAsync(List<TrackTemplateContentEntity> updateObjs);
Task<List<DropdownListDataDto>> GetContentDropDownListAsync(GetTrackTemplateContentDropDownListVO input);
Task<UnifyPageResultDto<DropdownListDataDto>> GetContentDropDownListAsync(GetTrackTemplateContentDropDownListVO input);
}

View File

@ -164,7 +164,7 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
return await Context.Updateable(updateObjs).ExecuteCommandHasChangeAsync();
}
public async Task<List<DropdownListDataDto>> GetContentDropDownListAsync(GetTrackTemplateContentDropDownListVO input)
public async Task<UnifyPageResultDto<DropdownListDataDto>> GetContentDropDownListAsync(GetTrackTemplateContentDropDownListVO input)
{
return await Context.Queryable<TrackTemplateContentEntity>()
.InnerJoin<TrackContentEntity>((templateContent, trackContent) => templateContent.TrackContentId == trackContent.Id)
@ -177,6 +177,6 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
Key = trackContent.Code + "-" + trackContent.Content
})
.Distinct()
.ToListAsync();
.ToPagedListAsync(input.PageIndex, input.PageSize);
}
}