domain

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	STATUS_INVALID int = 0
	STATUS_VALID   int = 1
	STATUS2        int = 2
	STATUS3        int = 3
)
View Source
var StandardSysOption = map[string]interface{}{
	"": "",
}

Functions

func OptionsToMap

func OptionsToMap(sysEnvs []Option) map[string]interface{}

Types

type AuditingEntity

type AuditingEntity struct {
	Entity
	CreatedBy      string `gorm:"column:created_by" json:"createdBy"`
	LastModifiedBy string `gorm:"column:last_modified_by" json:"lastModifiedBy"`
}

type AuditingModel

type AuditingModel struct {
	Model
	CreatedBy      string `gorm:"created_by" json:"createdBy"`
	LastModifiedBy string `gorm:"lastModified_by" json:"lastModifiedBy"`
}

type DeletableEntity

type DeletableEntity struct {
	AuditingEntity
	DelFlag     bool      `gorm:"column:del_flag;default:false" json:"delFlag"`
	DeletedTime time.Time `gorm:"column:deleted_time;autoUpdateTime" json:"deleted_time"`
	DeletedBy   string    `gorm:"column:deleted_by" json:"deleted_by"`
}

type DeletableModel

type DeletableModel struct {
	AuditingModel
	DelFlag     bool      `gorm:"column:del_flag;default:false" json:"delFlag"`
	DeletedTime time.Time `gorm:"column:deleted_time;autoUpdateTime" json:"deleted_time"`
	DeletedBy   string    `gorm:"column:deleted_by" json:"deleted_by"`
}

type Entity

type Entity struct {
	Id               string    `gorm:"column:id;primaryKey" json:"id" primaryKey:"yes"`
	CreatedTime      time.Time `gorm:"column:created_time;autoCreateTime" json:"createdTime"`
	LastModifiedTime time.Time `gorm:"column:last_modified_time;autoUpdateTime" json:"lastModifiedTime"`
	TenantId         string    `gorm:"column:tenant_id" json:"tenantId"`
}

func (*Entity) BeforeCreate

func (e *Entity) BeforeCreate(tx *gorm.DB) (err error)

type InviteCode

type InviteCode struct {
	Entity
	InviteCode   string     `gorm:"column:invite_code" json:"inviteCode"`
	UserId       string     `gorm:"column:user_id" json:"userId"`
	Channel      string     `gorm:"column:channel" json:"channel"`
	ExpireTime   *time.Time `gorm:"column:expire_time" json:"expireTime,omitempty"`
	InviteLimit  int64      `gorm:"column:invite_limit" json:"inviteLimit"`
	InvitedLimit int64      `gorm:"column:invited_limit" json:"invitedLimit"`
}

func (*InviteCode) IsExpired

func (c *InviteCode) IsExpired() bool

func (*InviteCode) TableName

func (*InviteCode) TableName() string

type Model

type Model struct {
	Id               int64     `gorm:"primaryKey" json:"id" primaryKey:"yes"`
	CreatedTime      time.Time `gorm:"column:created_time;autoCreateTime" json:"createdTime"`
	LastModifiedTime time.Time `gorm:"column:last_modified_time;autoUpdateTime" json:"lastModifiedTime"`
	TenantId         string    `gorm:"column:tenant_id" json:"tenantId"`
}

func (*Model) BeforeCreate

func (m *Model) BeforeCreate(tx *gorm.DB) (err error)

type Option

type Option struct {
	Name        string `gorm:"column:name" json:"name"`
	Value       string `gorm:"column:value" json:"value"`
	ValueType   string `gorm:"column:value_type" json:"valueType"`
	Description string `gorm:"column:description" json:"description"`
}

type Organization

type Organization struct {
	Model
	Fid      int64          `json:"fid" fid:"Id"`
	Name     string         `json:"name"`
	Status   string         `json:"status"`
	PathInfo string         `json:"pathInfo"`
	Remark   string         `json:"remark,omitempty"`
	Leaf     bool           `gorm:"->" json:"leaf"` // 是否为叶子节点
	Expand   bool           `gorm:"->" json:"expand"`
	NodeType string         `gorm:"->" json:"nodeType"`
	Children []Organization `gorm:"-" json:"children,omitempty"`
}

func (*Organization) TableName

func (*Organization) TableName() string

type OrganizationMember

type OrganizationMember struct {
	OrganizationUser
	Name             string `gorm:"->" json:"name,omitempty"`
	Login            string `gorm:"->" json:"login,omitempty"`
	Mobile           string `gorm:"->" json:"mobile,omitempty"`
	Email            string `gorm:"->" json:"email,omitempty"`
	Title            string `gorm:"->" json:"title,omitempty"`
	OrganizationName string `gorm:"->" json:"organizationName,omitempty"`
	PositionName     string `gorm:"->" json:"positionName,omitempty"`
}

定义不同的查询结果返回的数据结构体

type OrganizationUser

type OrganizationUser struct {
	Relation
	OrganizationId int64  `gorm:"column:organization_id" json:"organizationId"`
	UserId         string `gorm:"column:user_id" json:"userId"`
	PositionId     *int64 `gorm:"column:position_id" json:"positionId"`
	Status         int    `gorm:"column:status;default:1" json:"status"`
	Remark         string `json:"remark,omitempty"`
}

func (*OrganizationUser) TableName

func (a *OrganizationUser) TableName() string

表名

type Relation

type Relation struct {
	CreatedTime      time.Time `gorm:"column:created_time;autoCreateTime" json:"createdTime"`
	LastModifiedTime time.Time `gorm:"column:last_modified_time;autoUpdateTime" json:"lastModifiedTime"`
}

type Role

