models

package
v1.4.1-0...-415649e Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ProjectMembersManage = "manage"
	ProjectMembersWrite  = "write"
	ProjectMembersRead   = "read"
)
View Source
var (
	// Conn 是一个指向数据库连接的指针
	Conn *gorm.DB
)

Functions

func BatchDeleteIterationApi

func BatchDeleteIterationApi(ias []*IterationApis) error

func BatchInsertIterationApi

func BatchInsertIterationApi(ias []*IterationApis) error

func BatchUpdateByProjectID

func BatchUpdateByProjectID(ProjectID uint, c map[string]any) error

func CollectionExport

func CollectionExport(project *Projects, collection *Collections) *spec.Spec

CollectionExport 返回单篇文档导出的 apicat 结构 project 导出集合所属项目 model collection 导出的集合 model

func CollectionToTagIds

func CollectionToTagIds(collectionID uint) []uint

func CollectionsExport

func CollectionsExport(projectID uint) []*spec.CollectItem

func DBConnStatus

func DBConnStatus() (status uint, err error)

DBConnStatus status 返回数据库连接状态,1-成功,2-失败,3-数据库不存在 err 连接遇到错误时返回错误信息

func DefinitionIdToName

func DefinitionIdToName(content string, idToNameMap IdToNameMap) string

func DefinitionParametersExport

func DefinitionParametersExport(projectID uint) spec.Schemas

func DefinitionParametersImport

func DefinitionParametersImport(projectID uint, parameters spec.Schemas) virtualIDToIDMap

func DefinitionResponsesExport

func DefinitionResponsesExport(projectID uint) spec.HTTPResponseDefines

func DefinitionResponsesImport

func DefinitionResponsesImport(projectID uint, responses spec.HTTPResponseDefines) virtualIDToIDMap

func DefinitionSchemasExport

func DefinitionSchemasExport(projectID uint) spec.Schemas

func DefinitionSchemasImport

func DefinitionSchemasImport(projectID uint, schemas spec.Schemas, uid uint) virtualIDToIDMap

func DefinitionsResponseDelRef

func DefinitionsResponseDelRef(dr *DefinitionResponses, uid uint) error

func DefinitionsResponseUnRef

func DefinitionsResponseUnRef(dr *DefinitionResponses, uid uint) error

func DefinitionsSchemaUnRefByCollections

func DefinitionsSchemaUnRefByCollections(d *DefinitionSchemas, isUnRef int, uid uint) error

func DefinitionsSchemaUnRefByDefinitionsResponse

func DefinitionsSchemaUnRefByDefinitionsResponse(d *DefinitionSchemas, isUnRef int) error

func DefinitionsSchemaUnRefByDefinitionsSchema

func DefinitionsSchemaUnRefByDefinitionsSchema(d *DefinitionSchemas, isUnRef int, uid uint) error

func DeleteAllMembersByProjectID

func DeleteAllMembersByProjectID(projectID uint) error

func DeleteIterationApisByCollectionID

func DeleteIterationApisByCollectionID(cIDs ...uint) error

func Deletes

func Deletes(id uint, db *gorm.DB, deletedBy uint) error

func GetProjectGroupCountByName

func GetProjectGroupCountByName(userID uint, name string) (int64, error)

func GetProjectGroupCountExcludeTheID

func GetProjectGroupCountExcludeTheID(userID uint, name string, id uint) (int64, error)

func GetProjectGroupDisplayOrder

func GetProjectGroupDisplayOrder(userID uint) (int, error)

func GlobalParametersExport

func GlobalParametersExport(projectID uint) spec.HTTPParameters

func GlobalParametersImport

func GlobalParametersImport(projectID uint, parameters *spec.HTTPParameters) map[int64]uint

func Init

func Init()

func IterationApiCount

func IterationApiCount(IterationID uint, cType string) (int64, error)

func IterationsCount

func IterationsCount(pIDs ...uint) (int64, error)

func ReplaceGlobalParametersVirtualIDToID

func ReplaceGlobalParametersVirtualIDToID(content string, virtualIDToIDMap virtualIDToIDMap) string

func ServersExport

func ServersExport(projectID uint) []*spec.Server

func ServersImport

func ServersImport(projectID uint, servers []*spec.Server)

func TagsExport

func TagsExport(collectionID uint) []string

func TagsImport

func TagsImport(projectID uint, collectionID uint, tags []string)

Types

type CollectionHistories

