services

package
v0.0.0-...-8ab94dc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

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 NewFactory(storeFactory *stores.Factory) *Factory

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。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL