module_manage

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ERROR_ACCOUNT_OR_PASSWORD = framework.NewError("10005", "登录账号或密码错误")
View Source
var ERROR_LOGIN_EXPIRE = framework.NewError("10002", "登录凭证已过期")
View Source
var ERROR_LOGIN_INVALID = framework.NewError("10001", "登录凭证已失效")
View Source
var ERROR_MANAGE_USER_INVALID = framework.NewError("10004", "管理员账号已失效")
View Source
var ERROR_OLD_PASSWORD = framework.NewError("10006", "旧密码错误")
View Source
var ERROR_SHOULD_LOGIN = framework.NewError("10000", "请先登录")
View Source
var IdTypeModuleManageManageLog = module_id.IdType("module_manage:manage_log")
View Source
var IdTypeModuleManageManageLogin = module_id.IdType("module_manage:manage_login")
View Source
var IdTypeModuleManageManageRole = module_id.IdType("module_manage:manage_role")
View Source
var IdTypeModuleManageManageUser = module_id.IdType("module_manage:manage_user")

Functions

This section is empty.

Types

type GetSecurityCodeRequest

type GetSecurityCodeRequest struct {
	DeviceId string `json:"deviceId"`
	Width    int    `json:"width"`
	Height   int    `json:"height"`
}

type GetSecurityCodeResponse

type GetSecurityCodeResponse struct {
	SecurityCodeBase64 string `json:"securityCodeBase64"`
	ExpirationTime     int    `json:"expirationTime"`
	SecurityCodeKey    string `json:"securityCodeKey"`
}

type ILoginCache

type ILoginCache interface {
	Add(data *LoginInfo)
	Get(token string) (res *LoginInfo)
	GetIfPresent(token string) (res *LoginInfo)
}

type IManageId

type IManageId interface {
	GenUserId() (res int64)
	GenRoleId() (res int64)
	GenLoginId() (res int64)
	GenLogId() (res int64)
}

type IManageInitialize

type IManageInitialize interface {
	InitManageUser(name string, account string) (userId int64, err error)
	InitSuperRole(name string) (roleId int64, err error)
}

type IManageLoginService

type IManageLoginService interface {
	Add(in *ManageLogin) (err error)
	Page(in *ManageLoginPageRequest) (res *ManageLoginPageResponse, err error)
	Delete(in *ManageLoginDeleteRequest) (err error)
}

type IManageLoginStorage

type IManageLoginStorage interface {
	GetById(id int64) (res *ManageLogin, err error)
	GetByToken(token string) (res *ManageLogin, err error)
	Insert(in *ManageLogin) (res int64, err error)
	Update(in *ManageLogin) (res int64, err error)
	Logout(id int64) (res int64, err error)
	Use(id int64) (res int64, err error)
	DeleteByIds(ids []int64) (res int64, err error)
	Query(in *ManageLogin) (res []*ManageLogin, err error)
	Page(in *ManageLogin, pageNo int64, pageSize int64) (res []*ManageLogin, err error)
	Count(in *ManageLogin) (res int64, err error)
	RemoveByIds(ids []int64) (res int64, err error)
}

type IManageRolePermissionStorage

type IManageRolePermissionStorage interface {
	Insert(in *ManageRolePermission) (res int64, err error)
	DeleteByIds(ids []int64) (res int64, err error)
	QueryByRoleId(roleId int64) (res []*ManageRolePermission, err error)
	Query(in *ManageRolePermission) (res []*ManageRolePermission, err error)
}

type IManageRoleService

type IManageRoleService interface {
	Add(in *ManageRoleAddRequest) (res *ManageRoleAddResponse, err error)
	Delete(roleIds []int64) (err error)
	GetUserRoles(userId int64) (res []*ManageRole, err error)
	AddRoleUsers(roleId int64, userIds []int64) (err error)
	AddRoleUser(roleId int64, userId int64) (err error)
}

type IManageRoleStorage

type IManageRoleStorage interface {
	GetById(id int64) (res *ManageRole, err error)
	GetByIds(ids []int64) (res []*ManageRole, err error)
	Insert(in *ManageRole) (res int64, err error)
	Update(in *ManageRole) (res int64, err error)
	DeleteByIds(ids []int64) (res int64, err error)
	Query(in *ManageRole) (res []*ManageRole, err error)
	Page(in *ManageRole, pageNo int64, pageSize int64) (res []*ManageRole, err error)
	Count(in *ManageRole) (res int64, err error)
}

