dto

package
v0.0.0-...-8144993 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessKey

type AccessKey struct {
	UID       string `json:"uid,omitempty"`
	AccessKey string `json:"access_key,omitempty"`
	Secret    string `json:"access_secret,omitempty"`
	Comment   string `json:"comment,omitempty"`
	UpdatedAt string `json:"updatedat,omitempty"`
	CreatedAt string `json:"createdat,omitempty"`
}

type AccessKeyResponseDto

type AccessKeyResponseDto struct {
	common.BaseResponse
	Data AccessKey `json:"data,omitempty"`
}

type AccessTokenClaims

type AccessTokenClaims struct {
	jwt.StandardClaims
}

type Action

type Action struct {
	ID           uint   `json:"id"`
	Code         string `json:"code"`
	Description  string `json:"description"`
	ResourceCode string `json:"resource_code"`
	Createdat    string `json:"createdat"`
	Updatedat    string `json:"updatedat"`

	Resource Resource `json:"resource"`
}

资源操作模型

type ActionDto

type ActionDto struct {
	Data Action
	common.BaseResponse
}

type AddAccessKeyDto

type AddAccessKeyDto struct {
	Comment string `json:"comment,omitempty"`
}

type AddAppDto

type AddAppDto struct {
	Name   string   `json:"name"`
	Domain string   `json:"domain"`
	Scope  []string `json:"scope"`
}

type AddUserDto

type AddUserDto struct {
	UserName string `json:"username,omitempty"`
	Email    string `json:"email,omitempty"`
	Phone    string `json:"phone,omitempty"`
	Password string `json:"password,omitempty"`
	RoleCode string `json:"role_code,omitempty"`
	UserProfile
}

type App

type App struct {
	AppId  string    `json:"appid"`
	Name   string    `json:"name"`
	Domain string    `json:"domain"`
	Scope  []string  `json:"scope"`
	Config AppConfig `json:"config"`
}

type AppConfig

type AppConfig struct {
	DefaultAuthorization bool `json:"default_authorization"`
	DisableLogin         bool `json:"disable_login"`
	DisableRegister      bool `json:"disable_register"`
}

type AppUser

type AppUser struct {
	Username string `json:"username"`
	Nickname string `json:"nickname"`
	AppId    string `json:"appid"`
	UID      string `json:"uid"`
	Permit   int    `json:"permit"`
}

type AppUserCreateDto

type AppUserCreateDto struct {
	AppId  string   `json:"appid"`
	UID    []string `json:"uid"`
	Permit int      `json:"permit"`
}

type AppUserDeleteDto

type AppUserDeleteDto struct {
	AppId string   `json:"appid"`
	UID   []string `json:"uid"`
}

type AppUserQuery

type AppUserQuery struct {
	AppId   string `form:"appid" json:"appid"`
	Search  string `form:"search" json:"search"`
	PerPage int    `form:"per_page" json:"per_page"`
	Current int    `form:"current" json:"current"`
}

type AppUserUpdateDto

type AppUserUpdateDto AppUserCreateDto

type Department

type Department struct {
	ID             uint   `json:"id"`
	OrganizationID uint   `json:"organization_id"`
	Name           string `json:"name"`
	Description    string `json:"description"`
	Status         bool   `json:"status"`
	Createdat      string `json:"createdat"`
	Updatedat      string `json:"updatedat"`

	Organization Organization `json:"organization"`
	Users        []User       `json:"users"`
}

部门模型

type DepartmentDto

type DepartmentDto struct {
	Data Department
	common.BaseResponse
}

type DepartmentUser

type DepartmentUser struct {
	ID           uint   `json:"id"`
	DepartmentID uint   `json:"department_id"`
	UserUID      string `json:"user_uid"`
	IsManager    bool   `json:"is_manager"`
	Createdat    string `json:"createdat"`
	Updatedat    string `json:"updatedat"`

	User       User       `json:"user"`
	Department Department `json:"department"`
}

组织用户模型

type GetAppResponseDto

type GetAppResponseDto struct {
	common.BaseResponse
	Data App
}

type GetAppUserResponseDto

type GetAppUserResponseDto struct {
	common.BaseResponse
	Data AppUser
}

type GetUserResponseDto

type GetUserResponseDto struct {
	common.BaseResponse
	Data User
}

type ListAccessKeyDto

