firest commit

This commit is contained in:
wwweww
2026-02-21 22:48:40 +08:00
commit 55e8053e07
1034 changed files with 99049 additions and 0 deletions
@@ -0,0 +1,41 @@
package logic
import (
"context"
"juwan-backend/app/user/rpc/internal/svc"
"juwan-backend/app/user/rpc/pb"
"github.com/zeromicro/go-zero/core/logx"
)
type GetUserInfoLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewGetUserInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserInfoLogic {
return &GetUserInfoLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *GetUserInfoLogic) GetUserInfo(in *pb.GetUserInfoReq) (*pb.GetUserInfoResp, error) {
users := map[int64]string{
1: "WangHuahua",
2: "LiKunkun",
}
nikename := "Unknow"
if name, ok := users[in.Id]; ok {
nikename = name
}
return &pb.GetUserInfoResp{
Id: in.Id,
Nickname: nikename,
}, nil
}