优化修改网站域名时套餐相关检查

This commit is contained in:
GoEdgeLab
2023-12-13 19:02:12 +08:00
parent 408fdcb6f2
commit f878abad16
2 changed files with 14 additions and 3 deletions

View File

@@ -90,7 +90,7 @@ func (this *IndexAction) RunPost(params struct {
// 记录日志
defer this.CreateLogInfo(codes.Server_ServerNamesLogUpdateServerNames, params.ServerId)
serverNames := []*serverconfigs.ServerNameConfig{}
var serverNames = []*serverconfigs.ServerNameConfig{}
err := json.Unmarshal([]byte(params.ServerNames), &serverNames)
if err != nil {
this.Fail("域名解析失败:" + err.Error())
@@ -105,10 +105,13 @@ func (this *IndexAction) RunPost(params struct {
this.NotFound("server", params.ServerId)
return
}
clusterId := serverResp.Server.NodeCluster.Id
var clusterId = serverResp.Server.NodeCluster.Id
// 检查套餐
this.checkPlan(params.ServerId, serverNames)
// 检查域名是否已经存在
allServerNames := serverconfigs.PlainServerNames(serverNames)
var allServerNames = serverconfigs.PlainServerNames(serverNames)
if len(allServerNames) > 0 {
dupResp, err := this.RPC().ServerRPC().CheckServerNameDuplicationInNodeCluster(this.AdminContext(), &pb.CheckServerNameDuplicationInNodeClusterRequest{
ServerNames: allServerNames,

View File

@@ -0,0 +1,8 @@
// Copyright 2023 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn .
//go:build !plus
package serverNames
func (this *IndexAction) checkPlan(serverId int64, serverNames []*serverconfigs.ServerNameConfig) {
// stub
}