This commit is contained in:
2026-01-23 14:24:09 +08:00
parent 664b7b2841
commit 5d7030a065
2 changed files with 18 additions and 0 deletions

View File

@@ -22,6 +22,9 @@ import (
"github.com/zeromicro/go-zero/core/logx"
)
// 维护模式开关true 表示维护中false 表示正常服务
const maintenanceMode = true
type QueryServiceLogic struct {
logx.Logger
ctx context.Context
@@ -37,6 +40,12 @@ func NewQueryServiceLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Quer
}
func (l *QueryServiceLogic) QueryService(req *types.QueryServiceReq) (resp *types.QueryServiceResp, err error) {
// 维护中,暂停使用
// TODO: 维护完成后将 maintenanceMode 设置为 false
if maintenanceMode {
return nil, errors.Wrapf(xerr.NewErrMsg("系统维护中,暂停使用"), "")
}
if req.AgentIdentifier != "" {
l.ctx = context.WithValue(l.ctx, "agentIdentifier", req.AgentIdentifier)
} else if req.App {