table

package
v0.0.0-...-121767f Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CurrentWorkspace *table.TblWorkspace

Functions

func AddApp

func AddApp(ctx context.Context, appInfo *table.TblAppInfo) error

func AddCollectTable

func AddCollectTable(ctx context.Context, userid uint64, tableID int) error

func AddDB

func AddDB(ctx context.Context, db *obj.TblDB) (int, error)

func AddPlugin

func AddPlugin(ctx context.Context, plugin *table.TblPlugin) (int, error)

func AddProduct

func AddProduct(ctx context.Context, product *TblProduct) (int, error)

func AddSearchKeyword

func AddSearchKeyword(ctx context.Context, sk *TblSearchKeyword)

func AddSearchKeywords

func AddSearchKeywords(ctx context.Context, sks []*TblSearchKeyword)

func AddTable

func AddTable(ctx context.Context, tb *obj.TblTable) (int, error)

func DelCollectTable

func DelCollectTable(ctx context.Context, userid uint64, tableID int) error

func DelPluginConfigByKey

func DelPluginConfigByKey(ctx context.Context, pluginID, version int, key string) error

func DelSearchKeywords

func DelSearchKeywords(ctx context.Context, typ int8, sid int, field, skey string)

func DelTablePlugin

func DelTablePlugin(ctx context.Context, id int) error

func GetAppAccessDB

func GetAppAccessDB(ctx context.Context, appid uint64, db int) (bool, *table.TblAccessDB, error)

func GetAppAccessDBListByAppid

func GetAppAccessDBListByAppid(ctx context.Context, appid uint64, page, size int) (*proto.Detail, []*table.TblAccessDB, error)

func GetAppAccessDBListByDBID

func GetAppAccessDBListByDBID(ctx context.Context, db, page, size int) (*proto.Detail, []*table.TblAccessDB, error)

func GetAppAccessDBs

func GetAppAccessDBs(ctx context.Context, appids []uint64, db int) ([]*table.TblAccessDB, error)

func GetAppAccessDBsPages

func GetAppAccessDBsPages(ctx context.Context, appids []uint64,
	db int, page, size int) (*proto.Detail, []*table.TblAccessDB, error)

func GetAppAccessTable

func GetAppAccessTable(ctx context.Context, appid uint64, tableID int) (bool, *table.TblAccessTable, error)

func GetAppAccessTableListByAppid

func GetAppAccessTableListByAppid(ctx context.Context,
	appid uint64, page, size int) (*proto.Detail, []*table.TblAccessTable, error)

func GetAppAccessTableListByTableID

func GetAppAccessTableListByTableID(ctx context.Context,
	tableID, page, size int) (*proto.Detail, []*table.TblAccessTable, error)

func GetAppAccessTables

func GetAppAccessTables(ctx context.Context, appids []uint64, tableID int) ([]*table.TblAccessTable, error)

func GetAppAccessTablesPages

func GetAppAccessTablesPages(ctx context.Context, appids []uint64,
	tableID int, page, size int) (*proto.Detail, []*table.TblAccessTable, error)

func GetAppDetail

func GetAppDetail(ctx context.Context, appid uint64) (bool, *table.TblAppInfo, error)

func GetAppList

func GetAppList(ctx context.Context, userid uint64, page, size int) (*proto.Detail, []*table.TblAppInfo, error)

func GetAppListByAppids

func GetAppListByAppids(ctx context.Context, appids []uint64) ([]*table.TblAppInfo, error)

func GetCollectTablesID

func GetCollectTablesID(collectTables []*TblCollectTable) []int

func GetConfigsByPluginIDVersions

func GetConfigsByPluginIDVersions(ctx context.Context, idVersions ...int) ([]*table.TblPluginConfig, error)

func GetCurrentWorkspace

func GetCurrentWorkspace(ctx context.Context) (*table.TblWorkspace, error)

func GetDBByID

func GetDBByID(ctx context.Context, id int) (bool, *obj.TblDB, error)

func GetDBByIds

func GetDBByIds(ctx context.Context, ids []int) ([]*obj.TblDB, error)

func GetDBTables

func GetDBTables(ctx context.Context, dbID int) ([]*obj.TblTable, error)

func GetIndexTable

func GetIndexTable(ctx context.Context, page, size int) (*proto.Detail, []*obj.TblTable, error)

func GetMyAppListByKeyword

func GetMyAppListByKeyword(ctx context.Context, userid uint64,
	keyword string, status int8) ([]*table.TblAppInfo, error)

func GetPluginByID

func GetPluginByID(ctx context.Context, pluginID int) (bool, *table.TblPlugin, error)

func GetPluginByIDs

func GetPluginByIDs(ctx context.Context, pluginIDs []int) ([]*table.TblPlugin, error)

