repository

package
v0.0.0-...-b23eb34 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2014 License: MPL-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDb

func InitDb()

初始化数据库

func RegisterDb

func RegisterDb()

注册数据库

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) GetAccount

func (this *Common) GetAccount(id interface{}) (m *models.Account)

聚集索引

func (*Common) GetAccountByEmail

func (this *Common) GetAccountByEmail(email string) (m *models.Account)

聚集索引

func (*Common) GetAccountByName

func (this *Common) GetAccountByName(username string) (m *models.Account)

聚集索引

func (*Common) GetAccountByNameOrEmail

func (this *Common) GetAccountByNameOrEmail(nameOrEmail string) *models.Account

自动获取

func (*Common) GetEmailVerfiy

func (this *Common) GetEmailVerfiy(code string, username string) (m *models.AccountEmailVerify)

验证Email验证

type Model

type Model interface{}

type Platform

type Platform struct{ *QbsRepository }

多对一关联Account

func PlatformRepo

func PlatformRepo(q ...*QbsRepository) *Platform

func (*Platform) FindByOwnerPublic

func (this *Platform) FindByOwnerPublic(owner_id int64) (m []*models.Project)

列出用户所有项目

func (*Platform) FindCallback

func (this *Platform) FindCallback(project_id int64) (m []*models.Callback)

列出项目所有Callback

func (*Platform) FindChannel

func (this *Platform) FindChannel(project_id int64) (m []*models.Channel)

列出项目所有Channel

func (*Platform) FindFilter

func (this *Platform) FindFilter(project_id int64) (m []*models.Filter)

列出项目所有Filter

func (*Platform) FindProjectByOwner

func (this *Platform) FindProjectByOwner(owner_id int64) (m []*models.Project)

列出用户所有项目

func (*Platform) FindProjectUserActivity

func (this *Platform) FindProjectUserActivity(project_id int64) (m []*models.UserActivity)

列出项目所有UserActivity

func (*Platform) FindResource

func (this *Platform) FindResource(project_id int64) (m []*models.Resource)

列出项目所有资源

func (*Platform) FindSource

func (this *Platform) FindSource(project_id int64) (m []*models.Source)

列出项目所有Source

func (*Platform) FindTarget

func (this *Platform) FindTarget(project_id int64) (m []*models.Target)

列出项目所有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 (this *Platform) GetCallback(url string, project_id int64) (m *models.Callback)

联合聚集索引

func (*Platform) GetChannel

func (this *Platform) GetChannel(name string, project_id int64) (m *models.Channel)

列出项目所有Channel

func (*Platform) GetFilter

func (this *Platform) GetFilter(name string, project_id int64) (m *models.Filter)

联合聚集索引

func (*Platform) GetProject

func (this *Platform) GetProject(username, projectName string) (m *models.Project)

url获取

func (*Platform) GetResource

func (this *Platform) GetResource(name string, project_id int64) (m *models.Resource)

联合聚集索引

func (*Platform) GetResourceFile

func (this *Platform) GetResourceFile(resource *models.Resource) io.ReadCloser

获取文件

func (*Platform) GetSource

func (this *Platform) GetSource(name string, project_id int64) (m *models.Source)

联合聚集索引

func (*Platform) GetTarget

func (this *Platform) GetTarget(name string, project_id int64) (m *models.Target)

联合聚集索引

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)

二级索引 左连接

func (*Platform) PutAndStoneResource

func (this *Platform) PutAndStoneResource(resource *models.Resource, r multipart.File)

保存并储存资源

type QbsRepository

type QbsRepository struct {
	Repository
	*qbs.Qbs
}

加强代码复用

func QbsRepo

func QbsRepo() *QbsRepository

解耦

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) Delete

func (this *QbsRepository) Delete(structPtr Model) 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

获取

func (*QbsRepository) Put

func (this *QbsRepository) Put(structPtr Model) 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
}

抽象化

Jump to

Keyboard shortcuts

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