Documentation ¶
Index ¶
- func Init(c config.Config) *xorm.Engine
- func InitRedis(c config.Config) *redis.Client
- type RepositoryPool
- func (p RepositoryPool) GetByIdentity(identity string, engine *xorm.Engine) (*RepositoryPool, error)
- func (p RepositoryPool) GetHashByRepositoryPool(hash string, sql *xorm.Engine) (*RepositoryPool, error)
- func (p RepositoryPool) Insert(sql *xorm.Engine) (int64, error)
- func (p RepositoryPool) TableName() string
- type ShareBasic
- type ShareBasicDetails
- type User
- func (u User) GetUserByEmailCount(email string, engine *xorm.Engine) int64
- func (u User) GetUserByUsername(username string, engine *xorm.Engine) (*User, error)
- func (u User) GetUserInfo(identity string, engine *xorm.Engine) *UserInfo
- func (u User) Insert(user *User, engine *xorm.Engine) (int64, error)
- func (u User) TableName() string
- type UserInfo
- type UserRepository
- func (ur UserRepository) Delete(engine *xorm.Engine) (int64, error)
- func (ur UserRepository) Edit(engine *xorm.Engine) (int64, error)
- func (ur UserRepository) GetByIdentityAndUserIdentity(engine *xorm.Engine) (*UserRepository, error)
- func (ur UserRepository) GetByName(engine *xorm.Engine) (*UserRepository, error)
- func (ur UserRepository) GetByRepositoryIdentityAndUserIdentity(engine *xorm.Engine) (int64, error)
- func (ur UserRepository) GetFileNameByUser(req *types.UserFileNameEditRequest, engine *xorm.Engine) int64
- func (ur UserRepository) GetParentIdCount(parent int, engine *xorm.Engine) (int64, error)
- func (ur UserRepository) GetUserById(engine *xorm.Engine) (*UserRepository, error)
- func (ur UserRepository) Insert(engine *xorm.Engine) (int64, error)
- func (ur UserRepository) TableName() string
- func (ur UserRepository) UserFileList(req *types.UserFileListRequest, userIdentity string, engine *xorm.Engine) ([]*types.UserFile, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RepositoryPool ¶
type RepositoryPool struct { Id int Identity string Hash string Name string Ext string Size int64 Path string Type string CreateTime time.Time `xorm:"created"` UpdateTime time.Time `xorm:"updated"` DeleteTime time.Time `xorm:"deleted"` }
func (RepositoryPool) GetByIdentity ¶
func (p RepositoryPool) GetByIdentity(identity string, engine *xorm.Engine) (*RepositoryPool, error)
GetByIdentity 根据identity查询资源
func (RepositoryPool) GetHashByRepositoryPool ¶
func (p RepositoryPool) GetHashByRepositoryPool(hash string, sql *xorm.Engine) (*RepositoryPool, error)
GetHashByRepositoryPool 根据hash查询文件存储池中是否存在相同的文件
func (RepositoryPool) Insert ¶
func (p RepositoryPool) Insert(sql *xorm.Engine) (int64, error)
Insert 保存文件存储池数据
func (RepositoryPool) TableName ¶
func (p RepositoryPool) TableName() string
type ShareBasic ¶
type ShareBasic struct {}
func (ShareBasic) CountUp ¶
func (s ShareBasic) CountUp(identity string, engine *xorm.Engine) error
CountUp 累加计数
func (ShareBasic) GetBasicDetail ¶
func (s ShareBasic) GetBasicDetail(identity string, engine *xorm.Engine) (*ShareBasicDetails, error)
GetBasicDetail 获取资源详情
func (ShareBasic) Insert ¶
func (s ShareBasic) Insert(engine *xorm.Engine) (int64, error)
Insert 保存用户分享
func (ShareBasic) TableName ¶
func (s ShareBasic) TableName() string
type ShareBasicDetails ¶
type ShareBasicDetails struct {}
type User ¶
type User struct { Id int UserName string Identity string Password string Email string CreateTime time.Time `xorm:"created"` UpdateTime time.Time `xorm:"updated"` DeleteTime time.Time `xorm:"deleted"` }
func (User) GetUserByEmailCount ¶
GetUserByEmailCount 根据邮箱查询数据库中是否有相同的
func (User) GetUserByUsername ¶
GetUserByUsername 根据用户名查询用户
func (User) GetUserInfo ¶
GetUserInfo 获取当前用户详情
type UserRepository ¶
type UserRepository struct { Id int `json:"id"` Identity string UserIdentity string ParentId int64 `json:"parentId"` RepositoryIdentity string Ext string `json:"ext"` Name string `json:"name"` Type string `json:"type"` CreateTime time.Time `xorm:"created"` UpdateTime time.Time `xorm:"updated"` DeleteTime time.Time `xorm:"deleted"` }
func (UserRepository) Delete ¶
func (ur UserRepository) Delete(engine *xorm.Engine) (int64, error)
Delete 删除用户文件数据
func (UserRepository) Edit ¶
func (ur UserRepository) Edit(engine *xorm.Engine) (int64, error)
Edit 修改数据
func (UserRepository) GetByIdentityAndUserIdentity ¶
func (ur UserRepository) GetByIdentityAndUserIdentity(engine *xorm.Engine) (*UserRepository, error)
GetByIdentityAndUserIdentity 根据Identity和UserIdentity查询资源
func (UserRepository) GetByName ¶
func (ur UserRepository) GetByName(engine *xorm.Engine) (*UserRepository, error)
GetByName 根据名称查询数据
func (UserRepository) GetByRepositoryIdentityAndUserIdentity ¶
func (ur UserRepository) GetByRepositoryIdentityAndUserIdentity(engine *xorm.Engine) (int64, error)
GetByRepositoryIdentityAndUserIdentity 根据Identity和UserIdentity查询资源
func (UserRepository) GetFileNameByUser ¶
func (ur UserRepository) GetFileNameByUser(req *types.UserFileNameEditRequest, engine *xorm.Engine) int64
GetFileNameByUser 根据用户查询用户文件是否存在
func (UserRepository) GetParentIdCount ¶
GetParentIdCount 根据parentId查询下面是否有文件
func (UserRepository) GetUserById ¶
func (ur UserRepository) GetUserById(engine *xorm.Engine) (*UserRepository, error)
GetUserById 根据Identity和UserIdentity查询资源
func (UserRepository) Insert ¶
func (ur UserRepository) Insert(engine *xorm.Engine) (int64, error)
Insert 保存用户文件仓库池
func (UserRepository) TableName ¶
func (ur UserRepository) TableName() string
func (UserRepository) UserFileList ¶
func (ur UserRepository) UserFileList(req *types.UserFileListRequest, userIdentity string, engine *xorm.Engine) ([]*types.UserFile, error)
UserFileList 根据用户查询用户文件列表
Click to show internal directories.
Click to hide internal directories.