mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-10 09:20:25 +08:00
40 lines
908 B
Go
40 lines
908 B
Go
package serverNames
|
|
|
|
import (
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
|
)
|
|
|
|
// 审核域名
|
|
type AuditAction struct {
|
|
actionutils.ParentAction
|
|
}
|
|
|
|
func (this *AuditAction) RunPost(params struct {
|
|
ServerId int64
|
|
AuditingOK bool
|
|
AuditingReason string
|
|
|
|
CSRF *actionutils.CSRF
|
|
}) {
|
|
defer this.CreateLogInfo("提交服务 %d 域名审核", params.ServerId)
|
|
|
|
if !params.AuditingOK && len(params.AuditingReason) == 0 {
|
|
this.FailField("auditingReason", "请输入审核不通过原因")
|
|
}
|
|
|
|
_, err := this.RPC().ServerRPC().UpdateServerNamesAuditing(this.AdminContext(), &pb.UpdateServerNamesAuditingRequest{
|
|
ServerId: params.ServerId,
|
|
AuditingResult: &pb.ServerNameAuditingResult{
|
|
IsOk: params.AuditingOK,
|
|
Reason: params.AuditingReason,
|
|
},
|
|
})
|
|
if err != nil {
|
|
this.ErrorPage(err)
|
|
return
|
|
}
|
|
|
|
this.Success()
|
|
}
|