type IManageRoleUserStorage

type IManageRoleUserStorage interface {
	Insert(in *ManageRoleUser) (res int64, err error)
	DeleteByIds(ids []int64) (res int64, err error)
	QueryByRoleId(roleId int64) (res []*ManageRoleUser, err error)
	QueryRoleUserIds(roleId int64) (res []int64, err error)
	QueryByUserId(userId int64) (res []*ManageRoleUser, err error)
	QueryUserRoleIds(userId int64) (res []int64, err error)
	Query(in *ManageRoleUser) (res []*ManageRoleUser, err error)
	QueryByRoleIdAndUserId(roleId int64, userId int64) (res []*ManageRoleUser, err error)
}

type IManageService

type IManageService interface {
	GetSecurityCode(in *GetSecurityCodeRequest) (out *GetSecurityCodeResponse, err error)
	EncodePassword(salt string, password string) (res string)
	Login(in *LoginRequest) (res *LoginResponse, err error)
	Session(token string) (res *LoginResponse, err error)
	Logout(token string) (err error)
	LoadLogin(token string) (res *LoginResponse, err error)
}

type IManageUserService

type IManageUserService interface {
	Add(in *ManageUserAddRequest) (res *ManageUserAddResponse, err error)
	Delete(in *ManageUserDeleteRequest) (err error)
	A(token string) (err error)
	Xxx(in *ManageUserDeleteRequest) (err error)
}

type IManageUserStorage

type IManageUserStorage interface {
	GetById(id int64) (res *ManageUser, err error)
	GetByIds(ids []int64) (res []*ManageUser, err error)
	Insert(in *ManageUser) (res int64, err error)
	Update(in *ManageUser) (res int64, err error)
	Disable(id int64) (res int64, err error)
	Enable(id int64) (res int64, err error)
	UpdatePassword(id int64, salt string, password string) (res int64, err error)
	QueryByAccount(account string) (res []*ManageUser, err error)
	CountByAccount(account string) (res int64, err error)
	DeleteByIds(ids []int64) (res int64, err error)
	Query(in *ManageUser) (res []*ManageUser, err error)
	Page(in *ManageUser, pageNo int64, pageSize int64) (res []*ManageUser, err error)
	Count(in *ManageUser) (res int64, err error)
	RemoveByIds(ids []int64) (res int64, err error)
}

type LoginInfo

type LoginInfo struct {
	User  *ManageUser   `json:"user"`
	Roles []*ManageRole `json:"roles"`
	Login *ManageLogin  `json:"login"`
}

type LoginRequest

type LoginRequest struct {
	Account         string `json:"account"`
	Password        string `json:"password"`
	DeviceId        string `json:"deviceId"`
	SecurityCodeKey string `json:"securityCodeKey"`
	SecurityCode    string `json:"securityCode"`
	SourceType      int    `json:"sourceType"`
	SourceInfo      string `json:"sourceInfo"`
}

type LoginResponse

type LoginResponse struct {
	*LoginInfo
}

type ManageAddRoleUserResponse

type ManageAddRoleUserResponse struct {
	RoleId int64 `json:"roleId"`
	UserId int64 `json:"userId"`
}

type ManageAddRoleUsersResponse

type ManageAddRoleUsersResponse struct {
	RoleId  int64   `json:"roleId"`
	UserIds []int64 `json:"userIds"`
}

type ManageLogin

type ManageLogin struct {
	LoginId     int64  `json:"loginId" column:"login_id"`
	UserId      int64  `json:"userId" column:"user_id"`
	UserAccount string `json:"userAccount" column:"user_account"`
	UserName    string `json:"userName" column:"user_name"`
	LoginIp     string `json:"loginIp" column:"login_ip"`
	SourceType  int    `json:"sourceType" column:"source_type"`
	SourceInfo  string `json:"sourceInfo" column:"source_info"`
	Token       string `json:"token" column:"token"`
	Status      int    `json:"status" column:"status"`
	LoginAt     int64  `json:"loginAt" column:"login_at"`
	LogoutAt    int64  `json:"logoutAt" column:"logout_at"`
	CreateAt    int64  `json:"createAt" column:"create_at"`
	UpdateAt    int64  `json:"updateAt" column:"update_at"`
	DeleteAt    int64  `json:"deleteAt" column:"delete_at"`
	UseAt       int64  `json:"useAt" column:"use_at"`
}

