suyiiyii 0d5fa6e9f7
refactor(user): 修改 LoginService 返回值
- 将固定返回值 111 改为根据请求密码动态生成
- 使用密码的第一个字符作为 UserId 的值
2025-01-21 23:33:55 +08:00

22 lines
485 B
Go

package service
import (
"context"
user "github.com/suyiiyii/hertz101/rpc_gen/kitex_gen/user"
)
type LoginService struct {
ctx context.Context
} // NewLoginService new LoginService
func NewLoginService(ctx context.Context) *LoginService {
return &LoginService{ctx: ctx}
}
// Run create note info
func (s *LoginService) Run(req *user.LoginReq) (resp *user.LoginResp, err error) {
// Finish your business logic.
resp = &user.LoginResp{UserId: int32(req.Password[0])}
return
}