Documentation ¶
Index ¶
- Variables
- func CreateForum(forumName, description string, isPublic bool) (int64, error)
- func CreateUser(username string, password string, email string) error
- func FileDelete(filename string, bucketName string) error
- func FileDownload(filename string, bucketName string, ext string) (*minio.Object, error)
- func FileDownloadByName(filename string, bucketName string) (*minio.Object, error)
- func FileUpload(file multipart.File, header *multipart.FileHeader, bucketName string, ...) (filename string, err error)
- func GenerateToken(user_id int, username string, password string) (string, error)
- func GetAllCommentsByPostID(post_id int) ([]models.Comment, error)
- func GetAllHolesByForumID(forum_id int) ([]models.Hole, error)
- func GetAllPostDetailsByForumID(forum_id int) ([]models.PostDetail, error)
- func GetAllPostsByForumID(forum_id int) ([]models.Post, error)
- func GetDownloadName(path string, ext string) string
- func GetFilesByPostID(post_id int) ([]models.ExtendedFile, error)
- func GetOneCommentDetailByCommentID(comment_id int) ([]models.CommentDetail, error)
- func GetOneHoleDetailByHoleID(hole_id int) ([]models.HoleDetail, error)
- func GetOnePostDetailByPostID(post_id int) ([]models.PostDetail, error)
- func GetOneUserDetail(userID int) (models.UserDetail, error)
- func GetOneUserSubscribe(userID int) (models.SubscribeList, error)
- func GetUploadName(path string, ext string) string
- func GetUserFromContext(c *gin.Context) models.User
- func IsEmailExist(email string) (bool, error)
- func IsUserInForum(user_id int, forum_id int) (bool, error)
- func IsUsernameExist(username string) (bool, error)
- func MultipleFilesUpload(files []File, bucketName string, path string, ext string) ([]string, error)
- func ProduceTokenByEmailAndPassword(email string, password string) (string, error)
- func ProduceTokenByUsernameAndPasword(username string, password string) (string, error)
- func VerifyByEmailAndPassword(email string, password string) (bool, error)
- func VerifyByUsernameAndPassword(username string, password string) (bool, error)
- type Claims
- type File
Constants ¶
This section is empty.
Variables ¶
View Source
var MinioClient *minio.Client
Functions ¶
func CreateForum ¶
创建论坛
func FileDelete ¶
func FileDownload ¶
func FileDownloadByName ¶
func FileUpload ¶
func GenerateToken ¶
func GetAllCommentsByPostID ¶
根据 post_id 获取全部comment的详情
func GetAllPostDetailsByForumID ¶
func GetAllPostDetailsByForumID(forum_id int) ([]models.PostDetail, error)
func GetFilesByPostID ¶
func GetFilesByPostID(post_id int) ([]models.ExtendedFile, error)
func GetOneCommentDetailByCommentID ¶
func GetOneCommentDetailByCommentID(comment_id int) ([]models.CommentDetail, error)
根据 comment_id 获取一个comment的详情
func GetOneHoleDetailByHoleID ¶
func GetOneHoleDetailByHoleID(hole_id int) ([]models.HoleDetail, error)
根据 hole_id 获取一个hole的详情
func GetOnePostDetailByPostID ¶
func GetOnePostDetailByPostID(post_id int) ([]models.PostDetail, error)
根据 post_id 获取一个post的详情
func GetOneUserDetail ¶
func GetOneUserDetail(userID int) (models.UserDetail, error)
func GetOneUserSubscribe ¶
func GetOneUserSubscribe(userID int) (models.SubscribeList, error)
func GetUploadName ¶
传入api路径和文件扩展名,如 getUploadName('/api/users/1/avatar', '.png')
func IsEmailExist ¶
func IsUserInForum ¶
查找当前用户是否是论坛成员 如果该论坛是公开的,则直接返回true, 否则查看论坛的成员列表中是否有该用户
func IsUsernameExist ¶
func MultipleFilesUpload ¶
func MultipleFilesUpload(files []File, bucketName string, path string, ext string) ([]string, error)
上传多个文件,如果有文件上传出错则回滚之前的文件, 返回成功上传的文件名
Types ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.