Documentation
¶
Index ¶
- Variables
- func UploadLoginSessionTimeout(in int64)
- type GetSecurityCodeRequest
- type GetSecurityCodeResponse
- type ILoginCache
- type IManageId
- type IManageInitialize
- type IManageLogService
- type IManageLogStorage
- type IManageLoginService
- type IManageLoginStorage
- type IManagePermissionService
- type IManagePermissionStorage
- type IManageRoleService
- type IManageRoleStorage
- type IManageRoleUserStorage
- type IManageService
- type IManageUserService
- type IManageUserStorage
- type LoginInfo
- type LoginRequest
- type LoginResponse
- type ManageAddRoleUserResponse
- type ManageAddRoleUsersResponse
- type ManageLog
- type ManageLogDeleteRequest
- type ManageLogPageRequest
- type ManageLogPageResponse
- type ManageLogin
- type ManageLoginDeleteRequest
- type ManageLoginPageRequest
- type ManageLoginPageResponse
- type ManagePermission
- type ManagePermissionAddRequest
- type ManagePermissionAddResponse
- type ManagePermissionDeleteRequest
- type ManagePermissionQueryRequest
- type ManageRole
- type ManageRoleAddRequest
- type ManageRoleAddResponse
- type ManageRoleDeleteRequest
- type ManageRoleListRequest
- type ManageRoleListResponse
- type ManageRoleUser
- type ManageUser
- type ManageUserAddRequest
- type ManageUserAddResponse
- type ManageUserDeleteRequest
- type ManageUserListRequest
- type ManageUserListResponse
- type ManageUserPageRequest
- type ManageUserPageResponse
- type ManageUserRoleRequest
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 IdTypeModuleManageManagePermission = module_id.IdType("module_manage:manage_permission")
View Source
var IdTypeModuleManageManageRole = module_id.IdType("module_manage:manage_role")
View Source
var IdTypeModuleManageManageUser = module_id.IdType("module_manage:manage_user")
View Source
var LoginSourceTypeApi = 2
View Source
var LoginSourceTypeManage = 1
Functions ¶
func UploadLoginSessionTimeout ¶ added in v1.0.2
func UploadLoginSessionTimeout(in int64)
Types ¶
type GetSecurityCodeRequest ¶
type GetSecurityCodeResponse ¶
type ILoginCache ¶
type IManageInitialize ¶
type IManageLogService ¶ added in v1.0.2
type IManageLogService interface {
Add(in *ManageLog) (err error)
Page(in *ManageLogPageRequest) (res *ManageLogPageResponse, err error)
Delete(in *ManageLogDeleteRequest) (err error)
}
type IManageLogStorage ¶ added in v1.0.2
type IManageLogStorage interface {
Insert(in *ManageLog) (res int64, err error)
DeleteByIds(ids []int64) (res int64, err error)
Query(in *ManageLog) (res []*ManageLog, err error)
Page(in *ManageLog, pageNo int64, pageSize int64) (res []*ManageLog, err error)
Count(in *ManageLog) (res 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 IManagePermissionService ¶ added in v1.0.2
type IManagePermissionService interface {
Add(in *ManagePermissionAddRequest) (res *ManagePermissionAddResponse, err error)
Query(in *ManagePermissionQueryRequest) (res []*ManagePermission, err error)
QueryByIds(ids []int64) (res []*ManagePermission, err error)
QueryByRoleIds(roleIds []int64) (res []*ManagePermission, err error)
QueryByUserIds(userIds []int64) (res []*ManagePermission, err error)
Delete(in *ManagePermissionDeleteRequest) (err error)
}
type IManagePermissionStorage ¶ added in v1.0.2
type IManagePermissionStorage interface {
Insert(in *ManagePermission) (res int64, err error)
QueryByIds(ids []int64) (res []*ManagePermission, err error)
QueryByRoleId(roleId int64) (res []*ManagePermission, err error)
QueryByRoleIds(roleIds []int64) (res []*ManagePermission, err error)
QueryByUserId(userId int64) (res []*ManagePermission, err error)
QueryByUserIds(userIds []int64) (res []*ManagePermission, err error)
Query(in *ManagePermission) (res []*ManagePermission, err error)
DeleteByIds(ids []int64) (res int64, err error)
DeleteByRoleIds(roleIds []int64) (res int64, err error)
DeleteByUserIds(userIds []int64) (res int64, err error)
}
type IManageRoleService ¶
type IManageRoleService interface {
Add(in *ManageRoleAddRequest) (res *ManageRoleAddResponse, err error)
List(in *ManageRoleListRequest) (res *ManageRoleListResponse, 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)
List(in *ManageUserListRequest) (res *ManageUserListResponse, err error)
Page(in *ManageUserPageRequest) (res *ManageUserPageResponse, err error)
Delete(userIds []int64) (err error)
Remove(userIds []int64) (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 {
LoginId int64 `json:"loginId"`
Token string `json:"token"`
UseAt int64 `json:"useAt"`
LoginAt int64 `json:"loginAt"`
User *ManageUser `json:"user"`
Roles []*ManageRole `json:"roles"`
Permissions []*ManagePermission `json:"permissions"`
}
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"`
LoginIp string `json:"loginIp"`
}
type LoginResponse ¶
type LoginResponse struct {
*LoginInfo
}
type ManageLog ¶ added in v1.0.2
type ManageLog struct {
LogId int64 `json:"logId" column:"log_id"`
LoginId int64 `json:"loginId" column:"login_id"`
UserId int64 `json:"userId" column:"user_id"`
UserName string `json:"userName" column:"user_name"`
UserAccount string `json:"userAccount" column:"user_account"`
Ip string `json:"ip" column:"ip"`
Path string `json:"path" column:"path"`
Comment string `json:"comment" column:"comment"`
Method string `json:"method" column:"method"`
Param string `json:"param" column:"param"`
Data string `json:"data" column:"data"`
UserAgent string `json:"userAgent" column:"user_agent"`
Error string `json:"error" column:"error"`
UseTime int `json:"useTime" column:"use_time"`
StartAt int64 `json:"startAt" column:"start_at"`
EndAt int64 `json:"endAt" column:"end_at"`
CreateAt int64 `json:"createAt" column:"create_at"`
StartTimeBefore int64 `json:"startTimeBefore"`
StartTimeAfter int64 `json:"startTimeAfter"`
}
func (*ManageLog) GetPrimaryKey ¶ added in v1.0.2
func (*ManageLog) GetTableName ¶ added in v1.0.2
type ManageLogDeleteRequest ¶ added in v1.0.2
type ManageLogDeleteRequest struct {
LogIds []int64 `json:"logIds"`
}
type ManageLogPageRequest ¶ added in v1.0.2
type ManageLogPageResponse ¶ added in v1.0.2
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"`
LoginAtBefore int64 `json:"loginAtBefore"`
LoginAtAfter int64 `json:"loginAtAfter"`
}
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 ManagePermission ¶ added in v1.0.2
type ManagePermission struct {
PermissionId int64 `json:"permissionId" column:"permission_id"`
RoleId int64 `json:"roleId" column:"role_id"`
UserId int64 `json:"userId" column:"user_id"`
PermissionType string `json:"permissionType" column:"permission_type"`
Permission string `json:"permission" column:"permission"`
Authorizable int `json:"authorizable" column:"authorizable"`
StartAt int64 `json:"startAt" column:"start_at"`
ExpiredAt int64 `json:"expiredAt" column:"expired_at"`
ExpiredDuration int64 `json:"expiredDuration" column:"expired_duration"`
CreateAt int64 `json:"createAt" column:"create_at"`
UpdateAt int64 `json:"updateAt" column:"update_at"`
}
func (*ManagePermission) GetPrimaryKey ¶ added in v1.0.2
func (this_ *ManagePermission) GetPrimaryKey() []string
func (*ManagePermission) GetTableName ¶ added in v1.0.2
func (this_ *ManagePermission) GetTableName() string
type ManagePermissionAddRequest ¶ added in v1.0.2
type ManagePermissionAddRequest struct {
*ManagePermission
}
type ManagePermissionAddResponse ¶ added in v1.0.2
type ManagePermissionAddResponse struct {
}
type ManagePermissionDeleteRequest ¶ added in v1.0.2
type ManagePermissionQueryRequest ¶ added in v1.0.2
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 ManageRoleListRequest ¶ added in v1.0.2
type ManageRoleListRequest struct {
*ManageRole
}
type ManageRoleListResponse ¶ added in v1.0.2
type ManageRoleListResponse struct {
List []*ManageRole `json:"list"`
}
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 ManageUserListRequest ¶ added in v1.0.2
type ManageUserListRequest struct {
*ManageUser
}
type ManageUserListResponse ¶ added in v1.0.2
type ManageUserListResponse struct {
List []*ManageUser `json:"list"`
}
type ManageUserPageRequest ¶ added in v1.0.2
type ManageUserPageRequest struct {
*ManageUser
PageNo int64 `json:"pageNo"`
PageSize int64 `json:"pageSize"`
}
type ManageUserPageResponse ¶ added in v1.0.2
type ManageUserPageResponse struct {
Total int64 `json:"total"`
List []*ManageUser `json:"list"`
}
type ManageUserRoleRequest ¶
type ManageUserRoleRequest struct {
UserId int64 `json:"userId"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.