Documentation ¶
Index ¶
- Constants
- Variables
- func CreateFavorite(favorite *common.Favorite) (err error)
- func CreateFavoriteDir(favoriteDir *common.FavoriteDir) (err error)
- func CreatePostComment(comment *common.Comment) (err error)
- func CreateQuestion(question *common.Question) (err error)
- func CreateReplyComment(comment *common.Comment) (err error)
- func GetAnswerCount(questionId int64) (answerCount int64, err error)
- func GetAnswerIdList(questionId int64, offset, limit int64) (answerIdList []int64, err error)
- func GetCategoryList() (categoryList []*common.Category, err error)
- func GetCommentList(answerId int64, offset, limit int64) (commentList []*common.Comment, count int64, err error)
- func GetFavoriteDirList(userId int64) (favoriteDirList []*common.FavoriteDir, err error)
- func GetFavoriteList(userId, dirId, offset, limit int64) (favoriteList []*common.Favorite, err error)
- func GetQuestion(questionId int64) (question *common.Question, err error)
- func GetQuestionList(categoryId int64) (questionList []*common.Question, err error)
- func GetReplyList(commentId int64, offset, limit int64) (commentList []*common.Comment, count int64, err error)
- func GetUserInfoList(userIdList []int64) (userInfoList []*common.UserInfo, err error)
- func Init(dns string) error
- func Login(user *common.UserInfo) (err error)
- func MGetAnswer(answerIds []int64) (answerList []*common.Answer, err error)
- func MGetCategory(categoryIds []int64) (categoryMap map[int64]*common.Category, err error)
- func Register(user *common.UserInfo) (err error)
- func UpdateAnswerLikeCount(answerId int64) (err error)
- func UpdateCommentLikeCount(commentId int64) (err error)
Constants ¶
View Source
const (
PasswordSalt = "HBZciU2SiSDr4uPeJ1e7qlIlMbyusQ0v"
)
Variables ¶
View Source
var ( ErrUserExists = errors.New("username is exist") ErrUserNotExists = errors.New("username not exist") ErrUserPasswordWrong = errors.New("username or password not right") ErrRecordExists = errors.New("record exist") )
View Source
var (
DB *sqlx.DB
)
Functions ¶
func CreateFavorite ¶
func CreateFavoriteDir ¶
func CreateFavoriteDir(favoriteDir *common.FavoriteDir) (err error)
func CreatePostComment ¶
func CreateQuestion ¶
func CreateReplyComment ¶
func GetAnswerCount ¶
func GetAnswerIdList ¶
func GetCategoryList ¶
func GetCommentList ¶
func GetFavoriteDirList ¶
func GetFavoriteDirList(userId int64) (favoriteDirList []*common.FavoriteDir, err error)
func GetFavoriteList ¶
func GetQuestionList ¶
func GetReplyList ¶
func GetUserInfoList ¶
func MGetCategory ¶
func UpdateAnswerLikeCount ¶
func UpdateCommentLikeCount ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.