type ListAccessKeyDto struct {
	common.BaseResponse
	Data []AccessKey `json:"data,omitempty"`
}

type ListActionDto

type ListActionDto struct {
	Data []Action
	common.BaseListResponse
}

type ListAppDto

type ListAppDto struct {
	Data []App
	common.BaseResponse
}

type ListAppUserDto

type ListAppUserDto struct {
	Data []AppUser
	common.BaseResponse
}

type ListDepartmentDto

type ListDepartmentDto struct {
	Data []Department
	common.BaseListResponse
}

type ListDepartmentUserDto

type ListDepartmentUserDto struct {
	Data []DepartmentUser
	common.BaseListResponse
}

type ListOrganizationDto

type ListOrganizationDto struct {
	Data []Organization
	common.BaseListResponse
}

type ListOrganizationUserDto

type ListOrganizationUserDto struct {
	Data []OrganizationUser
	common.BaseListResponse
}

type ListResourceDto

type ListResourceDto struct {
	Data []Resource
	common.BaseListResponse
}

type ListRoleDto

type ListRoleDto struct {
	Data []Role
	common.BaseListResponse
}

type ListWxUserDto

type ListWxUserDto struct {
	common.BaseResponse
	Data []WxUser `json:"data,omitempty"`
}

type MiniProgram

type MiniProgram struct {
	AppId    string `json:"appid"`    // 必选; 所需跳转到的小程序appid(该小程序appid必须与发模板消息的公众号是绑定关联关系)
	PagePath string `json:"pagepath"` // 必选; 所需跳转到的小程序appid(该小程序appid必须与发模板消息的公众号是绑定关联关系)
}

type OIDCTokenResponse

type OIDCTokenResponse struct {
	AccessToken      string `json:"access_token,omitempty"`
	IDToken          string `json:"id_token,omitempty"`
	RefreshToken     string `json:"refresh_token,omitempty"` //可选
	ExpiresIn        uint64 `json:"expires_in,omitempty"`
	TokenType        string `json:"token_type,omitempty"`
	Error            string `json:"error,omitempty"`
	ErrorDescription string `json:"error_description,omitempty"`
}

type Organization

type Organization struct {
	ID          uint   `json:"id"`
	CreatorUID  string `json:"creator_uid"`
	Name        string `json:"name"`
	Email       string `json:"email"`
	Country     string `json:"country"`
	City        string `json:"city"`
	Category    string `json:"category"`
	Description string `json:"description"`
	Createdat   string `json:"createdat"`
	Updatedat   string `json:"updatedat"`

	Departments []Department `json:"departments"`
	Users       []User       `json:"users"`
}

组织模型

type OrganizationDto

type OrganizationDto struct {
	Data Organization
	common.BaseResponse
}

type OrganizationUser

type OrganizationUser struct {
	ID             uint   `json:"id"`
	OrganizationID uint   `json:"organization_id"`
	UserUID        string `json:"user_uid"`
	IsManager      bool   `json:"is_manager"`
	Createdat      string `json:"createdat"`
	Updatedat      string `json:"updatedat"`

	User         User         `json:"user"`
	Organization Organization `json:"organization"`
}

组织用户模型

type OrganizationUserDto

type OrganizationUserDto struct {
	Data []User
	common.BaseResponse
}

获取指定组织下所有用户信息

type PhoneCodeLoginDto

type PhoneCodeLoginDto struct {
	Phone string `json:"phone"`
	Code  int    `json:"code"`
}

type PhoneCodeRegisterDto

type PhoneCodeRegisterDto struct {
	Phone string `json:"phone"`
	Code  int    `json:"code"`
}

type PhoneCodeRequestDtto

type PhoneCodeRequestDtto struct {
	Phone string `json:"phone"`
}

type PhonePasswordLoginDto

type PhonePasswordLoginDto struct {
	Phone    string `json:"phone"`
	Password string `json:"password"`
}

type ResetAccessSecretDto

type ResetAccessSecretDto struct {
	Data string `json:"data,omitempty"`
	common.BaseResponse
}

type Resource

type Resource struct {
	ID          uint   `json:"id"`
	Code        string `json:"code"`
	Type        string `json:"status"`
	Description string `json:"description"`
	Createdat   string `json:"createdat"`
	Updatedat   string `json:"updatedat"`

	Actions   []Action `json:"actions"`
	ActionArr []string `json:"action_arr"` // [map[data1:[read write] data2:[read]]]
}

