用户修改头像、昵称、绑定手机号、获取用户详细信息

This commit is contained in:
chy
2025-06-06 15:48:05 +08:00
parent 01b898163a
commit e40f9987db
12 changed files with 280 additions and 19 deletions

View File

@ -0,0 +1,24 @@
package user
import (
"context"
"github.com/gogf/gf/v2/frame/g"
"server/internal/model"
"server/internal/service"
"server/api/user/v1"
)
func (c *ControllerV1) GetPhoneCode(ctx context.Context, req *v1.GetPhoneCodeReq) (res *v1.GetPhoneCodeRes, err error) {
id := g.RequestFromCtx(ctx).GetCtxVar("id").Int64()
out, err := service.User().Code(ctx, &model.GetPhoneCodeIn{
Phone: req.Phone,
Id: id,
})
if err != nil {
return nil, err
}
return &v1.GetPhoneCodeRes{Success: out.Success}, nil
}