models

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Deleted Deleted
	Deleted int64 = 1
	// NotDeleted NotDeleted
	NotDeleted int64 = 0
)
View Source
const (
	// CreatingStatus CreatingStatus
	CreatingStatus = -1
	// PrivateStatus PrivateStatus
	PrivateStatus = 0
	// PublicStatus PublicStatus
	PublicStatus = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppCenter

type AppCenter struct {
	ID         string `gorm:"column:id;type:varchar(64);primary_key " json:"id"`
	AppName    string `gorm:"column:app_name;type:varchar(80);" json:"appName"`
	AccessURL  string `gorm:"column:access_url;type:varchar(200);"  json:"accessURL"` //visit url
	AppIcon    string `gorm:"column:app_icon;type:text;"  json:"appIcon"`
	CreateBy   string `gorm:"column:create_by;type:varchar(32);" json:"createBy"`
	UpdateBy   string `gorm:"column:update_by;type:varchar(32);" json:"updateBy"`
	CreateTime int64  `gorm:"column:create_time;type:bigint; " json:"createTime"`
	UpdateTime int64  `gorm:"column:update_time;type:bigint; " json:"updateTime"`
	UseStatus  int    `gorm:"column:use_status;"  json:"useStatus"` //published1,unpublished-1
	Server     int    `gorm:"column:server;" json:"server"`
	DelFlag    int64  `gorm:"column:del_flag;"  json:"delFlag"` //delete marker 0 not deleted 1 deleted
	// The default time is five days after you click delete.
	// If you click delete in the recycle bin, the delete time changes to the current time
	DeleteTime  int64     `gorm:"column:delete_time;type:bigint; " json:"deleteTime"` //default remove
	AppSign     string    `gorm:"column:app_sign" json:"appSign"`
	Description string    `gorm:"column:description" json:"description"`
	Extension   Extension `gorm:"column:extension"`
}

AppCenter AppCenter

func (AppCenter) TableName

func (AppCenter) TableName() string

TableName get the table name

type AppRepo

type AppRepo interface {
	SelectByPage(userID, name string, status, page, limit int, isAdmin bool, db *gorm.DB) ([]AppCenter, int64)
	SelectByID(ID string, db *gorm.DB) *AppCenter
	SelectByName(Name string, db *gorm.DB) *AppCenter
	Insert(app *AppCenter, tx *gorm.DB) error
	Update(app *AppCenter, tx *gorm.DB) error
	Delete(id string, tx *gorm.DB) error
	GetByIDs(tx *gorm.DB, ids ...string) ([]*AppCenter, error)
	UpdateDelFlag(db *gorm.DB, id string, deleteTime int64) error
	GetDeleteList(db *gorm.DB, deleteTime int64) ([]*AppCenter, error)
	SelectByAppSign(db *gorm.DB, appSign string) *AppCenter
	SelectByStatus(db *gorm.DB, status int, page, limit int) (list []AppCenter, total int64)
}

AppRepo AppRepo

type AppScope

type AppScope struct {
	AppID   string `gorm:"column:app_id;type:varchar(64)"`
	ScopeID string `gorm:"column:scope_id;type:varchar(64)"`
}

AppScope AppScope

type AppScopeRepo

type AppScopeRepo interface {
	AppUserDep(db *gorm.DB, appID string, scopes []string) error
	DeleteByID(db *gorm.DB, appID string) error
	GetByScope(db *gorm.DB, userID, depID string) ([]string, error)
	GetAppByUserID(db *gorm.DB, appID string, userID, depID string) (int64, error)
}

AppScopeRepo AppScopeRepo

type AppTemplate

type AppTemplate struct {
	ID          string `gorm:"column:id;type:varchar(64);primary_key;"`
	Name        string `gorm:"column:name;type:varchar(80);"`
	AppIcon     string `gorm:"column:app_icon;type:text;"`
	Path        string `gorm:"column:path;type:varchar(200);"`
	SourceID    string `gorm:"column:source_id;type:varchar(64);"`
	SourceName  string `gorm:"column:source_name;type:varchar(80);"`
	Version     string `gorm:"column:version;type:varchar(64);"`
	GroupID     string `gorm:"column:group_id;type:varchar(64);"`
	CreatedBy   string `gorm:"column:created_by;type:varchar(64);"`
	CreatedName string `gorm:"column:created_name;type:varchar(64);"`
	CreatedTime int64  `gorm:"column:created_time;type:bigint;"`
	UpdatedBy   string `gorm:"column:updated_by;type:varchar(64);"`
	UpdatedName string `gorm:"column:updated_name;type:varchar(64);"`
	UpdatedTime int64  `gorm:"column:updated_time;type:bigint;"`
	Status      int    `gorm:"column:status;type:int;"`
}

AppTemplate Template models

type AppTemplateRepo

type AppTemplateRepo interface {
	Create(ctx context.Context, tx *gorm.DB, template AppTemplate) error
	Update(ctx context.Context, tx *gorm.DB, template *AppTemplate) error
	SelectByPage(ctx context.Context, db *gorm.DB, name string, status int, page *page2.Page) ([]AppTemplate, int64, error)
	SelectByID(ctx context.Context, db *gorm.DB, id string) (*AppTemplate, error)
	SelectByUser(ctx context.Context, db *gorm.DB, name, userID string) ([]AppTemplate, int64, error)
	ModifyStatus(ctx context.Context, tx *gorm.DB, id string, status int) error
	Delete(ctx context.Context, tx *gorm.DB, id string) error
	SelectByName(ctx context.Context, db *gorm.DB, name string) (*AppTemplate, error)
}

AppTemplateRepo AppTemplateRepo

type AppUseRelation

type AppUseRelation struct {
	UserID string `gorm:"column:user_id;type:varchar(64);" json:"userId"`
	AppID  string `gorm:"column:app_id;type:varchar(64);" json:"appId"`
}

AppUseRelation AppUseRelation

func (AppUseRelation) TableName

func (AppUseRelation) TableName() string

TableName TableName

type AppUserRelationRepo

type AppUserRelationRepo interface {
	Add(rq *AppUseRelation, tx *gorm.DB) (err error)
	DeleteByUserIDAndAppID(appID string, userIDs []string, tx *gorm.DB) (err error)
	DeleteByAppID(appID string, tx *gorm.DB) (err error)
	SelectByAppID(appID string, tx *gorm.DB) (list []AppUseRelation)
	CountByAppIDAndUserID(appID, userID string, db *gorm.DB) int64
	SelectByAppIDBPage(appID string, page, limit int, tx *gorm.DB) (list []AppUseRelation, total int64)
}

AppUserRelationRepo AppUserRelationRepo

type AppUserVO

type AppUserVO struct {
	AppID string `json:"appID"`
	Scope string `json:"scope"`
}

AppUserVO AppUserVO

type Extension added in v1.1.0

type Extension map[string]interface{}

Extension Extension

func (*Extension) Scan added in v1.1.0

func (e *Extension) Scan(data interface{}) error

Scan Scan

func (Extension) Value added in v1.1.0

func (e Extension) Value() (driver.Value, error)

Value Value

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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