Documentation ¶
Index ¶
- Constants
- func GetIndividualFromTeams(db *gorm.DB, teams []uint64) ([]uint64, error)
- type Account
- type Common
- type Company
- type Config
- type Repository
- func (r *Repository) GetTeams(db *gorm.DB) ([]uint64, error)
- func (r *Repository) HasUser(db *gorm.DB, userID uint64) (bool, error)
- func (r *Repository) IsIndividualCollaborator(db *gorm.DB, teamIDs []uint64) (bool, error)
- func (r *Repository) IsOutsideCollaborator(db *gorm.DB, userID uint64) (bool, error)
- func (r *Repository) RelatedOutsideCollaborators(db *gorm.DB) error
- func (r *Repository) ReleatedAccount(db *gorm.DB) error
- func (r *Repository) SAccountID() string
- func (r *Repository) SID() string
- type Response
- type Team
- type TeamRepository
- type User
- type UserCompany
- type UserRepository
- type UserTeam
Constants ¶
View Source
const ( // ASOK .. ASOK // ASFail .. ASFail )
View Source
const ( // UCPManager 企业管理员 UCPManager // UCPSuperManager 企业超级管理员 UCPSuperManager )
View Source
const ( // UTPMember 小组成员 UTPMember // UTPManager 小组管理员 UTPManager )
View Source
const CtxKeyAuthorizedUser = "cau"
CtxKeyAuthorizedUser ..
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Account ¶
type Account struct { Common `json:"common,omitempty"` Login string `gorm:"UNIQUE_INDEX" json:"login,omitempty"` Name string `json:"name,omitempty"` // 昵称 AvatarURL string `json:"avatar_url,omitempty"` Status uint `json:"status,omitempty"` Message string `json:"message,omitempty"` Token string `json:"token,omitempty"` SyncedAt time.Time CompanyID uint64 `json:"company_id,omitempty"` }
Account ..
func NewAccountFromGitHub ¶
NewAccountFromGitHub ..
type Common ¶
type Common struct { ID uint64 `gorm:"primary_key"` CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time `sql:"index"` }
Common ..
type Config ¶
type Config struct { Debug bool Site struct { Brand string // 站点名称 CookieName string } GitHub struct { ClientID string ClientSecret string } }
Config ..
type Repository ¶
type Repository struct { ID uint64 `gorm:"primary_key"` Name string HTMLURL string Description string Private bool SyncedAt time.Time // 最后一次同步 AccountID uint64 OutsideCollaborators []User Account Account }
Repository ..
func NewRepositoryFromGitHub ¶
func NewRepositoryFromGitHub(gr *github.Repository) Repository
NewRepositoryFromGitHub ..
func (*Repository) GetTeams ¶
func (r *Repository) GetTeams(db *gorm.DB) ([]uint64, error)
GetTeams ..
func (*Repository) IsIndividualCollaborator ¶
IsIndividualCollaborator 是不是只在一个 Team 的开发者
func (*Repository) IsOutsideCollaborator ¶
IsOutsideCollaborator 是不是只在一个 Team 的开发者
func (*Repository) RelatedOutsideCollaborators ¶
func (r *Repository) RelatedOutsideCollaborators(db *gorm.DB) error
RelatedOutsideCollaborators ..
func (*Repository) ReleatedAccount ¶
func (r *Repository) ReleatedAccount(db *gorm.DB) error
ReleatedAccount ..
type Response ¶
type Response struct { Code uint64 `json:"code,omitempty"` Message string `json:"message,omitempty"` Result interface{} `json:"result,omitempty"` }
Response ..
type Team ¶
type Team struct { Common Name string `json:"name,omitempty"` CompanyID uint64 `json:"company_id,omitempty"` RepositoriesID []uint64 `gorm:"-"` Repositories []Repository EmployeesID []uint64 `gorm:"-"` Employees []User Managers []User }
Team ..
func (*Team) CheckUserPermission ¶
func (t *Team) CheckUserPermission(db *gorm.DB, userID uint64, minPermission uint64) (uint64, error)
CheckUserPermission ..
func (*Team) FetchRepositoriesID ¶
FetchRepositoriesID ..
type TeamRepository ¶
type TeamRepository struct { TeamID uint64 `gorm:"primary_key;auto_increment:false"` RepositoryID uint64 `gorm:"primary_key;auto_increment:false"` }
TeamRepository ..
type User ¶
type User struct { Common `json:"common,omitempty"` Login string `gorm:"UNIQUE_INDEX" json:"login,omitempty"` // 登录名 AvatarURL string `json:"avatar_url,omitempty"` // 头像地址 Name string `json:"name,omitempty"` // 昵称 Blog string `json:"blog,omitempty"` // 网站链接 Email string `json:"email,omitempty"` // 邮箱 Hireable bool `json:"hireable,omitempty"` Bio string `json:"bio,omitempty"` // 个人简介 Token string `gorm:"UNIQUE_INDEX" json:"-"` // 认证 Token TokenExpired time.Time `json:"token_expired,omitempty"` // Token 过期时间 SuperAdmin bool `json:"super_admin,omitempty"` // 超级管理员 TeamsID []uint64 `gorm:"-"` }
User ...
type UserCompany ¶
type UserCompany struct { UserID uint64 `gorm:"primary_key;auto_increment:false"` CompanyID uint64 `gorm:"primary_key;auto_increment:false"` Permission uint64 }
UserCompany ..
type UserRepository ¶
type UserRepository struct { UserID uint64 `gorm:"primary_key;auto_increment:false"` RepositoryID uint64 `gorm:"primary_key;auto_increment:false"` InvitationID int64 }
UserRepository ..
Click to show internal directories.
Click to hide internal directories.