feat: import services and standardize Go 1.26.5
This commit is contained in:
24
apps/base/passport/internal/logic/register/pwd.go
Normal file
24
apps/base/passport/internal/logic/register/pwd.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package register
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.apinb.com/bsm-apps/passport/internal/models"
|
||||
pb "git.apinb.com/bsm-apps/passport/pb"
|
||||
"git.apinb.com/bsm-sdk/core/errcode"
|
||||
)
|
||||
|
||||
// 帐号密码注册
|
||||
func Pwd(ctx context.Context, in *pb.RegisterRequest) (reply *pb.RegisterReply, err error) {
|
||||
if in.Account == "" || in.Password == "" {
|
||||
return nil, errcode.ErrInvalidArgument
|
||||
}
|
||||
|
||||
//账号唯一验证
|
||||
found := models.PassportAccountExists("account", in.Account)
|
||||
if found {
|
||||
return nil, errcode.ErrAlreadyExists
|
||||
}
|
||||
|
||||
return Do(in)
|
||||
}
|
||||
Reference in New Issue
Block a user