2 Star 2 Fork 0

lzz/users

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
updatemobilelogic.go 864 Bytes
一键复制 编辑 原始数据 按行查看 历史
liangzhenchao 提交于 5个月前 . feat addrlist
package userlogic
import (
"context"
"fmt"
"gitee.com/lzzandlyx/users/internal/svc"
"gitee.com/lzzandlyx/users/user"
"github.com/zeromicro/go-zero/core/logx"
)
type UpdateMobileLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewUpdateMobileLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateMobileLogic {
return &UpdateMobileLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *UpdateMobileLogic) UpdateMobile(in *user.UpdateMobileRequest) (*user.UpdateMobileResponse, error) {
if in.ID == 0 {
return nil, fmt.Errorf("ID不能为为空")
}
if in.Mobile == "" {
return nil, fmt.Errorf("手机号不能为空")
}
err := l.svcCtx.ModelUser.UpdateMobile(l.ctx, in.ID, in.Mobile)
if err != nil {
return nil, err
}
return &user.UpdateMobileResponse{}, nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/lzzandlyx/users.git
git@gitee.com:lzzandlyx/users.git
lzzandlyx
users
users
1f6533e23511

搜索帮助