services

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultUserService       = UserService{}
	DefaultUserRoleService   = UserRoleService{}
	DefaultRoleActionService = RoleActionService{}
)

Functions

func DbInit

func DbInit(SqliteDbPath string) (bool, error)

init the db,should take a db filepath

func QueryAuthorBooks

func QueryAuthorBooks(authorid, limit, start int) []models.BookVo

author books info

func QueryAuthorBooksCount

func QueryAuthorBooksCount(authorid int) int

author books info

func QueryAuthors

func QueryAuthors(limit, start int) []models.Author

authors info

func QueryAuthorsCount

func QueryAuthorsCount() int64

all authors count

func QueryBook

func QueryBook(bookid int) models.BookVo

find a book by bookid

func QueryBookFile

func QueryBookFile(bookid int) (*os.File, error)

book's file

func QueryBookFileByte

func QueryBookFileByte(bookid int) []byte

book's file

func QueryBookRating

func QueryBookRating(bookid int) int

book's rating

func QueryBookTags added in v0.0.2

func QueryBookTags(bookid int) []models.Tag

query more tags by bookid

func QueryBooks

func QueryBooks(limit, start int) []models.BookVo

all books info

func QueryBooksCount

func QueryBooksCount() int64

all books count

func QueryCoverImg

func QueryCoverImg(bookid int) []byte

book's img

func QueryDiscoverBooks

func QueryDiscoverBooks(limit, start int) []models.BookVo

discover books info

func QueryLanguageBooks

func QueryLanguageBooks(lang_code, limit, start int) []models.BookVo

languages books info

func QueryLanguageBooksCount

func QueryLanguageBooksCount(lang_code int) int

languages books info

func QueryLanguages

func QueryLanguages(limit, start int) []models.Language

languages info

func QueryLanguagesCount

func QueryLanguagesCount() int64

all languages count

func QueryNewBooks

func QueryNewBooks(limit, start int) []models.BookVo

new books info

func QueryRatingBooks

func QueryRatingBooks(limit, start int) []models.BookVo

rating books info

func QueryTagBooks

func QueryTagBooks(tagid, limit, start int) []models.BookVo

tag books info

func QueryTagBooksCount

func QueryTagBooksCount(tagid int) int

tag books info

func QueryTags

func QueryTags(limit, start int) []models.Tag

tags info

func QueryTagsCount

func QueryTagsCount() int64

all tags count

Types

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