chore: replace all cn comments to en version by volc api (#313)
This commit is contained in:
@@ -45,9 +45,9 @@ type UserApplicationService struct {
|
||||
DomainSVC user.User
|
||||
}
|
||||
|
||||
// 添加一个简单的 email 验证函数
|
||||
// Add a simple email verification function
|
||||
func isValidEmail(email string) bool {
|
||||
// 如果 email 字符串格式不正确,它会返回一个 error
|
||||
// If the email string is not in the correct format, it will return an error.
|
||||
_, err := mail.ParseAddress(email)
|
||||
return err == nil
|
||||
}
|
||||
@@ -55,7 +55,7 @@ func isValidEmail(email string) bool {
|
||||
func (u *UserApplicationService) PassportWebEmailRegisterV2(ctx context.Context, locale string, req *passport.PassportWebEmailRegisterV2PostRequest) (
|
||||
resp *passport.PassportWebEmailRegisterV2PostResponse, sessionKey string, err error,
|
||||
) {
|
||||
// 验证 email 格式是否合法
|
||||
// Verify that the email format is legitimate
|
||||
if !isValidEmail(req.GetEmail()) {
|
||||
return nil, "", errorx.New(errno.ErrUserInvalidParamCode, errorx.KV("msg", "Invalid email"))
|
||||
}
|
||||
@@ -100,7 +100,7 @@ func (u *UserApplicationService) allowRegisterChecker(email string) bool {
|
||||
return slices.Contains(strings.Split(allowedEmails, ","), strings.ToLower(email))
|
||||
}
|
||||
|
||||
// PassportWebLogoutGet 处理用户登出请求
|
||||
// PassportWebLogoutGet handle user logout requests
|
||||
func (u *UserApplicationService) PassportWebLogoutGet(ctx context.Context, req *passport.PassportWebLogoutGetRequest) (
|
||||
resp *passport.PassportWebLogoutGetResponse, err error,
|
||||
) {
|
||||
@@ -116,7 +116,7 @@ func (u *UserApplicationService) PassportWebLogoutGet(ctx context.Context, req *
|
||||
}, nil
|
||||
}
|
||||
|
||||
// PassportWebEmailLoginPost 处理用户邮箱登录请求
|
||||
// PassportWebEmailLoginPost handle user email login requests
|
||||
func (u *UserApplicationService) PassportWebEmailLoginPost(ctx context.Context, req *passport.PassportWebEmailLoginPostRequest) (
|
||||
resp *passport.PassportWebEmailLoginPostResponse, sessionKey string, err error,
|
||||
) {
|
||||
@@ -160,11 +160,11 @@ func (u *UserApplicationService) PassportAccountInfoV2(ctx context.Context, req
|
||||
}, nil
|
||||
}
|
||||
|
||||
// UserUpdateAvatar 更新用户头像
|
||||
// UserUpdateAvatar Update user avatar
|
||||
func (u *UserApplicationService) UserUpdateAvatar(ctx context.Context, mimeType string, req *passport.UserUpdateAvatarRequest) (
|
||||
resp *passport.UserUpdateAvatarResponse, err error,
|
||||
) {
|
||||
// 根据 MIME type 获取文件后缀
|
||||
// Get file suffix by MIME type
|
||||
var ext string
|
||||
switch mimeType {
|
||||
case "image/jpeg", "image/jpg":
|
||||
@@ -195,7 +195,7 @@ func (u *UserApplicationService) UserUpdateAvatar(ctx context.Context, mimeType
|
||||
}, nil
|
||||
}
|
||||
|
||||
// UserUpdateProfile 更新用户资料
|
||||
// UserUpdateProfile Update user profile
|
||||
func (u *UserApplicationService) UserUpdateProfile(ctx context.Context, req *passport.UserUpdateProfileRequest) (
|
||||
resp *passport.UserUpdateProfileResponse, err error,
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user