type Role struct {
	Entity
	Name string `json:"name"`
}

func (*Role) TableName

func (*Role) TableName() string

type RoleMember

type RoleMember struct {
	RoleUser
	Name     string `json:"name,omitempty"`
	Login    string `json:"login,omitempty"`
	Mobile   string `json:"mobile,omitempty"`
	Email    string `json:"email,omitempty"`
	RoleName string `json:"roleName,omitempty"`
}

定义不同的查询结果返回的数据结构体

type RoleUser

type RoleUser struct {
	Relation
	RoleId string `gorm:"column:role_id" json:"roleId"`
	UserId string `gorm:"column:user_id" json:"userId"`
	Status int    `gorm:"column:status;default:1" json:"status"`
	Remark string `gorm:"column:remark" json:"remark,omitempty"`
}

func (*RoleUser) TableName

func (a *RoleUser) TableName() string

表名

type SocialUser

type SocialUser struct {
	Entity
	DelFlag       bool       `gorm:"column:del_flag" json:"delFlag"`
	Type          string     `gorm:"column:type" json:"type"`
	OpenId        *string    `gorm:"column:open_id" json:"openId,omitempty"`
	SocialId      *string    `gorm:"column:social_id" json:"socialId,omitempty"`
	Mobile        *string    `gorm:"column:mobile" json:"mobile,omitempty"`
	Email         *string    `gorm:"column:email" json:"email,omitempty"`
	Name          *string    `gorm:"column:name" json:"name,omitempty"`
	Status        *int       `gorm:"column:status;default:1" json:"status"`
	Avatar        *string    `gorm:"column:avatar" json:"avatar,omitempty"`
	LoginTimes    int        `gorm:"column:login_times" json:"loginTimes"`
	Remark        *string    `gorm:"column:remark" json:"remark,omitempty"`
	LastLoginTime *time.Time `gorm:"column:last_login_time" json:"lastLoginTime,omitempty"`
	LastLoginIp   *string    `gorm:"column:last_login_ip" json:"lastLoginIp,omitempty"`
	NickName      *string    `gorm:"column:nick_name" json:"nickName,omitempty"`
	Title         *string    `gorm:"column:title;" json:"title,omitempty"`
	UserId        *string    `gorm:"column:user_id" json:"userId,omitempty"`
	Roles         []Role     `gorm:"-" json:"roles,omitempty"`
}

func (*SocialUser) SetSocialId

func (u *SocialUser) SetSocialId(socialType string, socialId string) *SocialUser

func (*SocialUser) TableName

func (u *SocialUser) TableName() string

type SysOption

type SysOption struct {
	Option
	Public           bool      `gorm:"column:public" json:"public"`
	CreatedTime      time.Time `gorm:"column:created_time;autoCreateTime" json:"createdTime"`
	CreatedBy        string    `gorm:"column:created_by" json:"createdBy"`
	LastModifiedTime time.Time `gorm:"column:last_modified_time;autoUpdateTime" json:"lastModifiedTime"`
	LastModifiedBy   string    `gorm:"column:last_modified_by" json:"lastModifiedBy"`
	TenantId         string    `gorm:"column:tenant_id" json:"tenantId"`
}

func (*SysOption) TableName

func (*SysOption) TableName() string

type SysOptions

type SysOptions struct {
	TenantId string
	Options  map[string]SysOption
}

func (*SysOptions) GetOption

func (s *SysOptions) GetOption(name string) (string, bool)

func (*SysOptions) SetOption

func (s *SysOptions) SetOption(name string, value string) bool

type User

type User struct {
	UserBase
	Password   string `gorm:"column:password" json:"-"`
	Admin      bool   `gorm:"column:admin" json:"admin"`
	InviteCode string `gorm:"-" json:"inviteCode,omitempty"`
	Roles      []Role `gorm:"many2many:sys_role_user;" json:"roles,omitempty"`
}

func (*User) SetPassword

func (u *User) SetPassword(value string) *User

func (*User) TableName

func (u *User) TableName() string

type UserBase

type UserBase struct {
	Entity
	DelFlag       bool       `gorm:"column:del_flag" json:"del_flag"`
	Login         *string    `gorm:"column:login" json:"login,omitempty"`
	Mobile        *string    `gorm:"column:mobile" json:"mobile,omitempty"`
	Email         *string    `gorm:"column:email" json:"email,omitempty"`
	Name          *string    `gorm:"column:name" json:"name,omitempty"`
	Status        *int       `gorm:"column:status" json:"status"`
	Avatar        *string    `gorm:"column:avatar" json:"avatar,omitempty"`
	Remark        *string    `gorm:"column:remark" json:"remark,omitempty"`
	InviterId     *string    `gorm:"column:inviter_id" json:"inviterId,omitempty"`
	LoginTimes    int        `gorm:"column:login_times" json:"loginTimes"`
	LastLoginTime *time.Time `gorm:"column:last_login_time" json:"lastLoginTime,omitempty"`
	LastLoginIp   *string    `gorm:"column:last_login_ip" json:"lastLoginIp,omitempty"`
}

type UserOption

type UserOption struct {
	Option
	UserId string `gorm:"column:user_id"`
}

func (*UserOption) TableName

func (*UserOption) TableName() string

type UserOptions

type UserOptions struct {
	UserId  string
	Options map[string]UserOption
}

func (*UserOptions) GetOption

func (s *UserOptions) GetOption(name string) (string, bool)

func (*UserOptions) SetOption

func (s *UserOptions) SetOption(name string, value string) bool

type UserWithOrganization

type UserWithOrganization struct {
	User
	OrganizationId   int64  `gorm:"->" json:"organizationId"`
	OrganizationName string `gorm:"->" json:"organizationName"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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