1、新增自定义用户私人价格2、优化api服务鉴权缓存3、新增管理员端对公充值
This commit is contained in:
@@ -34,7 +34,11 @@ func (l *CreateUserProductLogic) CreateUserProduct(in *sentinel.CreateUserProduc
|
||||
if isExist {
|
||||
return nil, errors.New("该产品已定阅读,无法重复订阅")
|
||||
}
|
||||
_, err = l.svcCtx.UserProductsModel.Insert(l.ctx, &model.UserProducts{UserId: in.UserId, ProductId: in.ProductId})
|
||||
product, err := l.svcCtx.ProductsModel.FindOne(l.ctx, in.ProductId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
_, err = l.svcCtx.UserProductsModel.Insert(l.ctx, &model.UserProducts{UserId: in.UserId, ProductId: in.ProductId, ProductPrice: product.ProductPrice})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user