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

@@ -25,6 +25,9 @@ import (
"github.com/zeromicro/go-zero/core/stores/sqlx" "github.com/zeromicro/go-zero/core/stores/sqlx"
) )
// 维护模式开关true 表示维护中false 表示正常服务
const maintenanceMode = true
type PaymentLogic struct { type PaymentLogic struct {
logx.Logger logx.Logger
ctx context.Context ctx context.Context
@@ -48,6 +51,12 @@ func NewPaymentLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PaymentLo
} }
func (l *PaymentLogic) Payment(req *types.PaymentReq) (resp *types.PaymentResp, err error) { func (l *PaymentLogic) Payment(req *types.PaymentReq) (resp *types.PaymentResp, err error) {
// 维护中,暂停使用
// TODO: 维护完成后将 maintenanceMode 设置为 false
if maintenanceMode {
return nil, errors.Wrapf(xerr.NewErrMsg("系统维护中,暂停使用"), "")
}
var paymentTypeResp *PaymentTypeResp var paymentTypeResp *PaymentTypeResp
var prepayData interface{} var prepayData interface{}
var orderID string var orderID string

View File

@@ -22,6 +22,9 @@ import (
"github.com/zeromicro/go-zero/core/logx" "github.com/zeromicro/go-zero/core/logx"
) )
// 维护模式开关true 表示维护中false 表示正常服务
const maintenanceMode = true
type QueryServiceLogic struct { type QueryServiceLogic struct {
logx.Logger logx.Logger
ctx context.Context 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) { 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 != "" { if req.AgentIdentifier != "" {
l.ctx = context.WithValue(l.ctx, "agentIdentifier", req.AgentIdentifier) l.ctx = context.WithValue(l.ctx, "agentIdentifier", req.AgentIdentifier)
} else if req.App { } else if req.App {