Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidUserOrPassword = errors.New("邮箱或者密码不正确")
View Source
var ErrUserDuplicateEmail = repository.ErrUserDuplicate
Functions ¶
This section is empty.
Types ¶
type UserService ¶
type UserService interface { Signup(ctx context.Context, u domain.User) error FindOrCreate(ctx context.Context, phone string) (domain.User, error) Login(ctx context.Context, email, password string) (domain.User, error) Profile(ctx context.Context, id int64) (domain.User, error) // UpdateNonSensitiveInfo 更新非敏感数据 // 你可以在这里进一步补充究竟哪些数据会被更新 UpdateNonSensitiveInfo(ctx context.Context, user domain.User) error // FindOrCreateByWechat 查找或者初始化 // 随着业务增长,这边可以考虑拆分出去作为一个新的 Service FindOrCreateByWechat(ctx context.Context, info domain.WechatInfo) (domain.User, error) }
UserService 用户相关服务
func NewUserService ¶
func NewUserService(repo repository.UserRepository) UserService
Click to show internal directories.
Click to hide internal directories.