service

package
v0.0.0-...-89c19b0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IUserService

type IUserService interface {
	//CheckUser 身份验证
	CheckUser(username string, password string) bool
	//GetUserID 获取用户ID
	GetUserID(username string) uint
	//GetUserType 获取用户角色
	GetUserType(username string) uint
	//GetUsers 获取用户信息
	GetUsers(page, pagesize uint, maps interface{}) interface{}
	//AddUser 新建用户
	AddUser(user *models.User) bool
	//ExistUserByName 判断用户名是否已存在
	ExistUserByName(username string) bool
	//UpdateUser 更新用户
	UpdateUser(user *models.User, userOpType string) bool
	//DeleteUser 删除用户
	DeleteUser(id uint) bool
}

IUserService UserService接口定义

type UserService

type UserService struct {
	Repository repository.IUserRepository `inject:""`
	Log        logger.ILogger             `inject:""`
}

UserService 注入IUserRepository

func (*UserService) AddUser

func (a *UserService) AddUser(user *models.User) bool

AddUser 新建用户

func (*UserService) CheckUser

func (a *UserService) CheckUser(username string, password string) bool

CheckUser 身份验证

func (*UserService) DeleteUser

func (a *UserService) DeleteUser(id uint) bool

DeleteUser 删除用户

func (*UserService) ExistUserByName

func (a *UserService) ExistUserByName(username string) bool

ExistUserByName 判断用户名是否已存在

func (*UserService) GetUserID

func (a *UserService) GetUserID(username string) uint

GetUserID 获取用户ID

func (*UserService) GetUserType

func (a *UserService) GetUserType(username string) uint

GetUserType 获取用户Type(管理员,研发)

func (*UserService) GetUsers

func (a *UserService) GetUsers(page, pagesize uint, maps interface{}) interface{}

GetUsers 获取用户信息

func (*UserService) RegisterUser

func (a *UserService) RegisterUser(user *models.User) bool

RegisterUser 新建用户,并不同时新建用户角色

func (*UserService) UpdateUser

func (a *UserService) UpdateUser(modUser *models.User, userOpType string) bool

UpdateUser 更新用户

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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