gomod引用
This commit is contained in:
@@ -5,10 +5,12 @@ import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
"order/dao"
|
||||
"order/model/dto"
|
||||
"order/model/entity"
|
||||
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
)
|
||||
|
||||
type paymentConfig struct{}
|
||||
@@ -34,7 +36,7 @@ func (s *paymentConfig) CreatePaymentConfig(ctx context.Context, req *dto.Create
|
||||
|
||||
// 3. 创建配置实体
|
||||
config := parseConfigMap(req.PayMethod, req.Config)
|
||||
config.TenantID = req.TenantID
|
||||
config.TenantId = req.TenantID
|
||||
config.Description = req.Remark
|
||||
config.Enabled = req.IsEnabled
|
||||
|
||||
@@ -45,8 +47,8 @@ func (s *paymentConfig) CreatePaymentConfig(ctx context.Context, req *dto.Create
|
||||
|
||||
// 5. 返回结果
|
||||
resp := &dto.PaymentConfigResp{
|
||||
ID: config.ID.Hex(),
|
||||
TenantID: config.TenantID,
|
||||
ID: config.Id.Hex(),
|
||||
TenantID: gconv.String(config.TenantId),
|
||||
PayMethod: config.PayMethod,
|
||||
Config: buildConfigMap(config),
|
||||
IsEnabled: config.Enabled,
|
||||
@@ -80,7 +82,7 @@ func (s *paymentConfig) UpdatePaymentConfig(ctx context.Context, req *dto.Update
|
||||
}
|
||||
|
||||
// 3. 检查是否是租户自己的配置
|
||||
if config.TenantID != req.TenantID {
|
||||
if config.TenantId != req.TenantID {
|
||||
return nil, errors.New("无权限操作该配置")
|
||||
}
|
||||
|
||||
@@ -99,8 +101,8 @@ func (s *paymentConfig) UpdatePaymentConfig(ctx context.Context, req *dto.Update
|
||||
|
||||
// 6. 返回结果
|
||||
resp := &dto.PaymentConfigResp{
|
||||
ID: config.ID.Hex(),
|
||||
TenantID: config.TenantID,
|
||||
ID: config.Id.Hex(),
|
||||
TenantID: gconv.String(config.TenantId),
|
||||
PayMethod: config.PayMethod,
|
||||
ConfigName: config.ConfigName,
|
||||
Remark: config.Description,
|
||||
@@ -147,8 +149,8 @@ func (s *paymentConfig) GetPaymentConfig(ctx context.Context, req *dto.QueryPaym
|
||||
|
||||
// 3. 返回结果
|
||||
resp := &dto.PaymentConfigResp{
|
||||
ID: config.ID.Hex(),
|
||||
TenantID: config.TenantID,
|
||||
ID: config.Id.Hex(),
|
||||
TenantID: gconv.String(config.TenantId),
|
||||
PayMethod: config.PayMethod,
|
||||
ConfigName: config.ConfigName,
|
||||
Remark: config.Description,
|
||||
@@ -178,8 +180,8 @@ func (s *paymentConfig) GetPaymentConfigList(ctx context.Context, tenantID strin
|
||||
var resp []dto.PaymentConfigResp
|
||||
for _, config := range configs {
|
||||
resp = append(resp, dto.PaymentConfigResp{
|
||||
ID: config.ID.Hex(),
|
||||
TenantID: config.TenantID,
|
||||
ID: config.Id.Hex(),
|
||||
TenantID: gconv.String(config.TenantId),
|
||||
PayMethod: config.PayMethod,
|
||||
ConfigName: config.ConfigName,
|
||||
Remark: config.Description,
|
||||
@@ -215,7 +217,7 @@ func (s *paymentConfig) DeletePaymentConfig(ctx context.Context, tenantID, confi
|
||||
}
|
||||
|
||||
// 3. 检查是否是租户自己的配置
|
||||
if config.TenantID != tenantID {
|
||||
if config.TenantId != tenantID {
|
||||
return errors.New("无权限操作该配置")
|
||||
}
|
||||
|
||||
@@ -255,7 +257,7 @@ func (s *paymentConfig) updateConfigStatus(ctx context.Context, tenantID, config
|
||||
}
|
||||
|
||||
// 3. 检查是否是租户自己的配置
|
||||
if config.TenantID != tenantID {
|
||||
if config.TenantId != tenantID {
|
||||
return errors.New("无权限操作该配置")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user