Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
commit
e150fbb807
|
|
@ -91,26 +91,31 @@ public class SegmentationService(IRepository<Segmentation> _segmentationReposito
|
||||||
private async Task SaveSegmentationVersionAsync(Guid segmentationId)
|
private async Task SaveSegmentationVersionAsync(Guid segmentationId)
|
||||||
{
|
{
|
||||||
var data = await _segmentationRepository.FirstOrDefaultNoTrackingAsync(x => x.Id == segmentationId);
|
var data = await _segmentationRepository.FirstOrDefaultNoTrackingAsync(x => x.Id == segmentationId);
|
||||||
// 如果是新增或修改,记录一条版本信息
|
|
||||||
var maxVersion = await _segmentationVersionRepository
|
|
||||||
.Where(x => x.SegmentationId == data.Id)
|
|
||||||
.OrderByDescending(x => x.Version)
|
|
||||||
.Select(x => x.Version)
|
|
||||||
.FirstOrDefaultAsync();
|
|
||||||
|
|
||||||
var newVersion = maxVersion + 1;
|
if (data.SEGUrl != string.Empty)
|
||||||
var versionEntity = new SegmentationVersion
|
|
||||||
{
|
{
|
||||||
SegmentationId = data.Id,
|
// 如果是新增或修改,记录一条版本信息
|
||||||
Version = newVersion,
|
var maxVersion = await _segmentationVersionRepository
|
||||||
SegmentationJson = data.SegmentationJson,
|
.Where(x => x.SegmentationId == data.Id)
|
||||||
SEGUrl = data.SEGUrl,
|
.OrderByDescending(x => x.Version)
|
||||||
FileSize = data.FileSize,
|
.Select(x => x.Version)
|
||||||
};
|
.FirstOrDefaultAsync();
|
||||||
|
|
||||||
await _segmentationVersionRepository.AddAsync(versionEntity);
|
var newVersion = maxVersion + 1;
|
||||||
|
var versionEntity = new SegmentationVersion
|
||||||
|
{
|
||||||
|
SegmentationId = data.Id,
|
||||||
|
Version = newVersion,
|
||||||
|
SegmentationJson = data.SegmentationJson,
|
||||||
|
SEGUrl = data.SEGUrl,
|
||||||
|
FileSize = data.FileSize,
|
||||||
|
};
|
||||||
|
|
||||||
|
await _segmentationVersionRepository.AddAsync(versionEntity);
|
||||||
|
|
||||||
|
await _segmentationRepository.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
await _segmentationRepository.SaveChangesAsync();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue