|
@@ -138,22 +138,16 @@ namespace OASystem.Infrastructure.Repositories.Resource
|
|
if (info.Id < 1) //添加
|
|
if (info.Id < 1) //添加
|
|
{
|
|
{
|
|
var add = await _sqlSugar.Insertable(info).ExecuteCommandAsync();
|
|
var add = await _sqlSugar.Insertable(info).ExecuteCommandAsync();
|
|
- if (add > 0)
|
|
|
|
- {
|
|
|
|
- result.Code = 200;
|
|
|
|
- result.Msg = $"操作成功!";
|
|
|
|
- }
|
|
|
|
|
|
+ if (add < 1) return result;
|
|
}
|
|
}
|
|
- else if (info.Id > 0) //编辑
|
|
|
|
|
|
+ else //编辑
|
|
{
|
|
{
|
|
var upd = await _sqlSugar.Updateable(info).IgnoreColumns(x => new { x.CreateUserId, x.CreateTime }).ExecuteCommandAsync();
|
|
var upd = await _sqlSugar.Updateable(info).IgnoreColumns(x => new { x.CreateUserId, x.CreateTime }).ExecuteCommandAsync();
|
|
- if (upd > 0)
|
|
|
|
- {
|
|
|
|
- result.Code = 200;
|
|
|
|
- result.Msg = $"操作成功!";
|
|
|
|
- }
|
|
|
|
|
|
+ if (upd < 1) return result;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ result.Code = 200;
|
|
|
|
+ result.Msg = $"操作成功!";
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|