33 lines
987 B
Go
33 lines
987 B
Go
package app
|
|
|
|
import (
|
|
"context"
|
|
|
|
v1 "git.5iot.com/iotlcm-public/iotlcm-app/api/app/v1"
|
|
"git.5iot.com/iotlcm-public/iotlcm-app/internal/service"
|
|
)
|
|
|
|
func (c *ControllerV1) UserInfo(ctx context.Context, req *v1.UserInfoReq) (res *v1.UserInfoRes, err error) {
|
|
user, err := service.AppUser().Info(ctx)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &v1.UserInfoRes{AppUserInfoModel: *user}, nil
|
|
}
|
|
|
|
func (c *ControllerV1) UpdateUserInfo(ctx context.Context, req *v1.UpdateUserInfoReq) (res *v1.UpdateUserInfoRes, err error) {
|
|
user, err := service.AppUser().UpdateInfo(ctx, &req.AppUpdateUserInfoParam)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &v1.UpdateUserInfoRes{AppUserInfoModel: *user}, nil
|
|
}
|
|
|
|
func (c *ControllerV1) BindWechat(ctx context.Context, req *v1.BindWechatReq) (res *v1.BindWechatRes, err error) {
|
|
data, err := service.AppUser().BindWechat(ctx, &req.AppWechatBindParam)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &v1.BindWechatRes{AppWechatBindModel: *data}, nil
|
|
}
|