func GetPluginConfigs

func GetPluginConfigs(ctx context.Context, pluginID, version int) ([]*table.TblPluginConfig, error)

func GetPluginList

func GetPluginList(ctx context.Context, page, size int) (*proto.Detail, []*table.TblPlugin, error)

func GetProductDBs

func GetProductDBs(ctx context.Context, productID int) ([]*obj.TblDB, error)

func GetSequence

func GetSequence(ctx context.Context) (uint64, error)

func GetTableBackPlugin

func GetTableBackPlugin(ctx context.Context, tableID int, typ int8, frontID int) ([]*table.TblTablePlugin, error)

func GetTableByID

func GetTableByID(ctx context.Context, id int) (bool, *obj.TblTable, error)

func GetTableByIds

func GetTableByIds(ctx context.Context, ids []int) ([]*obj.TblTable, error)

func GetTableORM

func GetTableORM(table string) *orm.ORM

GetTableORM 获取经校验后的 ORM

func GetTablePluginByID

func GetTablePluginByID(ctx context.Context, id int) (bool, *table.TblTablePlugin, error)

func GetTablePlugins

func GetTablePlugins(ctx context.Context, tableID int, typ ...int8) ([]*table.TblTablePlugin, error)

func GetUserBaseFromUser

func GetUserBaseFromUser(user *TblUser) *pb.UsersBase

func GetUserBasesByIds

func GetUserBasesByIds(ctx context.Context, userIds []uint64) ([]*pb.UsersBase, error)

func GetUserBasesMapByIds

func GetUserBasesMapByIds(ctx context.Context, userIds []uint64) (map[uint64]*pb.UsersBase, error)

func GetWorkspace

func GetWorkspace(ctx context.Context, workspace string) (*table.TblWorkspace, error)

func GetWorkspaceByID

func GetWorkspaceByID(ctx context.Context, id int) (*table.TblWorkspace, error)

func InsertAccessDB

func InsertAccessDB(ctx context.Context, accessDB *table.TblAccessDB) (int, error)

func InsertAccessTable

func InsertAccessTable(ctx context.Context, accessTable *table.TblAccessTable) (int, error)

func InsertProductMember

func InsertProductMember(ctx context.Context, member *TblProductMember) (int, error)

func InsertTablePlugin

func InsertTablePlugin(ctx context.Context, tablePlugin *table.TblTablePlugin) (int, error)

func InsertUser

func InsertUser(ctx context.Context, user *TblUser) error

func InsertWorkspaceMember

func InsertWorkspaceMember(ctx context.Context, member *TblWorkspaceMember) error

func ReplacePluginConfig

func ReplacePluginConfig(ctx context.Context, pluginConfig *table.TblPluginConfig) error

func ReplaceProductMember

func ReplaceProductMember(ctx context.Context, member horm.Map) error

func ReplaceWorkspaceMember

func ReplaceWorkspaceMember(ctx context.Context, member horm.Map) error

func TablesToMap

func TablesToMap(tables []*obj.TblTable) map[int]*obj.TblTable

func UpdateAccessDBByID

func UpdateAccessDBByID(ctx context.Context, id int, update horm.Map) error

func UpdateAccessTableByID

func UpdateAccessTableByID(ctx context.Context, id int, update horm.Map) error

func UpdateAppByID

func UpdateAppByID(ctx context.Context, appid uint64, update horm.Map) error

func UpdateDBByID

func UpdateDBByID(ctx context.Context, id int, update horm.Map) error

func UpdatePluginByID

func UpdatePluginByID(ctx context.Context, id int, update horm.Map) error

func UpdateProductByID

func UpdateProductByID(ctx context.Context, id int, update horm.Map) error

func UpdateProductMemberByID

func UpdateProductMemberByID(ctx context.Context, id int, update horm.Map) error

func UpdateTableByID

func UpdateTableByID(ctx context.Context, id int, update horm.Map) error

func UpdateTablePluginByID

func UpdateTablePluginByID(ctx context.Context, id int, update horm.Map) error

func UpdateTablePluginByIDs

func UpdateTablePluginByIDs(ctx context.Context, id []int, update horm.Map) error

func UpdateUserByID

func UpdateUserByID(ctx context.Context, id uint64, updateInfo horm.Map) error

func UpdateWorkspaceByID

func UpdateWorkspaceByID(ctx context.Context, id int, update horm.Map) error

func UpdateWorkspaceMemberByID

func UpdateWorkspaceMemberByID(ctx context.Context, id int, update horm.Map) error

Types

type TblCollectTable

