refactor: centralize protobuf and remove go-zero
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
"bsm/full/module/base/feedback/internal/impl"
|
||||
"bsm/full/module/base/feedback/internal/models"
|
||||
pb "bsm/full/module/base/feedback/pb"
|
||||
"git.apinb.com/bsm-sdk/engine/exception"
|
||||
"git.apinb.com/bsm-sdk/core/errcode"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
func Get(ctx context.Context, in *pb.GetRequest) (reply *pb.GetReply, err error) {
|
||||
// 验证请求参数
|
||||
if in.GetIdentity() == "" {
|
||||
return nil, exception.ErrInvalidArgument
|
||||
return nil, errcode.ErrInvalidArgument
|
||||
}
|
||||
|
||||
out := new(pb.GetReply)
|
||||
@@ -29,7 +29,7 @@ func Get(ctx context.Context, in *pb.GetRequest) (reply *pb.GetReply, err error)
|
||||
err = impl.DBService.Preload("Images").Where("identity = ?", in.GetIdentity()).First(record).Error
|
||||
if err != nil {
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
return nil, exception.ErrNotFound
|
||||
return nil, errcode.ErrRecordNotFound
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user