mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-12-24 22:16:36 +08:00
审核中服务增加提交审核时间
This commit is contained in:
@@ -169,6 +169,7 @@ func (this *ServerDAO) CreateServer(tx *dbs.Tx,
|
||||
op.ServerNames = serverNamesJSON
|
||||
}
|
||||
op.IsAuditing = isAuditing
|
||||
op.AuditingAt = time.Now().Unix()
|
||||
if len(auditingServerNamesJSON) > 0 {
|
||||
op.AuditingServerNames = auditingServerNamesJSON
|
||||
}
|
||||
@@ -533,22 +534,22 @@ func (this *ServerDAO) InitServerWeb(tx *dbs.Tx, serverId int64) (int64, error)
|
||||
}
|
||||
|
||||
// FindServerServerNames 查找ServerNames配置
|
||||
func (this *ServerDAO) FindServerServerNames(tx *dbs.Tx, serverId int64) (serverNamesJSON []byte, isAuditing bool, auditingServerNamesJSON []byte, auditingResultJSON []byte, err error) {
|
||||
func (this *ServerDAO) FindServerServerNames(tx *dbs.Tx, serverId int64) (serverNamesJSON []byte, isAuditing bool, auditingAt int64, auditingServerNamesJSON []byte, auditingResultJSON []byte, err error) {
|
||||
if serverId <= 0 {
|
||||
return
|
||||
}
|
||||
one, err := this.Query(tx).
|
||||
Pk(serverId).
|
||||
Result("serverNames", "isAuditing", "auditingServerNames", "auditingResult").
|
||||
Result("serverNames", "isAuditing", "auditingAt", "auditingServerNames", "auditingResult").
|
||||
Find()
|
||||
if err != nil {
|
||||
return nil, false, nil, nil, err
|
||||
return nil, false, 0, nil, nil, err
|
||||
}
|
||||
if one == nil {
|
||||
return
|
||||
}
|
||||
server := one.(*Server)
|
||||
return []byte(server.ServerNames), server.IsAuditing == 1, []byte(server.AuditingServerNames), []byte(server.AuditingResult), nil
|
||||
return []byte(server.ServerNames), server.IsAuditing == 1, int64(server.AuditingAt), []byte(server.AuditingServerNames), []byte(server.AuditingResult), nil
|
||||
}
|
||||
|
||||
// UpdateServerNames 修改ServerNames配置
|
||||
@@ -580,6 +581,9 @@ func (this *ServerDAO) UpdateAuditingServerNames(tx *dbs.Tx, serverId int64, isA
|
||||
op := NewServerOperator()
|
||||
op.Id = serverId
|
||||
op.IsAuditing = isAuditing
|
||||
if isAuditing {
|
||||
op.AuditingAt = time.Now().Unix()
|
||||
}
|
||||
if len(auditingServerNamesJSON) == 0 {
|
||||
op.AuditingServerNames = "[]"
|
||||
} else {
|
||||
|
||||
@@ -10,6 +10,7 @@ type Server struct {
|
||||
Name string `field:"name"` // 名称
|
||||
Description string `field:"description"` // 描述
|
||||
ServerNames string `field:"serverNames"` // 域名列表
|
||||
AuditingAt uint64 `field:"auditingAt"` // 审核提交时间
|
||||
AuditingServerNames string `field:"auditingServerNames"` // 审核中的域名
|
||||
IsAuditing uint8 `field:"isAuditing"` // 是否正在审核
|
||||
AuditingResult string `field:"auditingResult"` // 审核结果
|
||||
@@ -53,6 +54,7 @@ type ServerOperator struct {
|
||||
Name interface{} // 名称
|
||||
Description interface{} // 描述
|
||||
ServerNames interface{} // 域名列表
|
||||
AuditingAt interface{} // 审核提交时间
|
||||
AuditingServerNames interface{} // 审核中的域名
|
||||
IsAuditing interface{} // 是否正在审核
|
||||
AuditingResult interface{} // 审核结果
|
||||
|
||||
Reference in New Issue
Block a user