mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-04-23 14:42:51 +08:00
fix(backend): 🐛 更新计划作业在sqlite数据库环境报错 (#120)
This commit is contained in:
parent
40e8eff5f3
commit
3152a8d3e8
@ -63,7 +63,7 @@ public sealed class JobService(DefaultRepository<Sys_Job> rpo, IJobRecordService
|
|||||||
public async Task<QueryJobRsp> EditAsync(UpdateJobReq req)
|
public async Task<QueryJobRsp> EditAsync(UpdateJobReq req)
|
||||||
{
|
{
|
||||||
req.ThrowIfInvalid();
|
req.ThrowIfInvalid();
|
||||||
var ret = await Rpo.UpdateDiy.Set(a => a.ExecutionCron == req.ExecutionCron)
|
var update = Rpo.UpdateDiy.Set(a => a.ExecutionCron == req.ExecutionCron)
|
||||||
.Set(a => a.HttpMethod == req.HttpMethod)
|
.Set(a => a.HttpMethod == req.HttpMethod)
|
||||||
.Set(a => a.JobName == req.JobName)
|
.Set(a => a.JobName == req.JobName)
|
||||||
.SetIf(req.RequestHeaders == null, a => a.RequestHeader, null)
|
.SetIf(req.RequestHeaders == null, a => a.RequestHeader, null)
|
||||||
@ -71,10 +71,17 @@ public sealed class JobService(DefaultRepository<Sys_Job> rpo, IJobRecordService
|
|||||||
.Set(a => a.RequestBody == req.RequestBody)
|
.Set(a => a.RequestBody == req.RequestBody)
|
||||||
.Set(a => a.RequestUrl == req.RequestUrl)
|
.Set(a => a.RequestUrl == req.RequestUrl)
|
||||||
.Set(a => a.UserId == req.UserId)
|
.Set(a => a.UserId == req.UserId)
|
||||||
.Where(a => a.Id == req.Id)
|
.Where(a => a.Id == req.Id);
|
||||||
.ExecuteUpdatedAsync()
|
|
||||||
.ConfigureAwait(false);
|
#pragma warning disable IDE0046
|
||||||
return ret[0].Adapt<QueryJobRsp>();
|
if (Rpo.Orm.Ado.DataType == DataType.Sqlite) {
|
||||||
|
#pragma warning restore IDE0046
|
||||||
|
return await update.ExecuteAffrowsAsync().ConfigureAwait(false) <= 0
|
||||||
|
? null
|
||||||
|
: await GetAsync(new QueryJobReq { Id = req.Id }).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (await update.ExecuteUpdatedAsync().ConfigureAwait(false))[0].Adapt<QueryJobRsp>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user