services

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultBookService       = CaliBookService{/* contains filtered or unexported fields */}
	DefaultFormatService     = CaliFormatService{}
	DefaultCategoryService   = CaliCategoryService{}
	DefaultUserService       = UserService{}
	DefaultUserRoleService   = UserRoleService{}
	DefaultRoleActionService = RoleActionService{}
	DefaultSysConfigService  = SysConfigService{}
	DefaultSysStatusService  = SysStatusService{/* contains filtered or unexported fields */}
	DefaultUserConfigService = UserConfigService{}
)

Functions

func DbInit

func DbInit() (bool, error)

init the db,should take a db filepath

func DbInitByMysql added in v0.1.5

func DbInitByMysql(mysqlDsn string) error

func DbInitBySqlite added in v0.1.5

func DbInitBySqlite(sqliteDbPath string) error

func UpdateSql2Sql added in v0.1.5

func UpdateSql2Sql(dst *xorm.Engine, src *xorm.Engine)

func UpdateSqlite2Mysql added in v0.1.5

func UpdateSqlite2Mysql()

Types

type CaliBookService added in v0.1.0

type CaliBookService struct {
	// contains filtered or unexported fields
}

func (CaliBookService) AddBookCategory added in v0.1.0

func (service CaliBookService) AddBookCategory(bookId, categoryId string)

func (CaliBookService) DeleteById added in v0.1.3

func (service CaliBookService) DeleteById(bookId string)

func (CaliBookService) GetBookByTitleAndAuthor added in v0.1.3

func (service CaliBookService) GetBookByTitleAndAuthor(title, author string) (book models.CaliBook)

func (CaliBookService) GetBookOrInsertByTitleAndAuthor added in v0.1.0

func (service CaliBookService) GetBookOrInsertByTitleAndAuthor(title, author string) (book models.CaliBook)

func (CaliBookService) QueryBook added in v0.1.0

func (service CaliBookService) QueryBook(bookid string) (has bool, book models.CaliBook)

find a book by bookid

func (CaliBookService) QueryBookFile added in v0.1.0

func (service CaliBookService) QueryBookFile(formatid string) (*os.File, error)

book's file

func (CaliBookService) QueryBookFileByte added in v0.1.0

func (service CaliBookService) QueryBookFileByte(formatId string) []byte

book's file

func (CaliBookService) QueryBooks added in v0.1.0

func (service CaliBookService) QueryBooks(limit, start int, categoryid string) []models.CaliBook

all books info

func (CaliBookService) QueryBooksCount added in v0.1.0

func (service CaliBookService) QueryBooksCount(categoryid string) int64

all books count

func (CaliBookService) SearchBooks added in v0.1.0

func (service CaliBookService) SearchBooks(searchStr, categoryId string, limit, start int) []models.CaliBook

func (CaliBookService) SearchBooksCount added in v0.1.0

func (service CaliBookService) SearchBooksCount(searchStr, categoryId string) int

func (CaliBookService) UpdateCaliBook added in v0.1.0

func (service CaliBookService) UpdateCaliBook(book models.CaliBook)

func (CaliBookService) UpdateCaliBookDownload added in v0.1.0

func (service CaliBookService) UpdateCaliBookDownload(book models.CaliBook)

func (CaliBookService) UploadBookFormat added in v0.1.0

func (service CaliBookService) UploadBookFormat(filePath, tag string) (bool, error, models.CaliFormat)

type CaliCategoryService added in v0.1.0

type CaliCategoryService struct {
}

func (CaliCategoryService) DeleteBookCategoryByBookId added in v0.1.3

func (service CaliCategoryService) DeleteBookCategoryByBookId(bookId string)

func (CaliCategoryService) DeleteById added in v0.1.1

func (service CaliCategoryService) DeleteById(categoryId string)

func (CaliCategoryService) GetOrInsertCategoryByName added in v0.1.0

func (service CaliCategoryService) GetOrInsertCategoryByName(categoryName string) (category models.CaliCategory)

func (CaliCategoryService) Query added in v0.1.0

func (service CaliCategoryService) Query() []models.CaliCategory

func (CaliCategoryService) QueryByBookIdWithOutDefault added in v0.1.3

func (service CaliCategoryService) QueryByBookIdWithOutDefault(bookId string) (categories []models.CaliCategory)

func (CaliCategoryService) QueryCount added in v0.1.0

func (service CaliCategoryService) QueryCount() int

func (CaliCategoryService) UpdateCategoryName added in v0.1.1

func (service CaliCategoryService) UpdateCategoryName(categoryId, categoryName string)

type CaliFormatService added in v0.1.0

type CaliFormatService struct {
}

func (CaliFormatService) Add added in v0.1.0

func (service CaliFormatService) Add(format models.CaliFormat) bool

func (CaliFormatService) DeleteByBookId added in v0.1.3

func (service CaliFormatService) DeleteByBookId(bookId string)

func (CaliFormatService) DeleteById added in v0.1.2

func (service CaliFormatService) DeleteById(formatId string)

func (CaliFormatService) DeleteUserUploadDownload added in v0.1.3

func (service CaliFormatService) DeleteUserUploadDownload(formatId string)

func (CaliFormatService) GetById added in v0.1.0

func (service CaliFormatService) GetById(formatid string) (ok bool, format models.CaliFormat)

