add: some user api and all api desc
This commit is contained in:
@@ -2,10 +2,12 @@ package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"juwan-backend/app/user_verifications/rpc/internal/svc"
|
||||
"juwan-backend/app/user_verifications/rpc/pb"
|
||||
|
||||
"github.com/jinzhu/copier"
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
@@ -24,7 +26,23 @@ func NewGetUserVerificationsByIdLogic(ctx context.Context, svcCtx *svc.ServiceCo
|
||||
}
|
||||
|
||||
func (l *GetUserVerificationsByIdLogic) GetUserVerificationsById(in *pb.GetUserVerificationsByIdReq) (*pb.GetUserVerificationsByIdResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
userVerification, err := l.svcCtx.UserVeriModelRO.Get(l.ctx, in.Id)
|
||||
if err != nil {
|
||||
logx.Errorf("GetUserVerificationsById err: %v", err)
|
||||
return nil, errors.New("get VerificationsById err")
|
||||
}
|
||||
pbVerification := pb.UserVerifications{}
|
||||
err = copier.Copy(&pbVerification, userVerification)
|
||||
if err != nil {
|
||||
logx.Errorf("copier copy err: %v", err)
|
||||
return nil, errors.New("copy Verification err")
|
||||
}
|
||||
createAt := userVerification.CreatedAt.Unix()
|
||||
updateAt := userVerification.UpdatedAt.Unix()
|
||||
pbVerification.CreatedAt = createAt
|
||||
pbVerification.UpdatedAt = updateAt
|
||||
|
||||
return &pb.GetUserVerificationsByIdResp{}, nil
|
||||
return &pb.GetUserVerificationsByIdResp{
|
||||
UserVerifications: &pbVerification,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user