mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-08 06:00:24 +08:00
[网站服务]可以审核域名、查看审核结果
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
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()
|
||||
}
|
||||
Reference in New Issue
Block a user