资源模型

type ResourceDto

type ResourceDto struct {
	Data Resource
	common.BaseResponse
}

type Role

type Role struct {
	ID          uint   `json:"id"`
	Code        string `json:"code"`
	Description string `json:"description"`
	Status      bool   `json:"status"`
	Createdat   string `json:"createdat"`
	Updatedat   string `json:"updatedat"`

	ActionArr []map[string][]string `json:"action_arr"` // [map[data1:[read write] data2:[read]]]
}

type RoleDto

type RoleDto struct {
	Data Role
	common.BaseResponse
}

type SocialBindDto

type SocialBindDto struct {
	// 若需要指定用户绑定时传入的字段
	UID string `json:"uid,omitempty"`
	// 微信小程序绑定时需要传入的字段
	PhoneCode string `json:"phone_code,omitempty"`
	LoginCode string `json:"login_code,omitempty"`
}

type SocialBindRespDto

type SocialBindRespDto struct {
	common.BaseResponse
	Data struct {
		// 微信公众号绑定返回的字段
		AuthCodeURL string `json:"auth_code_url,omitempty"` // 通过该URL获取用户授权code
	} `json:"data,omitempty"`
}

type SocialLoginCallbackDto

type SocialLoginCallbackDto struct {
	// 微信小程序登录无需传入字段
	// 微信公众号授权登陆后循环回调需要传入的字段
	Ticket string `json:"ticket,omitempty"` // 通过唯一的ticket确认是否是同一个用户,获取该用户是否授权成功,成功后返回该用户登陆信息

	// 微信开放平台登录时需要传入的字段
	Code  string `json:"code,omitempty"`  // 通过 code 换取网页授权 access_token.
	State string `json:"state,omitempty"` // 即identifier

}

type SocialLoginDto

type SocialLoginDto struct {
	// 微信小程序登录时需要传入的字段
	PhoneCode string `json:"phone_code,omitempty"`
	LoginCode string `json:"login_code,omitempty"`
}

type SocialLoginRespDto

type SocialLoginRespDto struct {
	common.BaseResponse
	Data struct {
		// 微信小程序授权登陆返回的字段
		User

		// 微信公众号授权登陆返回的字段
		Ticket       string `json:"ticket,omitempty"`
		RedirectURI  string `json:"redirect_uri,omitempty"`  // 前端通过该URI寻回回调地址
		QrcodepicURI string `json:"qrcodepic_uri,omitempty"` // 二维码图片地址

		// 微信开放平台返回的字段
		AuthCodeURL string `json:"auth_code_url,omitempty"` // 通过该URL获取用户授权code
	} `json:"data,omitempty"`
}

type SocialUnBindDto

type SocialUnBindDto struct {
	// 若需要指定用户绑定时传入的字段
	UID string `json:"uid,omitempty"`
	// 微信小程序绑定时无需传入字段
	// 微信公众号绑定时无需传入字段
	OpenID  string `json:"openid,omitempty"`
	UnionID string `json:"unionid,omitempty"`
}

type SocialWxOfficeTemplateMsgDto

type SocialWxOfficeTemplateMsgDto struct {
	ToUser      string          `json:"touser"`                // 必须, 接受者OpenID
	TemplateId  string          `json:"template_id"`           // 必须, 模版ID
	URL         string          `json:"url,omitempty"`         // 可选, 用户点击后跳转的URL, 该URL必须处于开发者在公众平台网站中设置的域中
	MiniProgram *MiniProgram    `json:"miniprogram,omitempty"` // 可选, 跳小程序所需数据,不需跳小程序可不用传该数据
	Data        json.RawMessage `json:"data"`                  // 必须, 模板数据, JSON 格式的 []byte, 满足特定的模板需求
}

微信公众号模板消息

type UpdateAccessKeyDto

type UpdateAccessKeyDto struct {
	AccessKey string `json:"access_key,omitempty"`
	Comment   string `json:"comment,omitempty"`
}

type UpdateAppDto

type UpdateAppDto struct {
	Id     string    `json:"id"`
	Name   string    `json:"name"`
	Domain string    `json:"domain"`
	Scope  []string  `json:"scope"`
	Config AppConfig `json:"config"`
}

type UpdatePasswordDto