type TblCollectTable struct {
	Id        int       `orm:"id,int,omitempty" json:"id,omitempty"`             // id
	UserID    uint64    `orm:"userid,uint64,omitempty" json:"userid,omitempty"`  // 用户id
	TableID   int       `orm:"table_id,int,omitempty" json:"table_id,omitempty"` // 表id
	CreatedAt time.Time `orm:"created_at,datetime,omitempty" json:"created_at"`  // 记录创建时间
	UpdatedAt time.Time `orm:"updated_at,datetime,omitempty" json:"updated_at"`  // 记录最后修改时间
}

func GetCollectTable

func GetCollectTable(ctx context.Context, userid uint64, page, size int) (*proto.Detail, []*TblCollectTable, error)

type TblProduct

type TblProduct struct {
	Id        int       `orm:"id,int,omitempty" json:"id,omitempty"`              // id
	Name      string    `orm:"name,string,omitempty" json:"name,omitempty"`       // 产品名称
	Intro     string    `orm:"intro,string,omitempty" json:"intro,omitempty"`     // 简介
	Creator   uint64    `orm:"creator,uint64,omitempty" json:"creator,omitempty"` // Creator
	Manager   string    `orm:"manager,string,omitempty" json:"manager,omitempty"` // 管理员,多个逗号分隔
	Status    int8      `orm:"status,int8,omitempty" json:"status,omitempty"`     // 1-正常 2-下线
	CreatedAt time.Time `orm:"created_at,datetime,omitempty" json:"created_at"`   // 记录创建时间
	UpdatedAt time.Time `orm:"updated_at,datetime,omitempty" json:"updated_at"`   // 记录最后修改时间
}

func GetProductByID

func GetProductByID(ctx context.Context, id int) (bool, *TblProduct, error)

func GetProductList

func GetProductList(ctx context.Context, status int8, page, size int) (*proto.Detail, []*TblProduct, error)

type TblProductMember

type TblProductMember struct {
	Id         int       `orm:"id,int,omitempty" json:"id,omitempty"`                    // member id
	ProductID  int       `orm:"product_id,int,omitempty" json:"product_id,omitempty"`    // product id
	UserID     uint64    `orm:"userid,uint64,omitempty" json:"userid,omitempty"`         // 用户id
	Role       int8      `orm:"role,int8,omitempty" json:"role,omitempty"`               // 1-管理员 2-开发者 3-运营者
	Status     int8      `orm:"status,int8,omitempty" json:"status,omitempty"`           // 1-待审批 2-续期审批 3-角色变更审批 4-已加入 5-审批拒绝  6-已退出
	JoinTime   int64     `orm:"join_time,int,omitempty" json:"join_time,omitempty"`      // 加入时间
	ExpireType int8      `orm:"expire_type,int8,omitempty" json:"expire_type,omitempty"` // 0: 永久 1: 一个月 2: 三个月 3: 半年 4: 一年
	ExpireTime int       `orm:"expire_time,int,omitempty" json:"expire_time,omitempty"`  // 过期时间
	OutTime    int       `orm:"out_time,int,omitempty" json:"out_time,omitempty"`        // 退出时间
	ChangeRole int8      `orm:"change_role,int8,omitempty" json:"change_role,omitempty"` // 变更为目标角色 0-无 2-开发者 3-运营者
	CreatedAt  time.Time `orm:"created_at,datetime,omitempty" json:"created_at"`         // 记录创建时间
	UpdatedAt  time.Time `orm:"updated_at,datetime,omitempty" json:"updated_at"`         // 记录最后修改时间
}

func GetProductMemberByUser

func GetProductMemberByUser(ctx context.Context, productID int, userid uint64) (bool, *TblProductMember, error)

func GetProductMemberByUsers

func GetProductMemberByUsers(ctx context.Context, productID int, userIds []uint64) ([]*TblProductMember, error)

func GetProductMembersAll

func GetProductMembersAll(ctx context.Context,
	productID, page, size int) (*proto.Detail, []*TblProductMember, error)

func GetProductMembersJoined

func GetProductMembersJoined(ctx context.Context,
	productID, page, size int) (*proto.Detail, []*TblProductMember, error)

type TblSearchKeyword

type TblSearchKeyword struct {
	Id        int       `orm:"id,int,omitempty" json:"id,omitempty"`                // id
	Type      int8      `orm:"type,int8,omitempty" json:"type,omitempty"`           // 1-product 2-db 3-table
	Sid       int       `orm:"sid,int,omitempty" json:"sid,omitempty"`              // 检索id
	SName     string    `orm:"sname,string,omitempty" json:"sname,omitempty"`       // 检索名
	Field     string    `orm:"field,string,omitempty" json:"field,omitempty"`       // 字段
	SKey      string    `orm:"skey,string,omitempty" json:"skey,omitempty"`         // 检索key
	SContent  string    `orm:"scontent,string,omitempty" json:"scontent,omitempty"` // 检索内容
	CreatedAt time.Time `orm:"created_at,datetime,omitempty" json:"created_at"`     // 记录创建时间
	UpdatedAt time.Time `orm:"updated_at,datetime,omitempty" json:"updated_at"`     // 记录最后修改时间
}

