Documentation ¶
Index ¶
- func InitDb()
- func RegisterDb()
- type Common
- func (this *Common) GenerateEmailVerfiy(account_id int64) (m *models.AccountEmailVerify)
- func (this *Common) GetAccount(id interface{}) (m *models.Account)
- func (this *Common) GetAccountByEmail(email string) (m *models.Account)
- func (this *Common) GetAccountByName(username string) (m *models.Account)
- func (this *Common) GetAccountByNameOrEmail(nameOrEmail string) *models.Account
- func (this *Common) GetEmailVerfiy(code string, username string) (m *models.AccountEmailVerify)
- type Model
- type Platform
- func (this *Platform) FindByOwnerPublic(owner_id int64) (m []*models.Project)
- func (this *Platform) FindCallback(project_id int64) (m []*models.Callback)
- func (this *Platform) FindChannel(project_id int64) (m []*models.Channel)
- func (this *Platform) FindFilter(project_id int64) (m []*models.Filter)
- func (this *Platform) FindProjectByOwner(owner_id int64) (m []*models.Project)
- func (this *Platform) FindProjectUserActivity(project_id int64) (m []*models.UserActivity)
- func (this *Platform) FindResource(project_id int64) (m []*models.Resource)
- func (this *Platform) FindSource(project_id int64) (m []*models.Source)
- func (this *Platform) FindTarget(project_id int64) (m []*models.Target)
- func (this *Platform) FindUserActivity(user_id int64) (m []*models.UserActivity)
- func (this *Platform) FindUserActivityWithUser(user_id, project_id int64) (m []*models.UserActivity)
- func (this *Platform) GetAccess(user_id int64, project_id int64) (m *models.ProjectAccess)
- func (this *Platform) GetCallback(url string, project_id int64) (m *models.Callback)
- func (this *Platform) GetChannel(name string, project_id int64) (m *models.Channel)
- func (this *Platform) GetFilter(name string, project_id int64) (m *models.Filter)
- func (this *Platform) GetProject(username, projectName string) (m *models.Project)
- func (this *Platform) GetResource(name string, project_id int64) (m *models.Resource)
- func (this *Platform) GetResourceFile(resource *models.Resource) io.ReadCloser
- func (this *Platform) GetSource(name string, project_id int64) (m *models.Source)
- func (this *Platform) GetTarget(name string, project_id int64) (m *models.Target)
- func (this *Platform) GetUser(id interface{}) (m *models.PlatformUser)
- func (this *Platform) GetUserActivity(id int64) (m *models.UserActivity)
- func (this *Platform) GetUserByAccount(account_id interface{}) (m *models.PlatformUser)
- func (this *Platform) GetUserByUsername(username string) (m *models.PlatformUser)
- func (this *Platform) PutAndStoneResource(resource *models.Resource, r multipart.File)
- type QbsRepository
- func (this *QbsRepository) Close() error
- func (this *QbsRepository) Count(structPtr Model, v *int64, key string, value interface{}) Repository
- func (this *QbsRepository) Delete(structPtr Model) Repository
- func (this *QbsRepository) Find(structPtr Model, key string, value interface{}) Repository
- func (this *QbsRepository) FindN(structPtr Model, n int, kvs ...interface{}) Repository
- func (this *QbsRepository) Get(structPtr Model, key string, value interface{}) Repository
- func (this *QbsRepository) GetN(structPtr Model, kvs ...interface{}) Repository
- func (this *QbsRepository) GetNRef(structPtrPtr Model, kvs ...interface{}) Repository
- func (this *QbsRepository) GetRef(structPtrPtr Model, key string, value interface{}) Repository
- func (this *QbsRepository) Put(structPtr Model) Repository
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Common ¶
type Common struct{ *QbsRepository }
func CommonRepo ¶
func CommonRepo(q ...*QbsRepository) *Common
func (*Common) GenerateEmailVerfiy ¶
func (this *Common) GenerateEmailVerfiy(account_id int64) (m *models.AccountEmailVerify)
获取Email验证
func (*Common) GetAccountByEmail ¶
聚集索引
func (*Common) GetAccountByName ¶
聚集索引
func (*Common) GetAccountByNameOrEmail ¶
自动获取
func (*Common) GetEmailVerfiy ¶
func (this *Common) GetEmailVerfiy(code string, username string) (m *models.AccountEmailVerify)
验证Email验证
type Platform ¶
type Platform struct{ *QbsRepository }
多对一关联Account
func PlatformRepo ¶
func PlatformRepo(q ...*QbsRepository) *Platform
func (*Platform) FindByOwnerPublic ¶
列出用户所有项目
func (*Platform) FindCallback ¶
列出项目所有Callback
func (*Platform) FindChannel ¶
列出项目所有Channel
func (*Platform) FindFilter ¶
列出项目所有Filter
func (*Platform) FindProjectByOwner ¶
列出用户所有项目
func (*Platform) FindProjectUserActivity ¶
func (this *Platform) FindProjectUserActivity(project_id int64) (m []*models.UserActivity)
列出项目所有UserActivity
func (*Platform) FindResource ¶
列出项目所有资源
func (*Platform) FindSource ¶
列出项目所有Source
func (*Platform) FindTarget ¶
列出项目所有Target
func (*Platform) FindUserActivity ¶
func (this *Platform) FindUserActivity(user_id int64) (m []*models.UserActivity)
列出用户所有UserActivity
func (*Platform) FindUserActivityWithUser ¶
func (this *Platform) FindUserActivityWithUser(user_id, project_id int64) (m []*models.UserActivity)
列出用户项目所有UserActivity
func (*Platform) GetAccess ¶
func (this *Platform) GetAccess(user_id int64, project_id int64) (m *models.ProjectAccess)
或获取特定用户对项目的访问权限
func (*Platform) GetCallback ¶
联合聚集索引
func (*Platform) GetChannel ¶
列出项目所有Channel
func (*Platform) GetProject ¶
url获取
func (*Platform) GetResource ¶
联合聚集索引
func (*Platform) GetResourceFile ¶
func (this *Platform) GetResourceFile(resource *models.Resource) io.ReadCloser
获取文件
func (*Platform) GetUser ¶
func (this *Platform) GetUser(id interface{}) (m *models.PlatformUser)
聚集索引
func (*Platform) GetUserActivity ¶
func (this *Platform) GetUserActivity(id int64) (m *models.UserActivity)
列出用户所有UserActivity
func (*Platform) GetUserByAccount ¶
func (this *Platform) GetUserByAccount(account_id interface{}) (m *models.PlatformUser)
聚集索引
func (*Platform) GetUserByUsername ¶
func (this *Platform) GetUserByUsername(username string) (m *models.PlatformUser)
二级索引 左连接
type QbsRepository ¶
type QbsRepository struct { Repository *qbs.Qbs }
加强代码复用
func (*QbsRepository) Close ¶
func (this *QbsRepository) Close() error
func (*QbsRepository) Count ¶
func (this *QbsRepository) Count(structPtr Model, v *int64, key string, value interface{}) Repository
获取
func (*QbsRepository) Find ¶
func (this *QbsRepository) Find(structPtr Model, key string, value interface{}) Repository
获取
func (*QbsRepository) FindN ¶
func (this *QbsRepository) FindN(structPtr Model, n int, kvs ...interface{}) Repository
多条件获取
func (*QbsRepository) Get ¶
func (this *QbsRepository) Get(structPtr Model, key string, value interface{}) Repository
获取
func (*QbsRepository) GetN ¶
func (this *QbsRepository) GetN(structPtr Model, kvs ...interface{}) Repository
多条件获取
func (*QbsRepository) GetNRef ¶
func (this *QbsRepository) GetNRef(structPtrPtr Model, kvs ...interface{}) Repository
多条件获取
func (*QbsRepository) GetRef ¶
func (this *QbsRepository) GetRef(structPtrPtr Model, key string, value interface{}) Repository
获取
type Repository ¶
type Repository interface { Put(Model) Repository Delete(Model) Repository Get(v Model, key string, value interface{}) Repository GetN(structPtr Model, kvs ...interface{}) Repository Find(v Model, key string, value interface{}) Repository FindN(structPtr Model, n int, kvs ...interface{}) Repository Count(structPtr Model, v *int64, key string, value interface{}) Repository Close() error }
抽象化
Click to show internal directories.
Click to hide internal directories.