domain

package
v0.0.0-...-89bec85 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const (
	UserIdPrefix     = "user"
	RoleIdPrefix     = "role"
	ResourceIdPrefix = "resource"
)
View Source
const (
	DictIdPrefix = "dict"
)

Variables

View Source
var DateTimeConverter = func(value string) reflect.Value {
	if v, err := time.Parse("2006-01-02 15:04:05", value); err == nil {
		return reflect.ValueOf(v)
	}
	return reflect.ValueOf(time.Time{})
}
View Source
var DateTimeFormat = "2006-01-02 15:04:05"
View Source
var SyncDomains []interface{}

Functions

This section is empty.

Types

type CommonResponse

type CommonResponse struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg,omitempty"`
	Data interface{} `json:"data,omitempty"`
}

type DateTime

type DateTime time.Time

func (DateTime) IsZero

func (t DateTime) IsZero() bool

func (DateTime) MarshalJSON

func (t DateTime) MarshalJSON() ([]byte, error)

func (*DateTime) UnmarshalJSON

func (t *DateTime) UnmarshalJSON(data []byte) error

type Dict

type Dict struct {
	Id         string   `json:"id,omitempty" xorm:"pk varchar(50)"`
	DictKey    string   `json:"dictKey,omitempty" xorm:"index varchar(50) comment('字典键')"`
	DictValue  string   `json:"dictValue,omitempty" xorm:"comment('字典值')"`
	DictExt    string   `json:"dictExt,omitempty" xorm:"comment('字典扩展值')"`
	ParentId   string   `json:"parentId,omitempty" xorm:"comment('父ID,若无则为字典分类')"`
	CreateTime DateTime `json:"createTime,omitempty" xorm:"created"`
}

type DictRequest

type DictRequest struct {
	Dict
	CreateTimeRange *TimeCondition `json:"createTimeRange,omitempty"`
}

type Paginate

type Paginate struct {
	Total  int         `json:"total"`
	Offset int         `json:"offset"`
	Limit  int         `json:"limit"`
	Items  interface{} `json:"items"`
}

type Resource

type Resource struct {
	Id              string   `json:"id,omitempty" xorm:"pk varchar(50)"`
	ResourceName    string   `json:"resourceName,omitempty" xorm:"comment('资源名称')"`
	ResourceContent string   `json:"resourceContent,omitempty" xorm:"comment('资源内容,如url、数据分类等等')"`
	ResourceType    string   `json:"resourceType,omitempty" xorm:"comment('资源类型,定义:route、data')"`
	Action          string   `json:"action,omitempty" xorm:"comment('资源操作类型,如url有GET/POST/PUT/DELETE')"`
	CreateTime      DateTime `json:"createTime,omitempty" xorm:"created"`
}

type ResourceRequest

type ResourceRequest struct {
	Resource
	CreateTimeRange *TimeCondition `json:"createTimeRange,omitempty"`
}

type Role

type Role struct {
	Id         string   `json:"id,omitempty" xorm:"pk varchar(50)"`
	RoleName   string   `json:"roleName,omitempty" xorm:"varchar(50)"`
	RoleDesc   string   `json:"roleDesc,omitempty"`
	CreateTime DateTime `json:"createTime,omitempty" xorm:"created"`
}

type RoleRequest

type RoleRequest struct {
	Role
	CreateTimeRange *TimeCondition `json:"createTimeRange,omitempty"`
}

type TimeCondition

type TimeCondition struct {
	Start DateTime `json:"start,omitempty" query:"start"`
	End   DateTime `json:"end,omitempty" query:"end"`
}

type User

type User struct {
	Id         string   `json:"id,omitempty" xorm:"pk varchar(50)"`
	Username   string   `json:"username,omitempty" xorm:"index varchar(50) comment('用户名')"`
	Password   string   `json:"password,omitempty" xorm:"comment('密码')"`
	CreateTime DateTime `json:"createTime,omitempty" xorm:"created"`
}

type UserRequest

type UserRequest struct {
	User
	CreateTimeRange *TimeCondition `json:"createTimeRange,omitempty"`
}

Jump to

Keyboard shortcuts

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