type CollectionHistories struct {
	ID           uint   `gorm:"type:bigint;primaryKey;autoIncrement"`
	CollectionId uint   `gorm:"type:bigint;index;not null;comment:集合id"`
	Title        string `gorm:"type:varchar(255);not null;comment:名称"`
	Type         string `gorm:"type:varchar(255);not null;comment:类型:category,doc,http"`
	Content      string `gorm:"type:mediumtext;comment:内容"`
	CreatedAt    time.Time
	CreatedBy    uint `gorm:"type:bigint;not null;default:0;comment:创建人id"`
}

func NewCollectionHistories

func NewCollectionHistories(ids ...uint) (*CollectionHistories, error)

func (*CollectionHistories) Create

func (ch *CollectionHistories) Create() error

func (*CollectionHistories) List

func (ch *CollectionHistories) List(collectionIDs ...uint) ([]*CollectionHistories, error)

func (*CollectionHistories) Restore

func (ch *CollectionHistories) Restore(collection *Collections, uid uint) error

type Collections

type Collections struct {
	ID            uint   `gorm:"type:bigint;primaryKey;autoIncrement"`
	PublicId      string `gorm:"type:varchar(255);comment:集合公开id"`
	ProjectId     uint   `gorm:"type:bigint;index;not null;comment:项目id"`
	ParentId      uint   `gorm:"type:bigint;not null;comment:父级id"`
	Title         string `gorm:"type:varchar(255);not null;comment:名称"`
	Type          string `gorm:"type:varchar(255);not null;comment:类型:category,doc,http"`
	SharePassword string `gorm:"type:varchar(255);comment:项目分享密码"`
	Content       string `gorm:"type:mediumtext;comment:内容"`
	DisplayOrder  int    `gorm:"type:int(11);not null;default:0;comment:显示顺序"`
	CreatedAt     time.Time
	CreatedBy     uint `gorm:"type:bigint;not null;default:0;comment:创建人id"`
	UpdatedAt     time.Time
	UpdatedBy     uint `gorm:"type:bigint;not null;default:0;comment:最后更新人id"`
	DeletedAt     gorm.DeletedAt
	DeletedBy     uint `gorm:"type:bigint;not null;default:0;comment:删除人id"`
}

func CollectionsImport

func CollectionsImport(projectID, parentID uint, collections []*spec.CollectItem, refContentNameToId *RefContentVirtualIDToId) []*Collections

func NewCollections

func NewCollections(ids ...uint) (*Collections, error)

func (*Collections) Create

func (c *Collections) Create() error

func (*Collections) CreateCategory

func (c *Collections) CreateCategory() error

func (*Collections) CreateDoc

func (c *Collections) CreateDoc() error

func (*Collections) Creator

func (c *Collections) Creator() string

func (*Collections) Deleter

func (c *Collections) Deleter() string

func (*Collections) GetByPublicId

func (c *Collections) GetByPublicId() error

func (*Collections) GetSubCollectionsContainsSelf

func (c *Collections) GetSubCollectionsContainsSelf() ([]*Collections, error)

func (*Collections) GetUnscopedCollections

func (c *Collections) GetUnscopedCollections() error

func (*Collections) List

func (c *Collections) List() ([]*Collections, error)

func (*Collections) Restore

func (c *Collections) Restore() error

func (*Collections) TrashList

func (c *Collections) TrashList() ([]*Collections, error)

func (*Collections) Update

func (c *Collections) Update() error

func (*Collections) UpdateContent

func (c *Collections) UpdateContent(must bool, title string, content string, updatedBy uint) error

func (*Collections) Updater

func (c *Collections) Updater() string

type DefinitionParameters

type DefinitionParameters struct {
	ID        uint   `gorm:"type:bigint;primaryKey;autoIncrement"`
	ProjectID uint   `gorm:"type:bigint;index;not null;comment:项目id"`
	Name      string `gorm:"type:varchar(255);not null;comment:参数名称"`
	Required  int    `gorm:"type:tinyint(1);not null;comment:是否必传:0-否,1-是"`
	Schema    string `gorm:"type:mediumtext;comment:参数内容"`
	CreatedAt time.Time
	UpdatedAt time.Time
}

func NewDefinitionParameters

func NewDefinitionParameters(ids ...uint) (*DefinitionParameters, error)

func (*DefinitionParameters) Create

func (dp *DefinitionParameters) Create() error

func (*DefinitionParameters) Delete

