Documentation ¶
Index ¶
- type Factory
- type UserService
- func (service *UserService) GetUserInfoByUID(uid uint64) (*models.UserInfo, error)
- func (service *UserService) GetUserInfoByUsername(username string) (*models.UserInfo, error)
- func (service *UserService) LoginUser(username string, password string, ip string, app string, device string) (string, error)
- func (service *UserService) RegisterUser(username string, password string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
func NewFactory ¶
func (*Factory) NewUserService ¶
func (factory *Factory) NewUserService() *UserService
NewUserService 返回一个新的 UserService 实例。
返回值:
- *UserService:新的 UserService 实例。
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
UserService 用户服务
func (*UserService) GetUserInfoByUID ¶
func (service *UserService) GetUserInfoByUID(uid uint64) (*models.UserInfo, error)
GetUserInfoByUsername 根据用户名获取用户信息。 w 参数:
- username:用户名
返回值:
- *models.UserInfo:用户信息模型。
func (*UserService) GetUserInfoByUsername ¶
func (service *UserService) GetUserInfoByUsername(username string) (*models.UserInfo, error)
GetUserInfoByUsername 根据用户名获取用户信息。
参数:
- username:用户名
返回值:
- *models.UserInfo:用户信息模型。
func (*UserService) LoginUser ¶
func (service *UserService) LoginUser(username string, password string, ip string, app string, device string) (string, error)
LoginUser 用户登录。
参数:
- username:用户名
- password:密码
- ip:登录IP
返回值:
- string:Bearer Token
- error:如果在登录过程中发生错误,则返回相应的错误信息,否则返回nil。
func (*UserService) RegisterUser ¶
func (service *UserService) RegisterUser(username string, password string) error
RegisterUser 注册用户。
参数:
- username:用户名
- password:密码
返回值:
- error:如果在注册过程中发生错误,则返回相应的错误信息,否则返回nil。
Click to show internal directories.
Click to hide internal directories.