func (CaliFormatService) GetFormatBySize added in v0.1.1

func (service CaliFormatService) GetFormatBySize(size int64) (format models.CaliFormat)
func (service CaliFormatService) GetNoBookLink() (formats []models.CaliFormat)

func (CaliFormatService) QueryByBookId added in v0.1.3

func (service CaliFormatService) QueryByBookId(bookId string) []models.CaliFormat

func (CaliFormatService) UpdateBookFormatCaliBook added in v0.1.0

func (service CaliFormatService) UpdateBookFormatCaliBook(format models.CaliFormat)

func (CaliFormatService) UpdateBookid added in v0.1.0

func (service CaliFormatService) UpdateBookid(formatId, bookId string) bool

func (CaliFormatService) UpdateCaliFormatDownload added in v0.1.0

func (service CaliFormatService) UpdateCaliFormatDownload(format models.CaliFormat)

func (CaliFormatService) UpdateTag added in v0.1.0

func (service CaliFormatService) UpdateTag(formatid, tag string) bool

type RoleActionService added in v0.0.2

type RoleActionService struct {
}

func (RoleActionService) GetRoleActionByControllerMethodRole added in v0.0.2

func (service RoleActionService) GetRoleActionByControllerMethodRole(controller, method, role string) models.RoleAction

type SysConfigService added in v0.0.3

type SysConfigService struct {
}

func (SysConfigService) AddSysConfig added in v0.0.3

func (service SysConfigService) AddSysConfig(sysConfig models.SysConfig) bool

func (SysConfigService) Get added in v0.0.3

func (service SysConfigService) Get(key string) models.SysConfig

func (SysConfigService) QuerySysConfigs added in v0.0.3

func (service SysConfigService) QuerySysConfigs(limit, start int) []models.SysConfig

func (SysConfigService) UpdateConfig added in v0.0.3

func (service SysConfigService) UpdateConfig(sysConfig models.SysConfig) bool

type SysStatusService added in v0.0.4

type SysStatusService struct {
	// contains filtered or unexported fields
}

func (SysStatusService) AddSysStatus added in v0.0.4

func (service SysStatusService) AddSysStatus(sysStatus models.SysStatus) bool

func (SysStatusService) DeleteSysStatus added in v0.1.0

func (service SysStatusService) DeleteSysStatus(sysStatus models.SysStatus) bool

func (SysStatusService) Get added in v0.0.4

func (service SysStatusService) Get(key string) models.SysStatus

func (SysStatusService) QuerySysStatus added in v0.0.4

func (service SysStatusService) QuerySysStatus(limit, start int) []models.SysStatus

func (SysStatusService) UpdateStatus added in v0.0.4

func (service SysStatusService) UpdateStatus(sysStatus models.SysStatus) bool

type UserConfigService added in v0.1.0

type UserConfigService struct {
}

func (UserConfigService) GetUserConfig added in v0.1.0

func (service UserConfigService) GetUserConfig(userId string) (models.UserConfig, bool)

type UserRoleService added in v0.0.2

type UserRoleService struct {
}

func (UserRoleService) GetRoleByUser added in v0.0.2

func (service UserRoleService) GetRoleByUser(userId string) models.Role

type UserService added in v0.0.2

type UserService struct {
}

func (UserService) ActiveUser added in v0.1.0

func (userService UserService) ActiveUser(salt string) bool

func (UserService) AddDownload added in v0.0.4

func (userService UserService) AddDownload(userId string, formatid string) bool

func (UserService) AddUpload added in v0.0.4

func (userService UserService) AddUpload(userId string, formatid string) bool

func (UserService) DeleteUser added in v0.0.2

func (userService UserService) DeleteUser(userId string) bool

set valid = 1 ,not allow delete admin

func (UserService) FreshLoginSession added in v0.0.2

func (userService UserService) FreshLoginSession(loginSession string, UserId string)

func (UserService) GetAllUserByLoginName added in v0.1.0

func (userService UserService) GetAllUserByLoginName(loginName string) (models.UserInfo, bool)

func (UserService) GetDownloadCount added in v0.1.0

func (userService UserService) GetDownloadCount(userId string, start, stop time.Time) int

func (UserService) GetLoginUser added in v0.0.2

func (userService UserService) GetLoginUser(loginSession string) (models.UserInfo, bool)

func (UserService) GetUserById added in v0.0.2

func (userService UserService) GetUserById(Id string) models.UserInfo

获取user信息

func (UserService) GetUserByLoginName added in v0.0.2

func (userService UserService) GetUserByLoginName(loginName string) (models.UserInfo, bool)

func (UserService) QueryUser added in v0.0.2

func (userService UserService) QueryUser(name string, limit, start int) []models.UserInfo

find user by username or login name

func (UserService) QueryUserCount added in v0.0.2

func (userService UserService) QueryUserCount(name string) int64

func (UserService) Regist added in v0.0.2

func (userService UserService) Regist(user models.UserInfo) bool

func (UserService) UpdateInfo added in v0.0.2

func (userService UserService) UpdateInfo(user models.UserInfo) bool

update info .not in password or other.

func (UserService) UpdatePassword added in v0.0.2

func (userService UserService) UpdatePassword(user models.UserInfo) bool

change password and salt

Jump to

Keyboard shortcuts

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