用户修改头像、昵称、绑定手机号、获取用户详细信息
This commit is contained in:
26
internal/controller/user/user_v1_bind_phone.go
Normal file
26
internal/controller/user/user_v1_bind_phone.go
Normal file
@ -0,0 +1,26 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"server/internal/model"
|
||||
"server/internal/service"
|
||||
|
||||
"server/api/user/v1"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) BindPhone(ctx context.Context, req *v1.BindPhoneReq) (res *v1.BindPhoneRes, err error) {
|
||||
|
||||
id := g.RequestFromCtx(ctx).GetCtxVar("id").Int64()
|
||||
|
||||
out, err := service.User().BindPhone(ctx, &model.UserBindPhoneIn{
|
||||
PhoneCode: req.Code,
|
||||
Phone: req.Phone,
|
||||
Id: id,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.BindPhoneRes{Success: out.Success}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user