feat: 实现用户注册功能,包括数据库表结构、gRPC 服务和业务逻辑
This commit is contained in:
42
backend/services/user-svc/internal/domain/user.go
Normal file
42
backend/services/user-svc/internal/domain/user.go
Normal 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"`
|
||||
}
|
||||
Reference in New Issue
Block a user