refactor: localize protobuf definitions
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
)
|
||||
|
||||
// 关注状态
|
||||
func State(ctx context.Context, in *pb.IdentRequest) (reply *pb.StatusReply, err error) {
|
||||
func State(ctx context.Context, in *pb.IdentRequest) (reply *pb.DataStatusReply, err error) {
|
||||
auth, err := service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -29,7 +29,7 @@ func State(ctx context.Context, in *pb.IdentRequest) (reply *pb.StatusReply, err
|
||||
err = impl.DBService.Where("from_identity=? and to_identity=?", auth.Identity, in.Identity).First(&data).Error
|
||||
if err != nil {
|
||||
if err == gorm.ErrRecordNotFound {
|
||||
return &pb.StatusReply{
|
||||
return &pb.DataStatusReply{
|
||||
Data: vars.OK,
|
||||
Timeseq: time.Now().UnixMilli(),
|
||||
}, nil
|
||||
@@ -39,7 +39,7 @@ func State(ctx context.Context, in *pb.IdentRequest) (reply *pb.StatusReply, err
|
||||
}
|
||||
}
|
||||
|
||||
return &pb.StatusReply{
|
||||
return &pb.DataStatusReply{
|
||||
Data: data.Identity,
|
||||
Timeseq: time.Now().UnixMilli(),
|
||||
}, nil
|
||||
|
||||
Reference in New Issue
Block a user