api

package
v0.0.0-...-09a086b Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0, Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIBook

type APIBook struct {
	BookId      int       `json:"book_id"`
	BookName    string    `json:"book_name"`
	Identify    string    `json:"identify"`
	OrderIndex  int       `json:"sort"`
	Description string    `json:"description"`
	Label       string    `json:"tags"`
	Vcnt        int       `json:"view"` // 阅读
	Star        int       `json:"star"` // 收藏
	Lang        string    `json:"lang"`
	Cover       string    `json:"cover"`
	Score       int       `json:"score"`       // 书籍评分,默认40,即4.0星
	CntScore    int       `json:"cnt_score"`   // 评分个数
	CntComment  int       `json:"cnt_comment"` // 评论人数
	DocCount    int       `json:"cnt_doc"`     // 章节数量
	ReleaseTime time.Time `json:"updated_at"`  // 更新时间。这里用书籍的release_time 作为最后的更新时间。因为现有的更新时间不准
	CreateTime  time.Time `json:"created_at"`  // 新建时间
	MemberId    int       `json:"uid,omitempty"`
	User        string    `json:"user,omitempty"`       // 分享人
	Author      string    `json:"author,omitempty"`     // 原作者
	AuthorURL   string    `json:"author_url,omitempty"` // 原作者连接地址
	DocReaded   int       `json:"cnt_readed"`           //已读章节
	IsStar      bool      `json:"is_star"`              //是否已收藏到书架

}

type APIDoc

type APIDoc struct {
	DocumentId   int       `json:"id"`
	ParentId     int       `json:"pid"`
	DocumentName string    `json:"title"`
	Identify     string    `json:"identify"`
	BookId       int       `json:"book_id"`
	BookName     string    `json:"book_name"`
	OrderSort    int       `json:"sort"`
	Release      string    `json:"content,omitempty"`
	CreateTime   time.Time `json:"created_at,omitempty"`
	MemberId     int       `json:"uid"`
	ModifyTime   time.Time `json:"updated_at,omitempty"`
	Vcnt         int       `json:"vcnt"`
	Readed       bool      `json:"readed"`
	Bookmark     bool      `json:"bookmark"`
}

type APIDocV2

type APIDocV2 struct {
	DocumentId   int         `json:"id"`
	ParentId     int         `json:"pid"`
	DocumentName string      `json:"title"`
	Identify     string      `json:"identify"`
	BookId       int         `json:"book_id"`
	BookName     string      `json:"book_name"`
	OrderSort    int         `json:"sort"`
	Release      interface{} `json:"content,omitempty"`
	CreateTime   time.Time   `json:"created_at,omitempty"`
	MemberId     int         `json:"uid"`
	ModifyTime   time.Time   `json:"updated_at,omitempty"`
	Vcnt         int         `json:"vcnt"`
	Readed       bool        `json:"readed"`
	Bookmark     bool        `json:"bookmark"`
}

type APIRegister

type APIRegister struct {
	Nickname   string `form:"nickname"`
	Account    string `form:"username"`
	Password   string `form:"password"`
	RePassword string `form:"re_password"`
	Email      string `form:"email"`
}

type APIResponse