func (*ManageLogin) GetPrimaryKey

func (this_ *ManageLogin) GetPrimaryKey() []string

func (*ManageLogin) GetTableName

func (this_ *ManageLogin) GetTableName() string

type ManageLoginDeleteRequest

type ManageLoginDeleteRequest struct {
	LoginIds []int64 `json:"loginIds"`
}

type ManageLoginPageRequest

type ManageLoginPageRequest struct {
	*ManageLogin
	PageNo   int64 `json:"pageNo"`
	PageSize int64 `json:"pageSize"`
}

type ManageLoginPageResponse

type ManageLoginPageResponse struct {
	Total int64          `json:"total"`
	List  []*ManageLogin `json:"list"`
}

type ManageRole

type ManageRole struct {
	RoleId   int64  `json:"roleId" column:"role_id"`
	Name     string `json:"name" column:"name"`
	IsSuper  int8   `json:"isSuper" column:"is_super"`
	CreateAt int64  `json:"createAt" column:"create_at"`
	UpdateAt int64  `json:"updateAt" column:"update_at"`
}

func (*ManageRole) GetPrimaryKey

func (this_ *ManageRole) GetPrimaryKey() []string

func (*ManageRole) GetTableName

func (this_ *ManageRole) GetTableName() string

type ManageRoleAddRequest

type ManageRoleAddRequest struct {
	*ManageRole
}

type ManageRoleAddResponse

type ManageRoleAddResponse struct {
}

type ManageRoleDeleteRequest

type ManageRoleDeleteRequest struct {
	RoleIds []int64 `json:"roleIds"`
}

type ManageRolePermission

type ManageRolePermission struct {
	RolePermissionId int64  `json:"rolePermissionId" column:"role_permission_id"`
	RoleId           int64  `json:"roleId" column:"role_id"`
	Permission       string `json:"permission" column:"permission"`
	CreateAt         int64  `json:"createAt" column:"create_at"`
	UpdateAt         int64  `json:"updateAt" column:"update_at"`
}

func (*ManageRolePermission) GetPrimaryKey

func (this_ *ManageRolePermission) GetPrimaryKey() []string

func (*ManageRolePermission) GetTableName

func (this_ *ManageRolePermission) GetTableName() string

type ManageRoleUser

type ManageRoleUser struct {
	RoleUserId int64 `json:"roleUserId" column:"role_user_id"`
	RoleId     int64 `json:"roleId" column:"role_id"`
	UserId     int64 `json:"userId" column:"user_id"`
	CreateAt   int64 `json:"createAt" column:"create_at"`
	UpdateAt   int64 `json:"updateAt" column:"update_at"`
}

func (*ManageRoleUser) GetPrimaryKey

func (this_ *ManageRoleUser) GetPrimaryKey() []string

func (*ManageRoleUser) GetTableName

func (this_ *ManageRoleUser) GetTableName() string

type ManageUser

type ManageUser struct {
	UserId    int64  `json:"userId" column:"user_id"`
	Name      string `json:"name" column:"name"`
	Account   string `json:"account" column:"account"`
	Salt      string `json:"salt" column:"salt"`
	Password  string `json:"password" column:"password"`
	Status    int    `json:"status" column:"status"`
	CreateAt  int64  `json:"createAt" column:"create_at"`
	UpdateAt  int64  `json:"updateAt" column:"update_at"`
	DeleteAt  int64  `json:"deleteAt" column:"delete_at"`
	DisableAt int64  `json:"disableAt" column:"disable_at"`
}

func (*ManageUser) GetPrimaryKey

func (this_ *ManageUser) GetPrimaryKey() []string

func (*ManageUser) GetTableName

func (this_ *ManageUser) GetTableName() string

type ManageUserAddRequest

type ManageUserAddRequest struct {
	*ManageUser
	Password string `json:"password"`
}

type ManageUserAddResponse

type ManageUserAddResponse struct {
}

type ManageUserDeleteRequest

type ManageUserDeleteRequest struct {
	UserIds []int64 `json:"userIds"`
}

type ManageUserRoleRequest

type ManageUserRoleRequest struct {
	UserId int64 `json:"userId"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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