type TblUser

type TblUser struct {
	Id            uint64    `orm:"id,uint64,omitempty" json:"id,omitempty"`                        // 用户id
	Account       string    `orm:"account,string,omitempty" json:"account,omitempty"`              // 账号,可以是 admin,邮箱等。。。
	Password      string    `orm:"password,string,omitempty" json:"password,omitempty"`            // 密码
	Nickname      string    `orm:"nickname,string,omitempty" json:"nickname,omitempty"`            // 昵称
	Mobile        string    `orm:"mobile,string,omitempty" json:"mobile,omitempty"`                // 手机号
	Token         string    `orm:"token,string,omitempty" json:"token,omitempty"`                  // token
	AvatarUrl     string    `orm:"avatar_url,string,omitempty" json:"avatar_url,omitempty"`        // 头像
	Gender        int8      `orm:"gender,int,omitempty" json:"gender,omitempty"`                   // 性别 1-男  2-女
	Company       string    `orm:"company,string,omitempty" json:"company,omitempty"`              // 公司
	Department    string    `orm:"department,string,omitempty" json:"department,omitempty"`        // 部门
	City          string    `orm:"city,string,omitempty" json:"city,omitempty"`                    // 城市
	Province      string    `orm:"province,string,omitempty" json:"province,omitempty"`            // 省份
	Country       string    `orm:"country,string,omitempty" json:"country,omitempty"`              // 国家
	LastLoginTime int       `orm:"last_login_time,int,omitempty" json:"last_login_time,omitempty"` // 上次登录时间
	LastLoginIP   string    `orm:"last_login_ip,string,omitempty" json:"last_login_ip,omitempty"`  // 上次登录ip
	CreatedAt     time.Time `orm:"created_at,datetime,omitempty" json:"created_at"`                // 记录创建时间
	UpdatedAt     time.Time `orm:"updated_at,datetime,omitempty" json:"updated_at"`                // 记录最后修改时间
}

func GetUserByAccount

func GetUserByAccount(ctx context.Context, account string) (bool, *TblUser, error)

func GetUserByID

func GetUserByID(ctx context.Context, id uint64) (bool, *TblUser, error)

func GetUsersByKeyword

func GetUsersByKeyword(ctx context.Context, keyword string) ([]*TblUser, error)

type TblWorkspaceMember

type TblWorkspaceMember struct {
	Id          int       `orm:"id,int,omitempty" json:"id,omitempty"`                     // member id
	WorkspaceID int       `orm:"workspace_id,int,omitempty" json:"workspace_id,omitempty"` // workspace id
	UserID      uint64    `orm:"userid,uint64,omitempty" json:"userid,omitempty"`          // 用户id
	Status      int8      `orm:"status,int8,omitempty" json:"status,omitempty"`            // 1-待审批 2-续期审批 3-暂未申请 4-已加入 5-审批拒绝  6-已退出
	JoinTime    int64     `orm:"join_time,int,omitempty" json:"join_time,omitempty"`       // 加入时间
	ExpireType  int8      `orm:"expire_type,int8,omitempty" json:"expire_type,omitempty"`  // 0: 永久 1: 一个月 2: 三个月 3: 半年 4: 一年
	ExpireTime  int       `orm:"expire_time,int,omitempty" json:"expire_time,omitempty"`   // 过期时间
	OutTime     int       `orm:"out_time,int,omitempty" json:"out_time,omitempty"`         // 退出时间
	CreatedAt   time.Time `orm:"created_at,datetime,omitempty" json:"created_at"`          // 记录创建时间
	UpdatedAt   time.Time `orm:"updated_at,datetime,omitempty" json:"updated_at"`          // 记录最后修改时间
}

func GetWorkspaceMemberByUser

func GetWorkspaceMemberByUser(ctx context.Context, workspaceID int, userid uint64) (bool, *TblWorkspaceMember, error)

func GetWorkspaceMemberByUsers

func GetWorkspaceMemberByUsers(ctx context.Context, workspaceID int, userIds []uint64) ([]*TblWorkspaceMember, error)

func GetWorkspaceMembersAll

func GetWorkspaceMembersAll(ctx context.Context,
	workspaceID, page, size int) (*proto.Detail, []*TblWorkspaceMember, error)

func GetWorkspaceMembersJoined

func GetWorkspaceMembersJoined(ctx context.Context,
	workspaceID, page, size int) (*proto.Detail, []*TblWorkspaceMember, error)

Jump to

Keyboard shortcuts

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