type UpdatePasswordDto struct {
	Password    string `json:"password,omitempty"`
	NewPassword string `json:"new_password,omitempty"`
	RePassword  string `json:"re_password,omitempty"`
}

type UpdatePhoneDto

type UpdatePhoneDto struct {
	Phone    string `form:"phone" json:"phone"`
	Code     int    `form:"code" json:"code" binding:"min=1111,max=9999"`
	NewPhone string `form:"new_phone" json:"new_phone" binding:"required"`
	NewCode  int    `form:"new_code" json:"new_code" binding:"required,min=1111,max=9999"`
}

UpdatePhoneDto 用户修改手机表单

type UpdateUserDto

type UpdateUserDto struct {
	UserName  string `json:"username,omitempty"`
	Email     string `json:"email,omitempty"`
	Phone     string `json:"phone,omitempty"`
	Password  string `json:"password,omitempty"`
	Nickname  string `json:"nickname,omitempty"`
	City      string `json:"city,omitempty"`
	Country   string `json:"country,omitempty"`
	Language  string `json:"language,omitempty"`
	Birthdate string `json:"birthdate,omitempty"`
	Gender    string `json:"gender,omitempty"` //'M' | 'F' | 'U'
	Picture   string `json:"picture,omitempty"`
	Timezone  string `json:"timezone,omitempty"`
	Locale    string `json:"locale,omitempty"`
}

type UpdateUserProfileDto

type UpdateUserProfileDto struct {
	UserProfile
}

type User

type User struct {
	UID             string   `json:"uid,omitempty"`
	IsSuper         bool     `json:"issuper,omitempty"`
	UserName        string   `json:"username,omitempty"`
	Email           string   `json:"email,omitempty"`
	Phone           string   `json:"phone,omitempty"`
	AccessToken     string   `json:"access_token,omitempty"`
	UpdatedAt       string   `json:"updatedat,omitempty"`
	CrateddAt       string   `json:"createdat,omitempty"`
	SourceType      string   `json:"source_type,omitempty"`    // adminCreated=超级管理员创建, orgManagerCreated= 组织管理员创建, selfRegister=自注册
	CreatorUID      string   `json:"creator_uid,omitempty"`    // 创建者UID
	AccountStatus   int      `json:"account_status,omitempty"` // 1=正常,2=封禁
	WxUsers         []WxUser `json:"wxUsers,omitempty"`
	Roles           []string `json:"roles,omitempty"`
	OrganizationIDs []uint   `json:"organization_ids,omitempty"`
	UserProfile
}

type UserListDto

type UserListDto struct {
	Data []User
	common.BaseResponse
}

type UserProfile

type UserProfile struct {
	Nickname  string `json:"nickname,omitempty"`
	City      string `json:"city,omitempty"`
	Country   string `json:"country,omitempty"`
	Language  string `json:"language,omitempty"`
	Birthdate string `json:"birthdate,omitempty"`
	Gender    string `json:"gender,omitempty"` //'M' | 'F' | 'U'
	Picture   string `json:"picture,omitempty"`
	Timezone  string `json:"timezone,omitempty"`
	Locale    string `json:"locale,omitempty"`
	UnionId   string `json:"unionId,omitempty"`
	OpenId    string `json:"openId,omitempty"`
}

type UsernameLoginDto

type UsernameLoginDto struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type UsernameLoginResult

type UsernameLoginResult struct {
	User
	AccessTokenClaims
}

type UsernameRegisterDto

type UsernameRegisterDto struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type VerifyActionDto

type VerifyActionDto struct {
	Data struct {
		HasPermission bool `json:"hasPermission"`
	} `json:"data"`
	common.BaseResponse
}

type WxUser

type WxUser struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	OpenID    string `json:"openid"`
	UnionID   string `json:"unionid"`
	Phone     string `json:"phone"`
	UID       string `json:"uid"`
	SocialID  string `json:"socialid"`
	UpdatedAt string `json:"updatedAt,omitempty"`
	CreatedAt string `json:"createdAt,omitempty"`
}

WxUser 微信用户结构定义

type WxUserQueryDto

type WxUserQueryDto struct {
	Phone   string `json:"phone" binding:"omitempty"`
	OpenID  string `json:"openid" binding:"omitempty"`
	UnionID string `json:"unionid" binding:"omitempty"`
}

WxUserQueryDto 微信用户查询表单

Jump to

Keyboard shortcuts

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