relationDB

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(c conf.Database) error

Types

type ExampleFilter

type ExampleFilter struct {
}

type ExampleRepo

type ExampleRepo struct {
	// contains filtered or unexported fields
}

func NewExampleRepo

func NewExampleRepo(in any) *ExampleRepo

func (ExampleRepo) CountByFilter

func (p ExampleRepo) CountByFilter(ctx context.Context, f ExampleFilter) (size int64, err error)

func (ExampleRepo) Delete

func (p ExampleRepo) Delete(ctx context.Context, id int64) error

func (ExampleRepo) DeleteByFilter

func (p ExampleRepo) DeleteByFilter(ctx context.Context, f ExampleFilter) error

func (ExampleRepo) FindByFilter

func (p ExampleRepo) FindByFilter(ctx context.Context, f ExampleFilter, page *stores.PageInfo) ([]*ViewExample, error)

func (ExampleRepo) FindOne

func (p ExampleRepo) FindOne(ctx context.Context, id int64) (*ViewExample, error)

func (ExampleRepo) FindOneByFilter

func (p ExampleRepo) FindOneByFilter(ctx context.Context, f ExampleFilter) (*ViewExample, error)

func (ExampleRepo) Insert

func (p ExampleRepo) Insert(ctx context.Context, data *ViewExample) error

func (ExampleRepo) MultiInsert

func (p ExampleRepo) MultiInsert(ctx context.Context, data []*ViewExample) error

批量插入 LightStrategyDevice 记录

func (ExampleRepo) Update

func (p ExampleRepo) Update(ctx context.Context, data *ViewExample) error

type ProjectDetailFilter

type ProjectDetailFilter struct {
}

type ProjectDetailRepo

type ProjectDetailRepo struct {
	// contains filtered or unexported fields
}

func NewProjectDetailRepo

func NewProjectDetailRepo(in any) *ProjectDetailRepo

func (ProjectDetailRepo) CountByFilter

func (p ProjectDetailRepo) CountByFilter(ctx context.Context, f ProjectDetailFilter) (size int64, err error)

func (ProjectDetailRepo) Delete

func (p ProjectDetailRepo) Delete(ctx context.Context, id int64) error

func (ProjectDetailRepo) DeleteByFilter

func (p ProjectDetailRepo) DeleteByFilter(ctx context.Context, f ProjectDetailFilter) error

func (ProjectDetailRepo) FindByFilter

func (ProjectDetailRepo) FindOne

func (ProjectDetailRepo) FindOneByFilter

func (ProjectDetailRepo) Insert

func (ProjectDetailRepo) MultiInsert

func (p ProjectDetailRepo) MultiInsert(ctx context.Context, data []*ViewProjectDetail) error

批量插入 LightStrategyDevice 记录

func (ProjectDetailRepo) Update

type ProjectInfoFilter

type ProjectInfoFilter struct {
}

type ProjectInfoRepo

type ProjectInfoRepo struct {
	// contains filtered or unexported fields
}

func NewProjectInfoRepo

func NewProjectInfoRepo(in any) *ProjectInfoRepo

func (ProjectInfoRepo) CountByFilter

func (p ProjectInfoRepo) CountByFilter(ctx context.Context, f ProjectInfoFilter) (size int64, err error)

func (ProjectInfoRepo) Delete

func (p ProjectInfoRepo) Delete(ctx context.Context, id int64) error

func (ProjectInfoRepo) DeleteByFilter

func (p ProjectInfoRepo) DeleteByFilter(ctx context.Context, f ProjectInfoFilter) error

func (ProjectInfoRepo) FindByFilter

func (ProjectInfoRepo) FindOne

func (p ProjectInfoRepo) FindOne(ctx context.Context, id int64) (*ViewProjectInfo, error)

func (ProjectInfoRepo) FindOneByFilter

func (p ProjectInfoRepo) FindOneByFilter(ctx context.Context, f ProjectInfoFilter) (*ViewProjectInfo, error)

func (ProjectInfoRepo) Insert

func (p ProjectInfoRepo) Insert(ctx context.Context, data *ViewProjectInfo) error

func (ProjectInfoRepo) MultiInsert

func (p ProjectInfoRepo) MultiInsert(ctx context.Context, data []*ViewProjectInfo) error

批量插入 LightStrategyDevice 记录

func (ProjectInfoRepo) Update

func (p ProjectInfoRepo) Update(ctx context.Context, data *ViewProjectInfo) error

type ViewExample

type ViewExample struct {
	ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` // id编号
}

示例

type ViewProjectDetail

type ViewProjectDetail struct {
	ID        int64  `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` // id编号
	Content   string `gorm:"column:content;type:text"`                         //项目参数
	ProjectID int64  `gorm:"column:project_id;type:bigint;NOT NULL"`           //所属项目ID(雪花ID)
	stores.NoDelTime
	DeletedTime stores.DeletedTime `gorm:"column:deleted_time;default:0;index"`
}

type ViewProjectInfo

type ViewProjectInfo struct {
	ID int64 `gorm:"column:id;type:bigint;primary_key;AUTO_INCREMENT"` // id编号
	//TenantCode    stores.TenantCode `gorm:"column:tenant_code;uniqueIndex:ri_mi;type:VARCHAR(50);NOT NULL"` // 租户编码
	//ProjectID     stores.ProjectID  `gorm:"column:projectID;type:bigint;NOT NULL"`                          // 所属项目ID(雪花ID)
	IndexImage    string `gorm:"column:index_image;type:varchar(200)"`        //图片地址
	Name          string `gorm:"column:name;type:varchar(50)"`                //项目名称
	Desc          string `gorm:"column:desc;type:varchar(200)"`               //项目描述
	CreatedUserID int64  `gorm:"column:created_user_id;type:bigint;NOT NULL"` //创建者id
	Status        int64  `gorm:"column:status;type:SMALLINT;default:1"`       //项目状态 1: 已发布 2: 未发布
	stores.NoDelTime
	DeletedTime stores.DeletedTime `gorm:"column:deleted_time;default:0;index"`
	Detail      *ViewProjectDetail `gorm:"foreignKey:ProjectID;references:ID"`
}

Jump to

Keyboard shortcuts

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