Documentation ¶
Index ¶
- func CalculateBit(actions []string, withPermissions bool, code string, ...) map[string]uint32
- func EncryptMd5(input string) string
- func EncryptMd5By16Bit(data string) string
- func GetUserPermissions(appkey string, userId uint) map[string]uint32
- func JWTAuth() func(c *see.Context)
- func ProtoFailure() *proto.Reply
- func ProtoSucceed() *proto.Reply
- func Wrapper(handle WrapperFuncType) see.HandlerFunc
- type ChangPassParam
- type ChangingStatusParam
- type FirstUserParam
- type LoginParam
- type LoginResp
- type PaginateParam
- type RegisterAppParam
- type RegisterParam
- type Response
- type Svr
- func (this *Svr) AdminGetUserList(c *see.Context) Response
- func (this *Svr) AuthorityVerify(ctx context.Context, in *proto.AuthorityVerifyRequest) (*proto.Reply, error)
- func (this *Svr) Bind()
- func (this *Svr) BindUserRole(ctx context.Context, in *proto.BindUserRoleRequest) (*proto.Reply, error)
- func (this *Svr) ChangingPasswordBySelf(c *see.Context) Response
- func (this *Svr) ChangingStatusByAdmin(c *see.Context) Response
- func (this *Svr) ChangingUserStatus(ctx context.Context, in *proto.ChangingUserStatusRequest) (*proto.Reply, error)
- func (this *Svr) CreateFirstUser(c *see.Context) Response
- func (this *Svr) CreateRole(ctx context.Context, in *proto.RoleInfo) (*proto.Reply, error)
- func (this *Svr) CreateUser(ctx context.Context, in *proto.CreateUserRequest) (*proto.CreateUserReply, error)
- func (this *Svr) DeleteRole(ctx context.Context, in *proto.DeleteRoleRequest) (*proto.Reply, error)
- func (this *Svr) DisableMenu(ctx context.Context, in *proto.DisableMenuRequest) (*proto.Reply, error)
- func (this *Svr) GetAppMenus(ctx context.Context, in *proto.NullRequest) (*proto.MenusRequest, error)
- func (this *Svr) GetRoleList(ctx context.Context, in *proto.PaginateRequest) (*proto.GetRoleListReply, error)
- func (this *Svr) GetUserList(ctx context.Context, in *proto.PaginateRequest) (*proto.GetUserListReply, error)
- func (this *Svr) Initialized(c *see.Context) Response
- func (this *Svr) LoginByAccount(c *see.Context) Response
- func (this *Svr) PermissionsTpl(ctx context.Context, in *proto.PermissionsTplRequest) (*proto.Reply, error)
- func (this *Svr) RegisterApp(c *see.Context) Response
- func (this *Svr) RegisterUser(c *see.Context) Response
- func (this *Svr) Run()
- func (this *Svr) TokenRefresh(ctx context.Context, in *proto.Token) (*proto.Token, error)
- func (this *Svr) TokenVerify(ctx context.Context, in *proto.Token) (*proto.TokenVerifyReply, error)
- func (this *Svr) UpdateRole(ctx context.Context, in *proto.UpdateRoleRequest) (*proto.Reply, error)
- func (this *Svr) UpdateUserInfo(ctx context.Context, in *proto.UpdateUserInfoRequest) (*proto.Reply, error)
- func (this *Svr) ValidateCodeByBase64(c *see.Context) Response
- func (this *Svr) ValidateCodeVerify(id, val string, by ...string) bool
- type WrapperFuncType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateBit ¶
func EncryptMd5 ¶
func EncryptMd5By16Bit ¶
func ProtoFailure ¶
func ProtoSucceed ¶
func Wrapper ¶
func Wrapper(handle WrapperFuncType) see.HandlerFunc
Types ¶
type ChangPassParam ¶
type ChangingStatusParam ¶
type FirstUserParam ¶
type FirstUserParam struct { Password string `json:"password" validate:"required"` // 密码 Account string `json:"account" validate:"required"` // 账号 NickName string `json:"nickName" validate:"-"` // 昵称 ValidateCodeId string `json:"validateCodeId" validate:"required"` // 验证码Id ValidateCode string `json:"validateCode" validate:"required"` // 验证码 }
type LoginParam ¶
type PaginateParam ¶
type RegisterAppParam ¶
type RegisterParam ¶
type RegisterParam struct { ValidateCodeId string `json:"validateCodeId" validate:"required"` // 验证码Id ValidateCode string `json:"validateCode" validate:"required"` // 验证码 Password string `json:"password" validate:"required"` // 密码 Account string `json:"account" validate:"required"` // 账号 NickName string `json:"nickName" validate:"required"` // 昵称 Mobile string `json:"mobile" validate:"required"` // 手机号 Email string `json:"email" validate:"required"` // 邮箱 Info struct { RealName string `json:"realName" validate:"-"` // 详情 Age uint `json:"age" validate:"-"` // 年龄 Sex uint `json:"sex" validate:"-"` // 性别 Nation string `json:"nation" validate:"-"` // 民族 Address string `json:"address" validate:"-"` // 地址 IdCard string `json:"idCard" validate:"-"` // 身份证 } `json:"info" validate:"-"` // 详情 }
type Response ¶
type Response struct { Code int `json:"code"` Message interface{} `json:"message"` Data interface{} `json:"data"` }
type Svr ¶
var App *Svr
func (*Svr) AdminGetUserList ¶
@Summary 获取账号列表 @Description 管理员获取账号列表 @Tags Management @Accept json @Produce json @Param Body body PaginateParam true "分页参数" @Success 200 {object} Response "响应信息" @Router /admin/account/list [post]
func (*Svr) AuthorityVerify ¶
func (*Svr) BindUserRole ¶
func (*Svr) ChangingPasswordBySelf ¶
@Summary 修改密码 @Description 通过旧密码设置新密码 @Tags Management @Accept json @Produce json @Param Body body ChangPassParam true "修改密码参数" @Success 200 {object} Response "响应信息" @Router /admin/changingPassword [post]
func (*Svr) ChangingStatusByAdmin ¶
@Summary 启/停用账号 @Description 切换账号状态 @Tags Management @Accept json @Produce json @Param Body body ChangingStatusParam true "修改用户状态参数" @Success 200 {object} Response "响应信息" @Router /admin/changingUserStatus [post]
func (*Svr) ChangingUserStatus ¶
func (*Svr) CreateFirstUser ¶
@Summary 初始化管理员 @Description 创建第一个管理员用户 @Tags Initialized @Accept json @Produce json @Param Body body FirstUserParam true "初始化参数" @Success 200 {object} Response "响应信息" @Router /admin/createFirstUser [post]
func (*Svr) CreateRole ¶
func (*Svr) CreateUser ¶
func (this *Svr) CreateUser(ctx context.Context, in *proto.CreateUserRequest) (*proto.CreateUserReply, error)
func (*Svr) DeleteRole ¶
func (*Svr) DisableMenu ¶
func (*Svr) GetAppMenus ¶
func (this *Svr) GetAppMenus(ctx context.Context, in *proto.NullRequest) (*proto.MenusRequest, error)
func (*Svr) GetRoleList ¶
func (this *Svr) GetRoleList(ctx context.Context, in *proto.PaginateRequest) (*proto.GetRoleListReply, error)
func (*Svr) GetUserList ¶
func (this *Svr) GetUserList(ctx context.Context, in *proto.PaginateRequest) (*proto.GetUserListReply, error)
func (*Svr) Initialized ¶
@Summary 系统初始化 @Description 判断是否已初始化系统 @Tags Initialized @Accept json @Produce json @Success 200 {object} Response @Router /admin/initialized [get]
func (*Svr) LoginByAccount ¶
@Summary 登录 @Description 通过账号密码登录 @Tags Public @Accept json @Produce json @Param Body body LoginParam true "登录参数" @Success 200 {object} Response{data=LoginResp} "token" @Router /loginByAccount [post]
func (*Svr) PermissionsTpl ¶
func (*Svr) RegisterApp ¶
@Summary 注册应用 @Description 注册新应用 @Tags Management @Accept json @Produce json @Param Body body RegisterAppParam true "注册参数" @Success 200 {object} Response @Router /admin/app/register [post]
func (*Svr) RegisterUser ¶
@Summary 注册用户 @Description 注册新用户 @Tags Public @Accept json @Produce json @Param Body body RegisterParam true "注册参数" @Success 200 {object} Response @Router /user/register [post]
func (*Svr) TokenRefresh ¶
func (*Svr) TokenVerify ¶
func (*Svr) UpdateRole ¶
func (*Svr) UpdateUserInfo ¶
func (*Svr) ValidateCodeByBase64 ¶
@Summary 验证码 @Description 获取图形验证码 @Tags Public @Accept json @Produce json @Success 200 {object} Response @Router /validateCodeByBase64 [get]