基础架构
This commit is contained in:
@@ -29,7 +29,7 @@ type Repository[T any] interface {
|
||||
BaseRepository
|
||||
|
||||
// 基础CRUD操作
|
||||
Create(ctx context.Context, entity T) error
|
||||
Create(ctx context.Context, entity T) (T, error)
|
||||
GetByID(ctx context.Context, id string) (T, error)
|
||||
Update(ctx context.Context, entity T) error
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"tyapi-server/internal/domains/user/dto"
|
||||
"tyapi-server/internal/application/user/dto/commands"
|
||||
"tyapi-server/internal/domains/user/entities"
|
||||
)
|
||||
|
||||
@@ -30,13 +30,13 @@ type UserService interface {
|
||||
Service
|
||||
|
||||
// 用户注册
|
||||
Register(ctx context.Context, req *dto.RegisterRequest) (*entities.User, error)
|
||||
Register(ctx context.Context, req *commands.RegisterUserCommand) (*entities.User, error)
|
||||
// 密码登录
|
||||
LoginWithPassword(ctx context.Context, req *dto.LoginWithPasswordRequest) (*entities.User, error)
|
||||
LoginWithPassword(ctx context.Context, req *commands.LoginWithPasswordCommand) (*entities.User, error)
|
||||
// 短信验证码登录
|
||||
LoginWithSMS(ctx context.Context, req *dto.LoginWithSMSRequest) (*entities.User, error)
|
||||
LoginWithSMS(ctx context.Context, req *commands.LoginWithSMSCommand) (*entities.User, error)
|
||||
// 修改密码
|
||||
ChangePassword(ctx context.Context, userID string, req *dto.ChangePasswordRequest) error
|
||||
ChangePassword(ctx context.Context, userID string, req *commands.ChangePasswordCommand) error
|
||||
// 根据ID获取用户
|
||||
GetByID(ctx context.Context, id string) (*entities.User, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user