Documentation ¶
Overview ¶
book 知识手册项目的核心代码包
Index ¶
- func APIDELETEBook(c *gin.Context)
- func APIDELETEBookCard(c *gin.Context)
- func APIDELETECard(c *gin.Context)
- func APIGETBook(c *gin.Context)
- func APIGETBookCards(c *gin.Context)
- func APIGETBooks(c *gin.Context)
- func APIGETCard(c *gin.Context)
- func APIGETPointCards(c *gin.Context)
- func APIGetBook(c *gin.Context)
- func APIOPTIONCard(c *gin.Context)
- func APIPOSTBook(c *gin.Context)
- func APIPOSTBookTaxonomy(c *gin.Context)
- func APIPOSTCard(c *gin.Context)
- func APIPUTCard(c *gin.Context)
- func APIPostCard(c *gin.Context)
- func APIPostUpdateCardsTreeNew(c *gin.Context)
- func AdminGETBook(c *gin.Context)
- func DELETEBookCard(bookID uint64, cardID uint64) error
- func GETPoint(c *gin.Context)
- func GetBookEdit(c *gin.Context)
- func GetBookList(uid uint64, p *pagination.Pagination) ([]model.DBBook, uint64, error)
- func InsterCard(userID uint64, bookID uint64, cardName string, cardDesc string, ...) error
- func POSTBook(userID uint64, name string, desc string) error
- func PUTCard(cardID uint64, name string, desc string, state string) (sql.Result, error)
- func PUTCardInBook(tx *sql.Tx, uid uint64, cardID uint64, inBook bool) error
- func PutBookCardsTree(bookID uint64, t []TreeData, parent uint64, cardOrder *int) error
- func Register()
- type APIDELETEBookCardForm
- type APIDELETEBookForm
- type APIDELETECardForm
- type APIGETBookCardsForm
- type APIGETBooksForm
- type APIGETCardForm
- type APIGETCardsForm
- type APIPOSTBookForm
- type APIPOSTBookTaxonomyFrom
- type APIPOSTCardForm
- type APIPUTCardForm
- type Book
- type BookCards
- type Card
- type FormAPIPostCard
- type FormAPIPostUpdateCardTree
- type GetBookForm
- type SPErr
- type TreeData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIDELETEBookCard ¶
APIDELETEBookCard 移除book下的card下的引用 @since 0.0.3
func APIPOSTBookTaxonomy ¶
APIPOSTBookTaxonomy 将已有的 card 添加引用到 book
func APIPostCard ¶
APIPostCard 添加卡片 bookID == 0 只添加 card !=0 关联到 book
func APIPostUpdateCardsTreeNew ¶
APIPostUpdateCardTreeNew 更新手册排序 @since 0.0.9 ant 重写
func DELETEBookCard ¶
DELETEBookCard 删除book下的card引用 @since 0.0.3
func GetBookList ¶
func GetBookList(uid uint64, p *pagination.Pagination) ([]model.DBBook, uint64, error)
GetBookList 获取图书列表 @since 0.0.3
func InsterCard ¶
func InsterCard(userID uint64, bookID uint64, cardName string, cardDesc string, state model.CardState) error
InsterCard 向book插入新Card sp insert_card 先增加card再添加book的引用关系 @since 0.0.3
func POSTBook ¶
POSTBook 添加新的图书 @since 0.0.3
func PUTCard ¶
TODO 增加管理员可以修改
func PUTCardInBook ¶
PUTCardInBook 修改 card 的 in_book 字段状态 @since v0.0.9
func PutBookCardsTree ¶
Types ¶
type APIDELETEBookCardForm ¶
type APIDELETEBookForm ¶
type APIDELETEBookForm struct {
BookID uint64 `form:"book_id" binding:"required"`
}
@since 0.0.10
type APIDELETECardForm ¶
type APIDELETECardForm struct {
CardID uint64 `form:"card_id" json:"card_id"`
}
type APIGETBookCardsForm ¶
type APIGETCardForm ¶
type APIGETCardForm struct { // BookID uint64 `json:"book_id" form:"book_id"` CardID uint64 `json:"card_id" form:"card_id"` }
type APIGETCardsForm ¶
type APIGETCardsForm struct {
ParentCardID uint64 `form:"parent_card_id" binding:"required"`
}
type APIPOSTBookForm ¶
type APIPOSTBookTaxonomyFrom ¶
type APIPOSTCardForm ¶
type APIPOSTCardForm struct { BookID uint64 `json:"book_id"` Name string `json:"name"` Desc string `json:"desc"` }
APIPOSTCardForm APIPOSTCard
type APIPUTCardForm ¶
type APIPUTCardForm struct { CardID uint64 `json:"card_id"` // 主键ID //UserID uint64 `json:"user_id"` // 用户ID Name string `json:"name"` // 卡片名称 Desc string `json:"desc"` // 卡片内容 State string `json:"state"` // enum 状态 ('close','open') }
@since v0.0.9 取消了 user_id
type Book ¶
type BookCards ¶
type Card ¶
type FormAPIPostCard ¶
type FormAPIPostUpdateCardTree ¶
type SPErr ¶
Click to show internal directories.
Click to hide internal directories.