refactor all service dependency injection
This commit is contained in:
@@ -3,8 +3,10 @@ package coupon
|
||||
import (
|
||||
"context"
|
||||
|
||||
"bsm/full/module/ec/order/internal/impl"
|
||||
"bsm/full/module/ec/order/internal/models"
|
||||
pb "bsm/full/module/ec/order/pb"
|
||||
|
||||
"git.apinb.com/bsm-sdk/core/errcode"
|
||||
"git.apinb.com/bsm-sdk/core/printer"
|
||||
"git.apinb.com/bsm-sdk/core/service"
|
||||
@@ -23,7 +25,7 @@ func ByStatus(ctx context.Context, in *pb.Status) (reply *pb.CouponListReply, er
|
||||
result = make([]*pb.CouponItem, 0)
|
||||
)
|
||||
|
||||
err = models.DBService.Where("passport_id=?", auth.ID).Find(&coupon).Error
|
||||
err = impl.DBService.Where("passport_id=?", auth.ID).Find(&coupon).Error
|
||||
if err != nil {
|
||||
printer.Error(err.Error())
|
||||
return nil, errcode.ErrDB
|
||||
|
||||
Reference in New Issue
Block a user