|
@@ -77,19 +77,16 @@ namespace TEAMModelOS.Controllers.Learn
|
|
/// <param name="request"></param>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
[HttpPost("SaveorUpdataLeanProcess")]
|
|
[HttpPost("SaveorUpdataLeanProcess")]
|
|
- public async Task<BaseJosnRPCResponse> SaveorUpdataLeanProcessAsync(JosnRPCRequest<List<LeanProcess>> request) {
|
|
|
|
|
|
+ public async Task<BaseJosnRPCResponse> SaveorUpdataLeanProcessAsync(JosnRPCRequest<LeanProcess> request) {
|
|
JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
|
|
JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
|
|
if (ValidateHelper.IsValid(request.@params))
|
|
if (ValidateHelper.IsValid(request.@params))
|
|
{
|
|
{
|
|
- request.@params.ForEach(x =>
|
|
|
|
- {
|
|
|
|
- if (string.IsNullOrEmpty(x.id))
|
|
|
|
|
|
+ if (string.IsNullOrEmpty(request.@params.id))
|
|
{
|
|
{
|
|
- x.id = Guid.NewGuid().ToString();
|
|
|
|
- x.createTime = new DateTimeOffset(DateTime.UtcNow).ToUnixTimeMilliseconds();
|
|
|
|
|
|
+ request.@params.id = Guid.NewGuid().ToString();
|
|
|
|
+ request.@params.createTime = new DateTimeOffset(DateTime.UtcNow).ToUnixTimeMilliseconds();
|
|
}
|
|
}
|
|
- });
|
|
|
|
- List<LeanProcess> leanProcesses = await cosmosDBV3Repository.SaveOrUpdateAll<LeanProcess>(request.@params);
|
|
|
|
|
|
+ LeanProcess leanProcesses = await cosmosDBV3Repository.SaveOrUpdate<LeanProcess>(request.@params);
|
|
builder.Data(leanProcesses);
|
|
builder.Data(leanProcesses);
|
|
}
|
|
}
|
|
return builder.build();
|
|
return builder.build();
|