type APIResponse struct {
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type APIUser

type APIUser struct {
	Uid         int    `json:"uid"`
	Token       string `json:"token,omitempty"`
	Account     string `json:"username,omitempty"` //对应 member.account
	Nickname    string `json:"nickname"`
	Email       string `json:"email,omitempty"`
	Phone       string `json:"phone,omitempty"`
	Avatar      string `json:"avatar"`
	Description string `json:"intro,omitempty"`
}

type BaseController

type BaseController struct {
	beego.Controller
	Token   string
	Version string
}

func (*BaseController) Prepare

func (this *BaseController) Prepare()

验证access token

func (*BaseController) Response

func (this *BaseController) Response(httpStatus int, message string, data ...interface{})

type CommonController

type CommonController struct {
	BaseController
}

不登录也能调用的接口放这里

func (*CommonController) Banners

func (this *CommonController) Banners()

【OK】

func (*CommonController) BookInfo

func (this *CommonController) BookInfo()

【OK】

func (*CommonController) BookLists

func (this *CommonController) BookLists()

【OK】

func (*CommonController) BookListsByCids

func (this *CommonController) BookListsByCids()

func (*CommonController) BookMenu

func (this *CommonController) BookMenu()

返回用户对该章节是否已读

func (*CommonController) Bookshelf

func (this *CommonController) Bookshelf()

func (*CommonController) Categories

func (this *CommonController) Categories()

func (*CommonController) Download

func (this *CommonController) Download()

func (*CommonController) GetComments

func (this *CommonController) GetComments()

查询书籍评论

func (*CommonController) GetUserMoreInfo

func (this *CommonController) GetUserMoreInfo()

func (*CommonController) HistoryReadBook

func (this *CommonController) HistoryReadBook()

查询最近阅读过的书籍,返回最近50本

func (*CommonController) LatestVersion

func (this *CommonController) LatestVersion()

func (*CommonController) Login

func (this *CommonController) Login()

普通登录

func (*CommonController) LoginBindWechat

func (this *CommonController) LoginBindWechat()

func (*CommonController) LoginByWechat

func (this *CommonController) LoginByWechat()

微信登录

func (*CommonController) LoginedBindWechat

func (this *CommonController) LoginedBindWechat()

func (*CommonController) Rank

func (this *CommonController) Rank()

func (*CommonController) Read

func (this *CommonController) Read()

func (*CommonController) Register

func (this *CommonController) Register()

【OK】

func (*CommonController) RelatedBook

func (this *CommonController) RelatedBook()

func (*CommonController) SearchBook

func (this *CommonController) SearchBook()

[OK]

func (*CommonController) SearchDoc

func (this *CommonController) SearchDoc()

[OK]

func (*CommonController) TODO

func (this *CommonController) TODO()

func (*CommonController) UserFans

func (this *CommonController) UserFans()

func (*CommonController) UserFollow

func (this *CommonController) UserFollow()

func (*CommonController) UserInfo

func (this *CommonController) UserInfo()

查询用户的公开信息

func (*CommonController) UserReleaseBook

func (this *CommonController) UserReleaseBook()

如果不传用户id,则表示查询当前登录的用户发布的书籍

type LoginedController

type LoginedController struct {
	BaseController
}

登录之后才能调用的接口放这里

func (*LoginedController) ChangeAvatar

func (this *LoginedController) ChangeAvatar()

更换头像

func (*LoginedController) ChangePassword

func (this *LoginedController) ChangePassword()

func (*LoginedController) DeleteBookmarks

func (this *LoginedController) DeleteBookmarks()

func (*LoginedController) GetBookmarks

func (this *LoginedController) GetBookmarks()

func (*LoginedController) Logout

func (this *LoginedController) Logout()

func (*LoginedController) PostComment

func (this *LoginedController) PostComment()

func (*LoginedController) Prepare

func (this *LoginedController) Prepare()

func (*LoginedController) SetBookmarks

func (this *LoginedController) SetBookmarks()

func (*LoginedController) SignStatus

func (this *LoginedController) SignStatus()

查询签到状态

func (*LoginedController) SignToday

func (this *LoginedController) SignToday()

执行签到

func (*LoginedController) Star

func (this *LoginedController) Star()

收藏书籍(将书籍加入书架)/移除书籍

type UserMoreInfo

type UserMoreInfo struct {
	MemberId              int `json:"uid"`
	SignedAt              int `json:"signed_at"`               // 签到时间
	CreatedAt             int `json:"created_at"`              // 注册时间
	TotalSign             int `json:"total_sign"`              // 总签到天数
	TotalContinuousSign   int `json:"total_continuous_sign"`   // 总连续签到天数
	HistoryContinuousSign int `json:"history_continuous_sign"` // 历史连续签到天数
	TodayReading          int `json:"today_reading"`           // 今日阅读时长
	MonthReading          int `json:"month_reading"`           // 本月阅读时长
	TotalReading          int `json:"total_reading"`           // 总阅读时长
}

type WechatBindForm

type WechatBindForm struct {
	Username   string `form:"username"`
	Password   string `form:"password"`
	RePassword string `form:"re_password"`
	Nickname   string `form:"nickname"`
	Email      string `form:"email"`
	Sess       string `form:"sess"`
}

type WechatForm

type WechatForm struct {
	UserInfo string `form:"userInfo"`
	Code     string `form:"code"`
}

Jump to

Keyboard shortcuts

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