refactor all service dependency injection
This commit is contained in:
@@ -3,8 +3,10 @@ package library
|
||||
import (
|
||||
"context"
|
||||
|
||||
"bsm/full/module/ec/address/internal/impl"
|
||||
"bsm/full/module/ec/address/internal/models"
|
||||
pb "bsm/full/module/ec/address/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 Fetch(ctx context.Context, in *pb.IdentRequest) (reply *pb.AddressListReply
|
||||
result = make([]*pb.AddressItem, 0)
|
||||
)
|
||||
|
||||
err = models.DBService.Where("owner_identity=?", auth.Identity).Find(&address).Error
|
||||
err = impl.DBService.Where("owner_identity=?", auth.Identity).Find(&address).Error
|
||||
if err != nil {
|
||||
printer.Error(err.Error())
|
||||
return nil, errcode.ErrDB
|
||||
|
||||
Reference in New Issue
Block a user