dto

package
v0.0.0-...-2f954c6 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreateLevel = "createLevel"
	ReadLevel   = "readLevel"
	UpdateLevel = "updateLevel"
	DeleteLevel = "deleteLevel"
)

权限等级分为 4 个等级 0: 无权限 1: 仅创建者 2: 仅登录者 3: 所有人

Variables

This section is empty.

Functions

This section is empty.

Types

type Permission

type Permission struct {
	Title          string
	ProjectName    string
	CollectionName string
	CreateLevel    int
	ReadLevel      int
	UpdateLevel    int
	DeleteLevel    int
}

Permission .

func (*Permission) GetPermissionLevel

func (p *Permission) GetPermissionLevel(name string) int

GetPermissionLevel 获取权限等级

type Project

type Project struct {
	ID          string
	Title       string
	Name        string
	Description string
	Cover       string
}

Project .

type Schema

type Schema struct {
	Name        string
	Title       string
	ProjectName string
	Description string
	Fields      []*SchemaField
}

Schema .

func (*Schema) GetFieldNames

func (schema *Schema) GetFieldNames(includeHidden, includePrivate bool) []string

GetFieldNames 获取字段名 includeHidden: 包括 is_hidden 的字段 includePrivate: 包括 is_private 的字段

func (*Schema) GetFields

func (schema *Schema) GetFields(includeHidden, includePrivate bool) []*SchemaField

GetFields : 获取字段

func (*Schema) GetHiddenFieldNames

func (schema *Schema) GetHiddenFieldNames() []string

GetHiddenFieldNames : 获取所有隐藏字段名

func (*Schema) GetHiddenFields

func (schema *Schema) GetHiddenFields() []*SchemaField

GetHiddenFields : 获取所有隐藏字段

func (*Schema) GetPrivateFieldNames

func (schema *Schema) GetPrivateFieldNames() []string

GetPrivateFieldNames : 获取所有私密字段名

func (*Schema) GetPrivateFields

func (schema *Schema) GetPrivateFields() []*SchemaField

GetPrivateFields : 获取所有私密字段

func (*Schema) GetRequiredFieldNames

func (schema *Schema) GetRequiredFieldNames() []string

GetRequiredFieldNames : 获取所有必填的字段名

func (*Schema) GetRequiredFields

func (schema *Schema) GetRequiredFields() []*SchemaField

GetRequiredFields : 获取所有必填的字段

func (*Schema) GetUniqueFieldNames

func (schema *Schema) GetUniqueFieldNames() []string

GetUniqueFieldNames : 获取所有私密字段名

func (*Schema) GetUniqueFields

func (schema *Schema) GetUniqueFields() []*SchemaField

GetUniqueFields : 获取所有私密字段

type SchemaField

type SchemaField struct {
	Name              string
	Title             string
	IsRequired        bool
	IsHidden          bool
	IsReadOnly        bool
	IsUnique          bool
	IsPrivate         bool
	IsIndexField      bool
	IsSysField        bool
	Default           interface{}
	HasDefault        bool
	ConnectCollection string
	ConnectField      string
	ConnectMany       bool
	Validator         string
	Enum              []string
	EnumNames         []string
	Description       string
}

SchemaField .

func (*SchemaField) CheckFieldValue

func (field *SchemaField) CheckFieldValue(value interface{}) *gvalid.Error

CheckFieldValue : 校验字段值的合法性 TODO: 错误信息支持多语言

type UserLoginReq

type UserLoginReq struct {
	Login    string `v:"required#请输入用户名/手机号/邮箱"` // 支持用户名/手机号/邮箱
	Password string `v:"required#请输入密码"`
}

UserLoginReq 用户注册请求 TODO: 用户登录密码加密传输

type UserSignUpWithEmailReq

type UserSignUpWithEmailReq struct {
	Username  string `v:"required|length:6,12#请输入用户名|用户名长度应当在:min到:max之间"`
	Password  string `v:"required|length:6,16#请输入密码|密码长度应当在:min到:max之间"`
	Password2 string `` /* 127-byte string literal not displayed */
	Email     string `v:"required|email#请输入邮箱|邮箱格式不正确"`
	Captcha   string `v:"required#请输入验证码"`
}

UserSignUpWithEmailReq 用户邮箱注册请求

type UserSignUpWithPhoneReq

type UserSignUpWithPhoneReq struct {
	Username  string `v:"required|length:6,12#请输入用户名|用户名长度应当在:min到:max之间"`
	Password  string `v:"required|length:6,16#请输入密码|密码长度应当在:min到:max之间"`
	Password2 string `` /* 127-byte string literal not displayed */
	Phone     string `v:"required|phone#请输入手机号|手机号格式不正确"`
	Captcha   string `v:"required#请输入验证码"`
}

UserSignUpWithPhoneReq 用户手机号注册请求

type UserUpdateInfoReq

type UserUpdateInfoReq struct {
	Avatar   string
	Language string `v:"required|in:zh-CN,en#请选择语言|请选择中文或者英文"`
}

UserUpdateInfoReq 用户更新个人信息请求

type UserUpdatePasswordReq

type UserUpdatePasswordReq struct {
	OldPassword string `v:"required#请输入旧密码"`
	Password    string `v:"required|length:6,16#请输入新密码|密码长度应当在:min到:max之间"`
	Password2   string `` /* 127-byte string literal not displayed */
}

UserUpdatePasswordReq 用户更新密码请求

Jump to

Keyboard shortcuts

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