cmb
This commit is contained in:
parent
50c6f1f995
commit
0c1243419e
|
|
@ -21,7 +21,7 @@ data:
|
||||||
poolSize: 5 #连接池大小,不配置,或配置为0表示不启用连接池
|
poolSize: 5 #连接池大小,不配置,或配置为0表示不启用连接池
|
||||||
minIdleConns: 2 #最小空闲连接数
|
minIdleConns: 2 #最小空闲连接数
|
||||||
connMaxIdleTime: 30s #每个连接最大空闲时间,如果超过了这个时间会被关闭
|
connMaxIdleTime: 30s #每个连接最大空闲时间,如果超过了这个时间会被关闭
|
||||||
db: 1
|
db: 3
|
||||||
|
|
||||||
rocketMQ:
|
rocketMQ:
|
||||||
addr: "http://rmq-cn-nwy3fn4ex09.cn-chengdu.rmq.aliyuncs.com:8080"
|
addr: "http://rmq-cn-nwy3fn4ex09.cn-chengdu.rmq.aliyuncs.com:8080"
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ func (v *Cmb) OrderConsume(ctx context.Context, order *bo.OrderBo) (outRequestNo
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = v.registerNotifyTag(ctx, orderWechat.StockID); err != nil {
|
if err = v.registerNotifyTag(ctx, orderWechat.StockCreatorMchid, orderWechat.StockID); err != nil {
|
||||||
return outRequestNo, err
|
return outRequestNo, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -46,7 +46,7 @@ func (v *Cmb) OrderConsume(ctx context.Context, order *bo.OrderBo) (outRequestNo
|
||||||
return orderWechat.OutRequestNo, err
|
return orderWechat.OutRequestNo, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *Cmb) registerNotifyTag(ctx context.Context, stockID string) error {
|
func (v *Cmb) registerNotifyTag(ctx context.Context, stockCreatorMchID, stockID string) error {
|
||||||
|
|
||||||
if err := v.WechatCpnRepo.RegisterNotifyTag(ctx, stockID); err != nil {
|
if err := v.WechatCpnRepo.RegisterNotifyTag(ctx, stockID); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type WechatNotifyRegisterTagRepo interface {
|
type WechatNotifyRegisterTagRepo interface {
|
||||||
GetByStockIdAndMchId(ctx context.Context, stockId, stockCreatorMchID string) (*bo.WechatNotifyRegisterTagBo, error)
|
GetByStockIdAndMchId(ctx context.Context, stockCreatorMchID, stockId string) (*bo.WechatNotifyRegisterTagBo, error)
|
||||||
Create(ctx context.Context, req *bo.WechatNotifyRegisterTagBo) (*bo.WechatNotifyRegisterTagBo, error)
|
Create(ctx context.Context, req *bo.WechatNotifyRegisterTagBo) (*bo.WechatNotifyRegisterTagBo, error)
|
||||||
Success(ctx context.Context, id int32) error
|
Success(ctx context.Context, id int32) error
|
||||||
Fail(ctx context.Context, id int32, remark string) error
|
Fail(ctx context.Context, id int32, remark string) error
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ func (p *OrderRepoImpl) GetByOutBizNo(ctx context.Context, outBizNo string) (*bo
|
||||||
if tx.Error != nil {
|
if tx.Error != nil {
|
||||||
return nil, tx.Error
|
return nil, tx.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
if tx.RowsAffected == 0 {
|
if tx.RowsAffected == 0 {
|
||||||
return nil, gorm.ErrRecordNotFound
|
return nil, gorm.ErrRecordNotFound
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ func (r *ProductRepoImpl) GetByPNO(ctx context.Context, PNO string) (*bo.Product
|
||||||
if tx.Error != nil {
|
if tx.Error != nil {
|
||||||
return nil, tx.Error
|
return nil, tx.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
if tx.RowsAffected == 0 {
|
if tx.RowsAffected == 0 {
|
||||||
return nil, gorm.ErrRecordNotFound
|
return nil, gorm.ErrRecordNotFound
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,14 +27,15 @@ func (p *WechatNotifyRegisterTagRepoImpl) DB(ctx context.Context) *gorm.DB {
|
||||||
return p.db.DB(ctx).Model(model.WechatNotifyRegisterTag{})
|
return p.db.DB(ctx).Model(model.WechatNotifyRegisterTag{})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *WechatNotifyRegisterTagRepoImpl) GetByStockIdAndMchId(ctx context.Context, stockId, stockCreatorMchID string) (*bo.WechatNotifyRegisterTagBo, error) {
|
func (p *WechatNotifyRegisterTagRepoImpl) GetByStockIdAndMchId(ctx context.Context, stockCreatorMchID, stockId string) (*bo.WechatNotifyRegisterTagBo, error) {
|
||||||
info := &model.WechatNotifyRegisterTag{}
|
info := &model.WechatNotifyRegisterTag{}
|
||||||
|
|
||||||
tx := p.DB(ctx).Where(model.WechatNotifyRegisterTag{StockID: stockId, StockCreatorMchID: stockCreatorMchID}).Find(&info)
|
tx := p.DB(ctx).Where(model.WechatNotifyRegisterTag{StockCreatorMchID: stockCreatorMchID, StockID: stockId}).Find(&info)
|
||||||
|
|
||||||
if tx.Error != nil {
|
if tx.Error != nil {
|
||||||
return nil, tx.Error
|
return nil, tx.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
if tx.RowsAffected == 0 {
|
if tx.RowsAffected == 0 {
|
||||||
return nil, gorm.ErrRecordNotFound
|
return nil, gorm.ErrRecordNotFound
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue