[SSL证书]ACME任务中列出最后执行结果

This commit is contained in:
GoEdgeLab
2020-11-26 17:26:49 +08:00
parent c1c83990d6
commit e493f6c926
3 changed files with 39 additions and 11 deletions

View File

@@ -28,7 +28,7 @@ func init() {
}
// 生成日志
func (this *ACMETaskLogDAO) CreateACMELog(taskId int64, isOk bool, errMsg string) error {
func (this *ACMETaskLogDAO) CreateACMETaskLog(taskId int64, isOk bool, errMsg string) error {
op := NewACMETaskLogOperator()
op.TaskId = taskId
op.Error = errMsg
@@ -36,3 +36,15 @@ func (this *ACMETaskLogDAO) CreateACMELog(taskId int64, isOk bool, errMsg string
_, err := this.Save(op)
return err
}
// 取得任务的最后一条执行日志
func (this *ACMETaskLogDAO) FindLatestACMETasKLog(taskId int64) (*ACMETaskLog, error) {
one, err := this.Query().
Attr("taskId", taskId).
DescPk().
Find()
if err != nil || one == nil {
return nil, err
}
return one.(*ACMETaskLog), nil
}