refactor: reorganize modules and add Linux build tooling
This commit is contained in:
30
module/social/relation/internal/logic/friend/get.go
Normal file
30
module/social/relation/internal/logic/friend/get.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package friend
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.apinb.com/bsm-sdk/core/errcode"
|
||||
"git.apinb.com/bsm-sdk/core/printer"
|
||||
"git.apinb.com/bsm-sdk/core/service"
|
||||
"bsm/full/module/social/relation/internal/logic/common"
|
||||
pb "bsm/full/module/social/relation/pb"
|
||||
)
|
||||
|
||||
// 获取用户信息卡片
|
||||
func Get(ctx context.Context, in *pb.IdentRequest) (reply *pb.RelationItem, err error) {
|
||||
_, err = service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if in.Identity == "" {
|
||||
return nil, errcode.ErrInvalidArgument
|
||||
}
|
||||
|
||||
reply, err = common.GetrelationInfoDetailCard(in.Identity)
|
||||
if err != nil {
|
||||
printer.Error(err.Error())
|
||||
return nil, errcode.ErrDB
|
||||
}
|
||||
|
||||
return reply, nil
|
||||
}
|
||||
Reference in New Issue
Block a user