func (dp *DefinitionParameters) Delete() error

func (*DefinitionParameters) List

func (*DefinitionParameters) Save

func (dp *DefinitionParameters) Save() error

type DefinitionResponses

type DefinitionResponses struct {
	ID           uint   `gorm:"type:bigint;primaryKey;autoIncrement"`
	ProjectID    uint   `gorm:"type:bigint;index;not null;comment:项目id"`
	Name         string `gorm:"type:varchar(255);not null;comment:响应名称"`
	Description  string `gorm:"type:varchar(255);not null;comment:状态描述"`
	Type         string `gorm:"type:varchar(255);not null;comment:响应类型:category,response"`
	Header       string `gorm:"type:mediumtext;comment:响应头"`
	Content      string `gorm:"type:mediumtext;comment:响应内容"`
	DisplayOrder int    `gorm:"type:int(11);not null;default:0;comment:显示顺序"`
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

func NewDefinitionResponses

func NewDefinitionResponses(ids ...uint) (*DefinitionResponses, error)

func (*DefinitionResponses) Create

func (dr *DefinitionResponses) Create() error

func (*DefinitionResponses) Delete

func (dr *DefinitionResponses) Delete() error

func (*DefinitionResponses) GetCountByName

func (dr *DefinitionResponses) GetCountByName() (int64, error)

func (*DefinitionResponses) GetCountExcludeTheID

func (dr *DefinitionResponses) GetCountExcludeTheID() (int64, error)

func (*DefinitionResponses) List

func (*DefinitionResponses) Update

func (dr *DefinitionResponses) Update() error

type DefinitionSchemaHistories

type DefinitionSchemaHistories struct {
	ID          uint   `gorm:"type:bigint;primaryKey;autoIncrement"`
	SchemaID    uint   `gorm:"type:bigint;index;not null;comment:模型id"`
	Name        string `gorm:"type:varchar(255);not null;comment:名称"`
	Description string `gorm:"type:varchar(255);comment:描述"`
	Type        string `gorm:"type:varchar(255);not null;comment:类型:category,schema"`
	Schema      string `gorm:"type:mediumtext;comment:内容"`
	CreatedAt   time.Time
	CreatedBy   uint `gorm:"type:bigint;not null;default:0;comment:创建人id"`
}

func NewDefinitionSchemaHistories

func NewDefinitionSchemaHistories(ids ...uint) (*DefinitionSchemaHistories, error)

func (*DefinitionSchemaHistories) Create

func (dsh *DefinitionSchemaHistories) Create() error

func (*DefinitionSchemaHistories) List

func (dsh *DefinitionSchemaHistories) List(schemsIDs ...uint) ([]*DefinitionSchemaHistories, error)

func (*DefinitionSchemaHistories) Restore

func (dsh *DefinitionSchemaHistories) Restore(ds *DefinitionSchemas, uid uint) error

type DefinitionSchemas

type DefinitionSchemas struct {
	ID           uint   `gorm:"type:bigint;primaryKey;autoIncrement"`
	ProjectId    uint   `gorm:"type:bigint;index;not null;comment:项目id"`
	ParentId     uint   `gorm:"type:bigint;not null;comment:父级id"`
	Name         string `gorm:"type:varchar(255);not null;comment:名称"`
	Description  string `gorm:"type:varchar(255);comment:描述"`
	Type         string `gorm:"type:varchar(255);not null;comment:类型:category,schema"`
	Schema       string `gorm:"type:mediumtext;comment:内容"`
	DisplayOrder int    `gorm:"type:int(11);not null;default:0;comment:显示顺序"`
	CreatedAt    time.Time
	CreatedBy    uint `gorm:"type:bigint;not null;default:0;comment:创建人id"`
	UpdatedAt    time.Time
	UpdatedBy    uint `gorm:"type:bigint;not null;default:0;comment:最后更新人id"`
	DeletedAt    *gorm.DeletedAt
	DeletedBy    uint `gorm:"type:bigint;not null;default:0;comment:删除人id"`
}

func NewDefinitionSchemas

func NewDefinitionSchemas(ids ...uint) (*DefinitionSchemas, error)

func (*DefinitionSchemas) Create

func (d *DefinitionSchemas) Create() error

func (*DefinitionSchemas) Creator

func (d *DefinitionSchemas) Creator() string

func (*DefinitionSchemas) Delete

func (d *DefinitionSchemas) Delete() error

func (*DefinitionSchemas) Deleter

func (d *DefinitionSchemas) Deleter() string

func (*DefinitionSchemas) Get

func (d *DefinitionSchemas) Get() error

func (*DefinitionSchemas) List

func (d *DefinitionSchemas) List() ([]DefinitionSchemas, error)

func (*DefinitionSchemas) Save

func (d *DefinitionSchemas) Save() error

func (*DefinitionSchemas) UpdateContent

func (d *DefinitionSchemas) UpdateContent(must bool, name, desc, schema string, updatedBy uint) error

func (*DefinitionSchemas) Updater

func (d *DefinitionSchemas) Updater() string

type GlobalParameters

type GlobalParameters struct {
	ID        uint   `gorm:"type:bigint;primaryKey;autoIncrement"`
	ProjectID uint   `gorm:"type:bigint;index;not null;comment:项目id"`
	In        string `gorm:"type:varchar(255);not null;comment:位置:header,cookie,query,path"`
	Name      string `gorm:"type:varchar(255);not null;comment:参数名称"`
	Required  int    `gorm:"type:tinyint(1);not null;comment:是否必传:0-否,1-是"`
	Schema    string `gorm:"type:mediumtext;comment:参数内容"`
	CreatedAt time.Time
	UpdatedAt time.Time
}

func NewGlobalParameters

func NewGlobalParameters(ids ...uint) (*GlobalParameters, error)

func (*GlobalParameters) Create

func (gp *GlobalParameters) Create() error

func (*GlobalParameters) Delete

func (gp *GlobalParameters) Delete() error

func (*GlobalParameters) GetCountByName

func (gp *GlobalParameters) GetCountByName() (int64, error)

func (*GlobalParameters) GetCountExcludeTheID

func (gp *GlobalParameters) GetCountExcludeTheID() (int64, error)

func (*GlobalParameters) List

func (gp *GlobalParameters) List() ([]*GlobalParameters, error)

func (*GlobalParameters) Update

func (gp *GlobalParameters) Update() error

type IdToNameMap

type IdToNameMap map[uint]string

type IterationApis

type IterationApis struct {
	ID             uint   `gorm:"type:bigint;primaryKey;autoIncrement"`
	IterationID    uint   `gorm:"type:bigint;index;not null;comment:迭代id"`
	CollectionID   uint   `gorm:"type:bigint;not null;comment:集合id"`
	CollectionType string `gorm:"type:varchar(255);not null;comment:集合类型:category,doc,http"`
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

func NewIterationApis

func NewIterationApis(ids ...uint) (*IterationApis, error)

func (*IterationApis) Create

func (ia *IterationApis) Create() error

func (*IterationApis) Delete

func (ia *IterationApis) Delete() error

func (*IterationApis) GetCollectionIDByIterationID

func (ia *IterationApis) GetCollectionIDByIterationID(iID uint) ([]uint, error)

func (*IterationApis) List

func (ia *IterationApis) List(iID ...uint) ([]*IterationApis, error)

type Iterations

type Iterations struct {
	ID          uint   `gorm:"type:bigint;primaryKey;autoIncrement"`
	PublicID    string `gorm:"type:varchar(255);index;not null;comment:迭代公开id"`
	ProjectID   uint   `gorm:"type:bigint;not null;comment:项目id"`
	Title       string `gorm:"type:varchar(255);not null;comment:迭代标题"`
	Description string `gorm:"type:varchar(255);comment:迭代描述"`
	CreatedAt   time.Time
	CreatedBy   uint `gorm:"type:bigint;not null;default:0;comment:创建人id"`
	UpdatedAt   time.Time
	UpdatedBy   uint `gorm:"type:bigint;not null;default:0;comment:最后更新人id"`
	DeletedAt   gorm.DeletedAt
	DeletedBy   uint `gorm:"type:bigint;not null;default:0;comment:删除人id"`
}

func NewIterations

func NewIterations(ids ...any) (*Iterations, error)

func (*Iterations) Create

func (i *Iterations) Create() error

func (*Iterations) Creator

func (i *Iterations) Creator() string

func (*Iterations) Delete

func (i *Iterations) Delete() error

func (*Iterations) Deleter

func (i *Iterations) Deleter() string

func (*Iterations) List

func (i *Iterations) List(page, pageSize int, pIDs ...uint) ([]*Iterations, error)

func (*Iterations) PlanningIterationApi

func (i *Iterations) PlanningIterationApi(cIDs []uint) error

func (*Iterations) Update

func (i *Iterations) Update() error

func (*Iterations) Updater

func (i *Iterations) Updater() string

type ProjectGroups

type ProjectGroups struct {
	ID           uint   `gorm:"type:bigint;primaryKey;autoIncrement"`
	UserID       uint   `gorm:"type:bigint;index;not null;comment:用户id"`
	Name         string `gorm:"type:varchar(255);not null;comment:分组名称"`
	DisplayOrder int    `gorm:"type:int(11);not null;default:0;comment:显示顺序"`
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

func NewProjectGroups

func NewProjectGroups(ids ...uint) (*ProjectGroups, error)

func (*ProjectGroups) Create

func (pg *ProjectGroups) Create() error

func (*ProjectGroups) Delete

func (pg *ProjectGroups) Delete() error

func (*ProjectGroups) List

func (pg *ProjectGroups) List() ([]ProjectGroups, error)

func (*ProjectGroups) Update

func (pg *ProjectGroups) Update() error

type ProjectMembers

type ProjectMembers struct {
	ID         uint   `gorm:"type:bigint;primaryKey;autoIncrement"`
	ProjectID  uint   `gorm:"type:bigint;index;not null;comment:项目id"`
	UserID     uint   `gorm:"type:bigint;index;not null;comment:用户id"`
	GroupID    uint   `gorm:"type:bigint;not null;default:0;comment:分组id"`
	Authority  string `gorm:"type:varchar(255);not null;comment:项目权限:manage,write,read"`
	FollowedAt *time.Time
	CreatedAt  time.Time
	UpdatedAt  time.Time
	DeletedAt  gorm.DeletedAt
}

func GetProjectFollowedByUser

func GetProjectFollowedByUser(UserID uint) ([]ProjectMembers, error)

func GetProjectGroupedByUser

func GetProjectGroupedByUser(UserID, GroupID uint) ([]ProjectMembers, error)

func GetUserInvolvedProject

func GetUserInvolvedProject(UserID uint, PMAuthorities ...string) ([]ProjectMembers, error)

func NewProjectMembers

func NewProjectMembers(ids ...uint) (*ProjectMembers, error)

func (*ProjectMembers) Count

func (pm *ProjectMembers) Count() (int64, error)

func (*ProjectMembers) Create

func (pm *ProjectMembers) Create() error

func (*ProjectMembers) Delete

func (pm *ProjectMembers) Delete() error

func (*ProjectMembers) GetByUserIDAndProjectID

func (pm *ProjectMembers) GetByUserIDAndProjectID() error

func (*ProjectMembers) List

func (pm *ProjectMembers) List(page, pageSize int) ([]ProjectMembers, error)

func (*ProjectMembers) MemberHasWritePermission

func (pm *ProjectMembers) MemberHasWritePermission() bool

func (*ProjectMembers) MemberIsManage

func (pm *ProjectMembers) MemberIsManage() bool

func (*ProjectMembers) Update

func (pm *ProjectMembers) Update() error

type Projects

type Projects struct {
	ID            uint   `gorm:"type:bigint;primaryKey;autoIncrement"`
	PublicId      string `gorm:"type:varchar(255);uniqueIndex;not null;comment:项目公开id"`
	Title         string `gorm:"type:varchar(255);not null;comment:项目名称"`
	Visibility    int    `gorm:"type:tinyint(1);not null;comment:项目可见性:0私有,1公开"`
	SharePassword string `gorm:"type:varchar(255);comment:项目分享密码"`
	Description   string `gorm:"type:varchar(255);comment:项目描述"`
	Cover         string `gorm:"type:varchar(255);comment:项目封面"`
	CreatedAt     time.Time
	UpdatedAt     time.Time
	DeletedAt     gorm.DeletedAt
}

func NewProjects

func NewProjects(ids ...interface{}) (*Projects, error)

func (*Projects) Create

func (p *Projects) Create() error

func (*Projects) Delete

func (p *Projects) Delete() error

func (*Projects) Get

func (p *Projects) Get(id string) error

func (*Projects) List

func (p *Projects) List(ids ...uint) ([]Projects, error)

func (*Projects) Save

func (p *Projects) Save() error

type RefContentVirtualIDToId

type RefContentVirtualIDToId struct {
	DefinitionSchemas    virtualIDToIDMap
	DefinitionResponses  virtualIDToIDMap
	DefinitionParameters virtualIDToIDMap
	GolbalParameters     virtualIDToIDMap
}

type Servers

type Servers struct {
	ID           uint   `gorm:"type:bigint;primaryKey;autoIncrement"`
	ProjectId    uint   `gorm:"type:bigint;index;not null;comment:项目id"`
	Description  string `gorm:"type:varchar(255);not null;comment:描述"`
	Url          string `gorm:"type:varchar(255);not null;comment:服务器地址"`
	DisplayOrder int    `gorm:"type:int(11);not null;default:0;comment:显示顺序"`
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

func NewServers

func NewServers() *Servers

func (*Servers) DeleteAndCreateServers

func (s *Servers) DeleteAndCreateServers(projectID uint, newServers []*Servers) error

func (*Servers) GetByProjectId

func (s *Servers) GetByProjectId(projectID uint) ([]Servers, error)

type ShareTmpTokens

type ShareTmpTokens struct {
	ID           uint      `gorm:"type:bigint;primaryKey;autoIncrement"`
	ShareToken   string    `gorm:"type:varchar(255);index;not null;comment:md5的分享token"`
	Expiration   time.Time `gorm:"type:datetime;not null;comment:过期时间"`
	ProjectID    uint      `gorm:"type:bigint;index;not null;comment:项目id"`
	CollectionID uint      `gorm:"type:bigint;index;comment:集合id"`
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

func NewShareTmpTokens

func NewShareTmpTokens() *ShareTmpTokens

func (*ShareTmpTokens) Create

func (stt *ShareTmpTokens) Create() error

func (*ShareTmpTokens) Delete

func (stt *ShareTmpTokens) Delete() error

func (*ShareTmpTokens) DeleteByCollectionID

func (stt *ShareTmpTokens) DeleteByCollectionID() error

func (*ShareTmpTokens) DeleteByProjectID

func (stt *ShareTmpTokens) DeleteByProjectID() error

func (*ShareTmpTokens) DeleteByProjectIDAndCollectionID

func (stt *ShareTmpTokens) DeleteByProjectIDAndCollectionID() error

func (*ShareTmpTokens) GetByShareToken

func (stt *ShareTmpTokens) GetByShareToken() error

type TagToCollections

type TagToCollections struct {
	ID           uint `gorm:"type:bigint;primaryKey;autoIncrement"`
	TagId        uint `gorm:"type:bigint;index;not null;comment:标签id"`
	CollectionId uint `gorm:"type:bigint;not null;comment:集合id"`
	DisplayOrder int  `gorm:"type:int(11);not null;default:0;comment:显示顺序"`
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

func NewTagToCollections

func NewTagToCollections() *TagToCollections

func (*TagToCollections) Create

func (ttc *TagToCollections) Create() error

type Tags

type Tags struct {
	ID           uint   `gorm:"type:bigint;primaryKey;autoIncrement"`
	ProjectId    uint   `gorm:"type:bigint;index;not null;comment:项目id"`
	Name         string `gorm:"type:varchar(255);not null;comment:名称"`
	DisplayOrder int    `gorm:"type:int(11);not null;default:0;comment:显示顺序"`
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

func GetByName

func GetByName(projectID uint, name string) (*Tags, error)

func NewTags

func NewTags() *Tags

func (*Tags) Create

func (t *Tags) Create() error

type Users

type Users struct {
	ID        uint   `gorm:"type:bigint;primaryKey;autoIncrement"`
	Email     string `gorm:"type:varchar(255);index;not null;comment:邮箱"`
	Username  string `gorm:"type:varchar(255);not null;comment:用户名"`
	Password  string `gorm:"type:varchar(255);not null;comment:密码"`
	Role      string `gorm:"type:varchar(255);not null;comment:角色:superadmin,admin,user"`
	IsEnabled int    `gorm:"type:tinyint(1);not null;default:1;comment:是否启用:0停用,1启用"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt
}

func NewUsers

func NewUsers(ids ...uint) (*Users, error)

func UserListByIDs

func UserListByIDs(ids []uint) ([]*Users, error)

func (*Users) Count

func (u *Users) Count() (int64, error)

func (*Users) Delete

func (u *Users) Delete() error

func (*Users) GetByEmail

func (u *Users) GetByEmail(email string) error

func (*Users) List

func (u *Users) List(page, pageSize int) ([]Users, error)

func (*Users) Save

func (u *Users) Save() error

Jump to

Keyboard shortcuts

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