feat: 实现用户注册功能,包括数据库表结构、gRPC 服务和业务逻辑

This commit is contained in:
fish
2026-03-28 20:11:54 +08:00
parent e4bb25d1ac
commit 4ff974439f
9 changed files with 529 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
package domain
import (
"time"
"github.com/google/uuid"
)
type User struct {
ID uuid.UUID `json:"id"`
Deleted bool `json:"deleted"`
CreateTime time.Time `json:"create_time"`
UpdateTime time.Time `json:"update_time"`
}
type UserLoginAccount struct {
ID uuid.UUID `json:"id"`
UserID uuid.UUID `json:"user_id"`
Account string `json:"account"`
Deleted bool `json:"deleted"`
CreateTime time.Time `json:"create_time"`
UpdateTime time.Time `json:"update_time"`
}
type UserLoginPassword struct {
ID uuid.UUID `json:"id"`
UserID uuid.UUID `json:"user_id"`
Password string `json:"password"`
Deleted bool `json:"deleted"`
CreateTime time.Time `json:"create_time"`
UpdateTime time.Time `json:"update_time"`
}
type RegisterRequest struct {
Account string `json:"account" binding:"required"`
Password string `json:"password" binding:"required,min=6"`
}
type RegisterResponse struct {
UserID uuid.UUID `json:"user_id"`
Account string `json:"account"`
}