功能修改
This commit is contained in:
@@ -74,7 +74,12 @@ public class SegmentationService(IRepository<Segmentation> _segmentationReposito
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> AddOrUpdateSegmentation(SegmentationAddOrEdit addOrEditSegmentation)
|
||||
{
|
||||
|
||||
|
||||
if (addOrEditSegmentation.Id != null)
|
||||
{
|
||||
|
||||
await SaveSegmentationVersionAsync(new SaveSegmentationVersionAsyncInDto() { SegmentationId = addOrEditSegmentation.Id.Value });
|
||||
}
|
||||
var entity = await _segmentationRepository.InsertOrUpdateAsync(addOrEditSegmentation, true);
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
}
|
||||
@@ -84,8 +89,8 @@ public class SegmentationService(IRepository<Segmentation> _segmentationReposito
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task SaveSegmentationVersionAsync(SaveSegmentationVersionAsyncInDto inDto)
|
||||
|
||||
private async Task SaveSegmentationVersionAsync(SaveSegmentationVersionAsyncInDto inDto)
|
||||
{
|
||||
var data = await _segmentationRepository.FirstOrDefaultNoTrackingAsync(x => x.Id == inDto.SegmentationId);
|
||||
var segmentList = await _segmentRepository.Where(x => x.SegmentationId == inDto.SegmentationId).OrderBy(x=>x.SegmentNumber).ProjectTo<SegmentVersionData>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
Reference in New Issue
Block a user