schema

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2019 License: GPL-3.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoginCaptcha

type LoginCaptcha struct {
	CaptchaID string `json:"captcha_id"` // Verification code ID
}

LoginCaptcha - Login verification code

type LoginParam

type LoginParam struct {
	UserName    string `json:"user_name" binding:"required"`    // UserName
	Password    string `json:"password" binding:"required"`     // Password (md5 encryption)
	CaptchaID   string `json:"captcha_id" binding:"required"`   // Verification code ID
	CaptchaCode string `json:"captcha_code" binding:"required"` // Verification code
}

LoginParam - Login parameter

type LoginTokenInfo

type LoginTokenInfo struct {
	AccessToken string `json:"access_token"` // Access token
	TokenType   string `json:"token_type"`   // Token type
	ExpiresAt   int64  `json:"expires_at"`   // Token expiration timestamp
}

LoginTokenInfo - Login token information

type Permission

type Permission struct {
	UUID       string              `json:"record_id"`               // Record ID
	Name       string              `json:"name" binding:"required"` // Permission name
	Sequence   int                 `json:"sequence"`                // Sort value
	Icon       string              `json:"icon"`                    // Permission icon
	Router     string              `json:"router"`                  // Access routing
	Hidden     int                 `json:"hidden"`                  // Hide Permission (0: don't hide 1: hide)
	ParentID   string              `json:"parent_id"`               // Parent ID
	ParentPath string              `json:"parent_path"`             // Parent path
	Creator    string              `json:"creator"`                 // Creator
	CreatedAt  time.Time           `json:"created_at"`              // Creation time
	Actions    PermissionActions   `json:"actions"`                 // Action list
	Resources  PermissionResources `json:"resources"`               // Resource list
}

Permission - Permission object

type PermissionAction

type PermissionAction struct {
	Code string `json:"code"` // Action number
	Name string `json:"name"` // Action name
}

PermissionAction - Permission action object

type PermissionActions

type PermissionActions []*PermissionAction

PermissionActions - Permission action list

type PermissionQueryOptions

type PermissionQueryOptions struct {
	PageParam        *schema.PaginationParam // Paging parameter
	IncludeActions   bool                    // Contains action list
	IncludeResources bool                    // Include resource list
}

PermissionQueryOptions - Query optional parameter items

type PermissionQueryParam

type PermissionQueryParam struct {
	UUIDs            []string // Record ID list
	LikeName         string   // Permission name (fuzzy query)
	Name             string   // Permission name
	ParentID         *string  // Parent ID
	PrefixParentPath string   // Parent path (prefix fuzzy query)
	Hidden           *int     // Hidden Permission
}

PermissionQueryParam - Query conditions

type PermissionQueryResult

type PermissionQueryResult struct {
	Data       Permissions
	PageResult *schema.PaginationResult
}

PermissionQueryResult - Search result

type PermissionResource

type PermissionResource struct {
	Code   string `json:"code"`   // Resource number
	Name   string `json:"name"`   // Resource Name
	Method string `json:"method"` // Request method
	Path   string `json:"path"`   // Request path
}

PermissionResource - Permission resource object

type PermissionResources

type PermissionResources []*PermissionResource

PermissionResources - Permission resource list

func (PermissionResources) ForEach

ForEach - Traversing resource data

func (PermissionResources) ToMap

ToMap - Convert to key-value mapping

type PermissionTree

type PermissionTree struct {
	UUID       string              `json:"record_id"`               // Record ID
	Name       string              `json:"name" binding:"required"` // Permission name
	Sequence   int                 `json:"sequence"`                // Sort value
	Icon       string              `json:"icon"`                    // Permission icon
	Router     string              `json:"router"`                  // Access routing
	Hidden     int                 `json:"hidden"`                  // Hide Permission (0: don't hide 1: hide)
	ParentID   string              `json:"parent_id"`               // Parent ID
	ParentPath string              `json:"parent_path"`             // Parent path
	Resources  PermissionResources `json:"resources"`               // Resource list
	Actions    PermissionActions   `json:"actions"`                 // Action list
	Children   *[]*PermissionTree  `json:"children,omitempty"`      // Child tree
}

PermissionTree - Permission tree

type PermissionTrees

type PermissionTrees []*PermissionTree

PermissionTrees - Permission tree list

func (PermissionTrees) ForEach

func (a PermissionTrees) ForEach(fn func(*PermissionTree, int)) PermissionTrees

ForEach - Through the data entry

func (PermissionTrees) ToTree

func (a PermissionTrees) ToTree() []*PermissionTree

ToTree - Convert to tree structure

type Permissions

type Permissions []*Permission

Permissions - Permission list

func (Permissions) SplitAndGetAllUUIDs

func (a Permissions) SplitAndGetAllUUIDs() []string

SplitAndGetAllUUIDs - Split parent path and get all record IDs

func (Permissions) ToLeafUUIDs

func (a Permissions) ToLeafUUIDs() []string

ToLeafUUIDs - Convert to leaf node record ID list

func (Permissions) ToMap

func (a Permissions) ToMap() map[string]*Permission

ToMap - Convert to key-value mapping

func (Permissions) ToTrees

func (a Permissions) ToTrees() PermissionTrees

ToTrees - Convert to Permission list

type Role

type Role struct {
	UUID        string          `json:"record_id"`                           // Record ID
	Name        string          `json:"name" binding:"required"`             // Role Name
	Sequence    int             `json:"sequence"`                            // Sort value
	Memo        string          `json:"memo"`                                // Remarks
	Creator     string          `json:"creator"`                             // Creator
	CreatedAt   time.Time       `json:"created_at"`                          // Creation time
	Permissions RolePermissions `json:"permissions" binding:"required,gt=0"` // Permission permission
}

