model

package
v0.0.0-...-99b28bf Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: MIT Imports: 1 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// ContextKey 上下文变量存储键名
	ContextKey = "ContextKey"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicUserInfo

type BasicUserInfo struct {
	Role       uint   `json:"role"`
	Id         int64  `json:"id"`
	CompanyId  int64  `json:"company_id"`
	Email      string `json:"email"`
	Username   string `json:"username"`
	OpenId     string `json:"open_id"`
	SessionKey string `json:"session_key"`
	IsStaff    bool   `json:"is_staff"`
	IsSuper    bool   `json:"is_super"`
}

type ChangePasswordReq

type ChangePasswordReq struct {
	OldPassword  string `json:"old_password" v:"old_password@required#旧密码不能为空"`
	NewPassword1 string `json:"new_password1" v:"new_password1@required|different:OldPassword#新密码不能为空|新密码不能与旧密码相同"`
	NewPassword2 string `` /* 162-byte string literal not displayed */
}

type Context

type Context struct {
	Session *ghttp.Session // 当前Session管理对象
	User    *ContextUser   // 上下文用户信息
}

Context 请求上下文结构

type ContextUser

type ContextUser struct {
	Id       int64  // 用户ID
	Username string // 用户名称
	Email    string // 邮箱
}

ContextUser 请求上下文中的用户信息

type ForgetPasswordReq

type ForgetPasswordReq struct {
	Email           string `json:"email" v:"email@required#邮箱不能为空"`
	Role            string `json:"role" v:"role@required"`
	CaptchaId       string `json:"captcha_id" v:"captcha_id@required#CaptchaId不能为空"`
	CaptchaResponse string `json:"captcha_response" v:"captcha_response@required#验证码不能为空"`
}

type ResetEmailContext

type ResetEmailContext struct {
	Name string
	Url  string
}

type ResetPasswordReq

type ResetPasswordReq struct {
	Code      string `json:"code" v:"code@required#Code不能为空"`
	Password1 string `json:"password1" v:"password1@required#Password1不能为空"`
	Password2 string `json:"password2" v:"password2@required|same:Password1#Password2不能为空|两个密码不相同"`
}

type UserLoginReq

type UserLoginReq struct {
	Email           string `json:"email" v:"email@email|required#邮箱不合法|邮箱不能为空"`
	Password        string `json:"password" v:"password@required#密码不能为空"`
	CaptchaId       string `json:"captcha_id"`
	CaptchaResponse string `json:"captcha_response"`
}

type WelcomeEmailContext

type WelcomeEmailContext struct {
	Name     string
	Email    string
	Password string
	Host     string
}

Jump to

Keyboard shortcuts

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