Role - Role object

type RolePermission

type RolePermission struct {
	PermissionID string   `json:"permission_id"` // Permission ID
	Actions      []string `json:"actions"`       // Action permission list
	Resources    []string `json:"resources"`     // Resource permission list
}

RolePermission - Role permission object

type RolePermissions

type RolePermissions []*RolePermission

RolePermissions - Role permission list

func (RolePermissions) ToPermissionIDs

func (a RolePermissions) ToPermissionIDs() []string

ToPermissionIDs - Convert to permission ID list

type RoleQueryOptions

type RoleQueryOptions struct {
	PageParam          *schema.PaginationParam // Paging parameter
	IncludePermissions bool                    // Contains permission permissions
}

RoleQueryOptions Query optional parameter items

type RoleQueryParam

type RoleQueryParam struct {
	UUIDs    []string // Record ID list
	Name     string   // Role Name
	LikeName string   // Role name (fuzzy query)
	UserUUID string   // User UUID
}

RoleQueryParam - Query conditions

type RoleQueryResult

type RoleQueryResult struct {
	Data       Roles
	PageResult *schema.PaginationResult
}

RoleQueryResult - Search result

type Roles

type Roles []*Role

Roles - Role object list

func (Roles) ToMap

func (a Roles) ToMap() map[string]*Role

ToMap - Convert to key-value store

func (Roles) ToNames

func (a Roles) ToNames() []string

ToNames - Get a list of role names

func (Roles) ToPermissionIDActionsMap

func (a Roles) ToPermissionIDActionsMap() map[string][]string

ToPermissionIDActionsMap - Action permission list mapping converted to permission ID

func (Roles) ToPermissionIDs

func (a Roles) ToPermissionIDs() []string

ToPermissionIDs - Get all the permission IDs (do not go heavy)

type UpdatePasswordParam

type UpdatePasswordParam struct {
	OldPassword string `json:"old_password" binding:"required"` // Old password (md5 encryption)
	NewPassword string `json:"new_password" binding:"required"` // Old password (md5 encryption)
}

UpdatePasswordParam - Update password request parameters

type User

type User struct {
	UUID      string    `json:"record_id"`                             // Record ID
	UserName  string    `json:"user_name" binding:"required"`          // UserName
	RealName  string    `json:"real_name" binding:"required"`          // RealName
	Password  string    `json:"password"`                              // Password
	Phone     string    `json:"phone"`                                 // Phone number
	Email     string    `json:"email"`                                 // Email
	Status    int       `json:"status" binding:"required,max=2,min=1"` // User Status (1: Enable 2: Disable)
	Creator   string    `json:"creator"`                               // Creator
	CreatedAt time.Time `json:"created_at"`                            // Creation time
	Roles     UserRoles `json:"roles" binding:"required,gt=0"`         // Role authorization
}

User - User object

func (*User) CleanSecure

func (a *User) CleanSecure() *User

CleanSecure - Clean up safety data

type UserLoginInfo

type UserLoginInfo struct {
	UserName  string   `json:"user_name"`  // UserName
	RealName  string   `json:"real_name"`  // RealName
	RoleNames []string `json:"role_names"` // List of role names
}

UserLoginInfo - User login information

type UserQueryOptions

type UserQueryOptions struct {
	PageParam    *schema.PaginationParam // Paging parameter
	IncludeRoles bool                    // Include role permissions
}

UserQueryOptions - Query optional parameter items

type UserQueryParam

type UserQueryParam struct {
	UserName     string   // UserName
	LikeUserName string   // Username (fuzzy query)
	LikeRealName string   // Real name (fuzzy query)
	Status       int      // User Status (1: Enable 2: Disable)
	RoleIDs      []string // Role ID list
}

UserQueryParam - Query conditions

type UserQueryResult

type UserQueryResult struct {
	Data       Users
	PageResult *schema.PaginationResult
}

UserQueryResult - User Query result

type UserRole

type UserRole struct {
	RoleID string `json:"role_id" swaggo:"true, Role ID"`
}

UserRole - User role

type UserRoles

type UserRoles []*UserRole

UserRoles - User role list

func (UserRoles) ToRoleIDs

func (a UserRoles) ToRoleIDs() []string

ToRoleIDs - Convert to a list of role IDs

type UserShow

type UserShow struct {
	UUID      string    `json:"record_id"`  // Record ID
	UserName  string    `json:"user_name"`  // UserName
	RealName  string    `json:"real_name"`  // RealName
	Phone     string    `json:"phone"`      // Phone
	Email     string    `json:"email"`      // Email
	Status    int       `json:"status"`     // User Status (1: Enable 2: Disable)
	CreatedAt time.Time `json:"created_at"` // Creation time
	Roles     []*Role   `json:"roles"`      // Roles List
}

UserShow - User display item

type UserShowQueryResult

type UserShowQueryResult struct {
	Data       UserShows
	PageResult *schema.PaginationResult
}

UserShowQueryResult - User display item query result

type UserShows

type UserShows []*UserShow

UserShows - User display item list

type Users

type Users []*User

Users - User object list

func (Users) ToRoleIDs

func (a Users) ToRoleIDs() []string

ToRoleIDs - Get a list of role IDs

func (Users) ToUserShows

func (a Users) ToUserShows(mroles map[string]*Role) UserShows

ToUserShows - Convert to user display list

Jump to

Keyboard shortcuts

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