From 3132649d6201e63bcaf71e02bf310ecc11b2cc06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D0=BE=D0=B2=D0=B0=D1=80=D0=B8=D1=89=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D0=B3=D1=80=D0=B0=D0=BC=D0=BC=D0=B8=D1=81=D1=82?= <46831212+ComradeProgrammer@users.noreply.github.com> Date: Mon, 6 Dec 2021 18:27:23 +0800 Subject: [PATCH] feat: add comments to categorize apis for swagger (#389) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Товарищ программист <2962928213@qq.com> --- controllers/account.go | 3 + controllers/balance.go | 12 + controllers/favorites.go | 15 + controllers/file.go | 9 + controllers/frontConf.go | 8 + controllers/hot.go | 6 + controllers/info.go | 12 + controllers/member.go | 10 + controllers/node.go | 43 ++ controllers/notifications.go | 12 + controllers/plane.go | 21 + controllers/poster.go | 2 + controllers/reply.go | 30 +- controllers/search.go | 3 + controllers/sensitive.go | 9 + controllers/tab.go | 24 + controllers/topic.go | 27 + controllers/translator.go | 15 + go.mod | 3 - go.sum | 3 - object/reply.go | 5 +- swagger/swagger.json | 1102 ++++++++++++++++++++++------------ swagger/swagger.yml | 759 ++++++++++++++--------- 23 files changed, 1438 insertions(+), 695 deletions(-) diff --git a/controllers/account.go b/controllers/account.go index c20dd784..4b05e009 100644 --- a/controllers/account.go +++ b/controllers/account.go @@ -46,6 +46,7 @@ func InitAuthConfig() { // @Param state QueryString string true "The state" // @Success 200 {object} controllers.api_controller.Response The Response object // @router /signin [post] +// @Tag Account API func (c *ApiController) Signin() { code := c.Input().Get("code") state := c.Input().Get("state") @@ -76,6 +77,7 @@ func (c *ApiController) Signin() { // @Description sign out the current member // @Success 200 {object} controllers.api_controller.Response The Response object // @router /signout [post] +// @Tag Account API func (c *ApiController) Signout() { claims := c.GetSessionClaims() if claims != nil { @@ -95,6 +97,7 @@ func (c *ApiController) Signout() { // @Description Get current account // @Success 200 {object} controllers.api_controller.Response The Response object // @router /get-account [get] +// @Tag Account API func (c *ApiController) GetAccount() { if c.RequireSignedIn() { return diff --git a/controllers/balance.go b/controllers/balance.go index eb7b047a..ef66dbdf 100644 --- a/controllers/balance.go +++ b/controllers/balance.go @@ -24,6 +24,9 @@ import ( "github.com/casdoor/casdoor-go-sdk/auth" ) +// @Tag Balance API +// @Title AddThanks +// @router /add-thanks [post] func (c *ApiController) AddThanks() { if c.RequireSignedIn() { return @@ -102,6 +105,9 @@ func (c *ApiController) AddThanks() { } } +// @Tag Balance API +// @Title GetConsumptionRecord +// @router /get-consumption-record [get] func (c *ApiController) GetConsumptionRecord() { username := c.GetSessionUsername() limitStr := c.Input().Get("limit") @@ -125,6 +131,9 @@ func (c *ApiController) GetConsumptionRecord() { c.ResponseOk(res, num) } +// @Tag Balance API +// @Title GetCheckinBonus +// @router /get-checkin-bonus [get] func (c *ApiController) GetCheckinBonus() { if c.RequireSignedIn() { return @@ -170,6 +179,9 @@ func (c *ApiController) GetCheckinBonus() { c.ResponseOk(bonus) } +// @router /get-checkin-bonus-status [get] +// @Tag Balance API +// @Title GetCheckinBonusStatus func (c *ApiController) GetCheckinBonusStatus() { if c.RequireSignedIn() { return diff --git a/controllers/favorites.go b/controllers/favorites.go index 6f121baf..8d46f95d 100644 --- a/controllers/favorites.go +++ b/controllers/favorites.go @@ -21,6 +21,9 @@ import ( "github.com/casbin/casnode/util" ) +// @router /add-favorites [post] +// @Tag Favorite API +// @Title AddFavorites func (c *ApiController) AddFavorites() { objectId := c.Input().Get("id") favoritesTypeStr := c.Input().Get("type") @@ -79,6 +82,9 @@ func (c *ApiController) AddFavorites() { c.ServeJSON() } +// @router /delete-favorites [post] +// @Tag Favorite API +// @Title DeleteFavorites func (c *ApiController) DeleteFavorites() { memberId := c.GetSessionUsername() objectId := c.Input().Get("id") @@ -114,6 +120,9 @@ func (c *ApiController) DeleteFavorites() { c.ServeJSON() } +// @router /get-favorites-status [get] +// @Tag Favorite API +// @Title GetFavoritesStatus func (c *ApiController) GetFavoritesStatus() { memberId := c.GetSessionUsername() objectId := c.Input().Get("id") @@ -132,6 +141,9 @@ func (c *ApiController) GetFavoritesStatus() { c.ServeJSON() } +// @router /get-favorites [get] +// @Tag Favorite API +// @Title GetFavorites func (c *ApiController) GetFavorites() { memberId := c.GetSessionUsername() favoritesTypeStr := c.Input().Get("type") @@ -176,6 +188,9 @@ func (c *ApiController) GetFavorites() { c.ServeJSON() } +// @router /get-account-favorite-num [get] +// @Tag Favorite API +// @Title GetAccountFavoriteNum func (c *ApiController) GetAccountFavoriteNum() { memberId := c.GetSessionUsername() diff --git a/controllers/file.go b/controllers/file.go index 550e9931..707d15e9 100644 --- a/controllers/file.go +++ b/controllers/file.go @@ -191,6 +191,9 @@ func (c *ApiController) UpdateFileDescribe() { c.ServeJSON() } +// @Title UploadFile +// @Tag File API +// @router /upload-file [post] func (c *ApiController) UploadFile() { if c.RequireSignedIn() { return @@ -210,6 +213,9 @@ func (c *ApiController) UploadFile() { c.ServeJSON() } +// @Title ModeratorUpload +// @Tag File API +// @router /upload-moderator [post] func (c *ApiController) ModeratorUpload() { if c.RequireSignedIn() { return @@ -234,6 +240,9 @@ func (c *ApiController) ModeratorUpload() { //resp := Response{Status: "ok", Msg: fileName, Data: fileUrl + timeStamp} } +// @Title UploadAvatar +// @Tag File API +// @router /upload-avatar [post] func (c *ApiController) UploadAvatar() { if c.RequireSignedIn() { return diff --git a/controllers/frontConf.go b/controllers/frontConf.go index 0d5bb146..c46378f6 100644 --- a/controllers/frontConf.go +++ b/controllers/frontConf.go @@ -24,6 +24,7 @@ import ( // @Description Get front confs by field // @Success 200 {array} object.FrontConf The Response object // @router /get-front-conf-by-field [get] +// @Tag FrontConf API func (c *ApiController) GetFrontConfByField() { field := c.Input().Get("field") @@ -35,6 +36,7 @@ func (c *ApiController) GetFrontConfByField() { // @Description Get all front confs // @Success 200 {array} array The Response object // @router /get-front-confs [get] +// @Tag FrontConf API func (c *ApiController) GetFrontConfs() { confs := make(map[string]string) conf := object.GetFrontConfs() @@ -47,6 +49,9 @@ func (c *ApiController) GetFrontConfs() { c.ServeJSON() } +// @router /update-front-conf [post] +// @Tag FrontConf API +// @Title UpdateFrontConf func (c *ApiController) UpdateFrontConf() { var confs []*object.FrontConf @@ -63,6 +68,9 @@ func (c *ApiController) UpdateFrontConf() { } +// @router /update-to-default-conf [post] +// @Tag FrontConf API +// @Title UpdateFrontConfToDefault func (c *ApiController) UpdateFrontConfToDefault() { if c.RequireAdmin() { diff --git a/controllers/hot.go b/controllers/hot.go index 77c02d93..f45086be 100644 --- a/controllers/hot.go +++ b/controllers/hot.go @@ -19,6 +19,9 @@ import ( "github.com/casbin/casnode/util" ) +// @Tag Hot API +// @Title ChangeExpiredDataStatus +// @router /update-expired-data [post] func (c *ApiController) ChangeExpiredDataStatus() { expiredNodeDate := util.GetTimeMonth(-object.NodeHitRecordExpiredTime) expiredTopicDate := util.GetTimeDay(-object.TopicHitRecordExpiredTime) @@ -30,6 +33,9 @@ func (c *ApiController) ChangeExpiredDataStatus() { c.ServeJSON() } +// @Tag Hot API +// @Title UpdateHotInfo +// @router /update-hot-info [post] func (c *ApiController) UpdateHotInfo() { var updateNodeNum int var updateTopicNum int diff --git a/controllers/info.go b/controllers/info.go index 2d30d2bd..26d366d7 100644 --- a/controllers/info.go +++ b/controllers/info.go @@ -20,6 +20,9 @@ import ( "github.com/casbin/casnode/object" ) +// @Tag Info API +// @Title GetCommunityHealth +// @router /get-community-health [get] func (c *ApiController) GetCommunityHealth() { var memberCount int var topicCount int @@ -52,6 +55,9 @@ func (c *ApiController) GetCommunityHealth() { c.ResponseOk(res) } +// @Tag Info API +// @Title GetForumVersion +// @router /get-forum-version [get] func (c *ApiController) GetForumVersion() { var resp Response @@ -63,6 +69,9 @@ func (c *ApiController) GetForumVersion() { c.ServeJSON() } +// @Tag Info API +// @Title GetOnlineNum +// @router /get-online-num [get] func (c *ApiController) GetOnlineNum() { onlineNum := object.GetOnlineMemberNum() highest := object.GetHighestOnlineNum() @@ -70,6 +79,9 @@ func (c *ApiController) GetOnlineNum() { c.ResponseOk(onlineNum, highest) } +// @Tag Info API +// @Title GetNodeNavigation +// @router /node-navigation [get] func (c *ApiController) GetNodeNavigation() { var resp Response diff --git a/controllers/member.go b/controllers/member.go index 037b003c..78e2c87a 100644 --- a/controllers/member.go +++ b/controllers/member.go @@ -25,6 +25,7 @@ import ( // @Param id query string true "id" // @Success 200 {object} auth.User The Response object // @router /get-member [get] +// @Tag Member API func (c *ApiController) GetMember() { id := c.Input().Get("id") @@ -35,6 +36,7 @@ func (c *ApiController) GetMember() { // @Description member editortype // @Success 200 {object} controllers.Response The Response object // @router /get-member-editor-type [get] +// @Tag Member API func (c *ApiController) GetMemberEditorType() { user := c.GetSessionUser() @@ -50,6 +52,7 @@ func (c *ApiController) GetMemberEditorType() { // @Description RankingRich // @Success 200 {array} auth.User The Response object // @router /get-ranking-rich [get] +// @Tag Member API func (c *ApiController) GetRankingRich() { users, err := object.GetRankingRich() if err != nil { @@ -60,6 +63,9 @@ func (c *ApiController) GetRankingRich() { c.ResponseOk(users) } +// @Tag Member API +// @Title UpdateMemberEditorType +// @router /update-member-editor-type [post] func (c *ApiController) UpdateMemberEditorType() { editorType := c.Input().Get("editorType") user := c.GetSessionUser() @@ -78,6 +84,9 @@ func (c *ApiController) UpdateMemberEditorType() { c.ResponseOk(affected) } +// @Tag Member API +// @Title UpdateMemberLanguage +// @router /update-member-language [post] func (c *ApiController) UpdateMemberLanguage() { language := c.Input().Get("language") @@ -108,6 +117,7 @@ func (c *ApiController) UpdateMemberLanguage() { // @Description MemberLanguage // @Success 200 {object} controllers.Response The Response object // @router /get-member-language [get] +// @Tag Member API func (c *ApiController) GetMemberLanguage() { user := c.GetSessionUser() diff --git a/controllers/node.go b/controllers/node.go index ff37a5cf..8525bbe7 100644 --- a/controllers/node.go +++ b/controllers/node.go @@ -21,11 +21,17 @@ import ( "github.com/casbin/casnode/util" ) +// @Title GetNodes +// @router /get-nodes [get] +// @Tag Node API func (c *ApiController) GetNodes() { c.Data["json"] = object.GetNodes() c.ServeJSON() } +// @Title GetNodesAdmin +// @router /get-nodes-admin [get] +// @Tag Node API func (c *ApiController) GetNodesAdmin() { res := []adminNodeInfo{} nodes := object.GetNodes() @@ -42,6 +48,9 @@ func (c *ApiController) GetNodesAdmin() { c.ServeJSON() } +// @Title GetNode +// @router /get-node [get] +// @Tag Node API func (c *ApiController) GetNode() { id := c.Input().Get("id") @@ -49,6 +58,10 @@ func (c *ApiController) GetNode() { c.ServeJSON() } + +// @Title UpdateNode +// @router /update-node [post] +// @Tag Node API func (c *ApiController) UpdateNode() { if c.RequireAdmin() { return @@ -65,6 +78,9 @@ func (c *ApiController) UpdateNode() { c.ResponseOk(res) } +// @Title AddNode +// @router /add-node [post] +// @Tag Node API func (c *ApiController) AddNode() { if c.RequireAdmin() { return @@ -97,6 +113,9 @@ func (c *ApiController) AddNode() { c.ResponseOk(res) } +// @Title DeleteNode +// @router /delete-node [post] +// @Tag Node API func (c *ApiController) DeleteNode() { if c.RequireAdmin() { return @@ -108,11 +127,17 @@ func (c *ApiController) DeleteNode() { c.ServeJSON() } +// @Title GetNodesNum +// @router /get-nodes-num [get] +// @Tag Node API func (c *ApiController) GetNodesNum() { num := object.GetNodesNum() c.ResponseOk(num) } +// @Title GetNodeInfo +// @router /get-node-info [get] +// @Tag Node API func (c *ApiController) GetNodeInfo() { id := c.Input().Get("id") @@ -128,6 +153,9 @@ func (c *ApiController) GetNodeFromTab() { c.ResponseOk(nodes) } +// @Title GetNodeRelation +// @router /get-node-relation [get] +// @Tag Node API func (c *ApiController) GetNodeRelation() { id := c.Input().Get("id") @@ -135,6 +163,9 @@ func (c *ApiController) GetNodeRelation() { c.ResponseOk(res) } +// @Tag Node API +// @router /get-latest-node [get] +// @Title GetLatestNode func (c *ApiController) GetLatestNode() { limitStr := c.Input().Get("limit") defaultLimit := object.LatestNodeNum @@ -150,6 +181,9 @@ func (c *ApiController) GetLatestNode() { c.ResponseOk(res) } +// @Title GetHotNod +// @Tag Node API +// @router /get-hot-node [get] func (c *ApiController) GetHotNode() { limitStr := c.Input().Get("limit") defaultLimit := object.HotNodeNum @@ -165,6 +199,9 @@ func (c *ApiController) GetHotNode() { c.ResponseOk(res) } +// @Title AddNodeBrowseCount +// @Tag Node API +// @router /add-node-browse-record [post] func (c *ApiController) AddNodeBrowseCount() { nodeId := c.Input().Get("id") @@ -187,6 +224,9 @@ func (c *ApiController) AddNodeBrowseCount() { c.ServeJSON() } +// @Title AddNodeModerators +// @Tag Node API +// @router /add-node-moderators [post] func (c *ApiController) AddNodeModerators() { if c.RequireAdmin() { return @@ -212,6 +252,9 @@ func (c *ApiController) AddNodeModerators() { } } +// @Title DeleteNodeModerators +// @Tag Node API +// @router /delete-node-moderators [post] func (c *ApiController) DeleteNodeModerators() { if c.RequireAdmin() { return diff --git a/controllers/notifications.go b/controllers/notifications.go index 3af994ec..31f3303e 100644 --- a/controllers/notifications.go +++ b/controllers/notifications.go @@ -55,6 +55,9 @@ func (c *ApiController) AddNotification() { c.ServeJSON() } +// @router /get-notifications [get] +// @Title GetNotifications +// @Tag Notification API func (c *ApiController) GetNotifications() { memberId := c.GetSessionUsername() limitStr := c.Input().Get("limit") @@ -77,6 +80,9 @@ func (c *ApiController) GetNotifications() { c.ResponseOk(res, num) } +// @Title DeleteNotification +// @router /delete-notifications [get] +// @Tag Notification API func (c *ApiController) DeleteNotification() { id := c.Input().Get("id") @@ -84,6 +90,9 @@ func (c *ApiController) DeleteNotification() { c.ResponseOk(res) } +// @Title GetUnreadNotificationNum +// @router /get-unread-notification-num [post] +// @Tag Notification API func (c *ApiController) GetUnreadNotificationNum() { memberId := c.GetSessionUsername() @@ -91,6 +100,9 @@ func (c *ApiController) GetUnreadNotificationNum() { c.ResponseOk(res) } +// @Title UpdateReadStatus +// @router /update-read-status [post] +// @Tag Notification API func (c *ApiController) UpdateReadStatus() { memberId := c.GetSessionUsername() diff --git a/controllers/plane.go b/controllers/plane.go index 231d40be..ff05f6b0 100644 --- a/controllers/plane.go +++ b/controllers/plane.go @@ -26,11 +26,17 @@ func (c *ApiController) GetPlanes() { c.ServeJSON() } +// @Title GetPlanesAdmin +// @router /get-planes-admin [get] +// @Tag Plane API func (c *ApiController) GetPlanesAdmin() { c.Data["json"] = object.GetAllPlanes() c.ServeJSON() } +// @Title GetPlane +// @router /get-plane [get] +// @Tag Plane API func (c *ApiController) GetPlane() { id := c.Input().Get("id") @@ -38,6 +44,9 @@ func (c *ApiController) GetPlane() { c.ServeJSON() } +// @Title GetPlaneAdmin +// @router /get-planes-admin [get] +// @Tag Plane API func (c *ApiController) GetPlaneAdmin() { id := c.Input().Get("id") @@ -45,10 +54,16 @@ func (c *ApiController) GetPlaneAdmin() { c.ServeJSON() } +// @Title GetPlaneLis +// @router /get-plane-list [get] +// @Tag Plane API func (c *ApiController) GetPlaneList() { c.ResponseOk(object.GetPlaneList()) } +// @Title AddPlane +// @router /add-plane [post] +// @Tag Plane API func (c *ApiController) AddPlane() { if c.RequireAdmin() { return @@ -90,6 +105,9 @@ func (c *ApiController) AddPlane() { c.ResponseOk(res) } +// @Title UpdatePlane +// @router /update-plane [post] +// @Tag Plane API func (c *ApiController) UpdatePlane() { if c.RequireAdmin() { return @@ -117,6 +135,9 @@ func (c *ApiController) UpdatePlane() { c.ResponseOk(res) } +// @Title DeletePlane +// @router /delete-plane [post] +// @Tag Plane API func (c *ApiController) DeletePlane() { if c.RequireAdmin() { return diff --git a/controllers/poster.go b/controllers/poster.go index d6aff612..85fd8d12 100644 --- a/controllers/poster.go +++ b/controllers/poster.go @@ -24,6 +24,7 @@ import ( // @Description update poster message // @Success 200 {object} controllers.Response The Response object // @router /update-poster [post] +// @Tag Poster API func (c *ApiController) UpdatePoster() { if c.RequireAdmin() { return @@ -45,6 +46,7 @@ func (c *ApiController) UpdatePoster() { // @Param id query string true "id" // @Success 200 {object} object.Poster The Response object // @router /read-poster [get] +// @Tag Poster API func (c *ApiController) ReadPoster() { n := c.Input().Get("id") res := object.GetPoster(n) diff --git a/controllers/reply.go b/controllers/reply.go index 8207d060..51ed943e 100644 --- a/controllers/reply.go +++ b/controllers/reply.go @@ -27,6 +27,9 @@ type NewReplyForm struct { TopicId int `json:"topicId"` } +// @Title GetReplies +// @Tag Reply API +// @router /get-replies [get] func (c *ApiController) GetReplies() { user := c.GetSessionUser() @@ -64,6 +67,9 @@ func (c *ApiController) GetReplies() { c.ServeJSON() } +// @Title GetAllRepliesOfTopic +// @Tag Reply API +// @router /get-replies-of-topic [get] func (c *ApiController) GetAllRepliesOfTopic() { topicId := util.ParseInt(c.Input().Get("topicId")) replies := object.GetRepliesOfTopic(topicId) @@ -71,6 +77,9 @@ func (c *ApiController) GetAllRepliesOfTopic() { c.ServeJSON() } +// @Title GetReply +// @Tag Reply API +// @router /get-reply [get] func (c *ApiController) GetReply() { idStr := c.Input().Get("id") @@ -80,6 +89,9 @@ func (c *ApiController) GetReply() { c.ServeJSON() } +// @Title GetReplyWithDetails +// @Tag Reply API +// @router /get-reply-with-details [get] func (c *ApiController) GetReplyWithDetails() { user := c.GetSessionUser() @@ -91,6 +103,9 @@ func (c *ApiController) GetReplyWithDetails() { c.ServeJSON() } +// @Title UpdateReply +// @Tag Reply API +// @router /update-reply [post] func (c *ApiController) UpdateReply() { idStr := c.Input().Get("id") @@ -105,6 +120,9 @@ func (c *ApiController) UpdateReply() { c.ServeJSON() } +// @Title AddReply +// @Tag Reply API +// @router /add-reply [post] func (c *ApiController) AddReply() { if c.RequireSignedIn() { return @@ -155,6 +173,9 @@ func (c *ApiController) AddReply() { c.ResponseOk(affected) } +// @Title DeleteReply +// @Tag Reply API +// @router /delete-reply [post] func (c *ApiController) DeleteReply() { id := util.ParseInt(c.Input().Get("id")) @@ -183,6 +204,9 @@ func (c *ApiController) DeleteReply() { c.ResponseOk(affected) } +// @Title GetLatestReplies +// @Tag Reply API +// @router /get-latest-replies [get] func (c *ApiController) GetLatestReplies() { id := c.Input().Get("id") limitStr := c.Input().Get("limit") @@ -211,8 +235,10 @@ func (c *ApiController) GetLatestReplies() { c.Data["json"] = object.GetLatestReplies(id, limit, offset) c.ServeJSON() } - -// GetRepliesNum gets member's all replies num. +// @Title GetMemberRepliesNum +// @Tag Reply API +// @router /get-member-replies-num [get] +// @Description GetRepliesNum gets member's all replies num. func (c *ApiController) GetMemberRepliesNum() { id := c.Input().Get("id") diff --git a/controllers/search.go b/controllers/search.go index 9465ab31..56642cac 100644 --- a/controllers/search.go +++ b/controllers/search.go @@ -16,6 +16,9 @@ package controllers import "github.com/casbin/casnode/object" +// @Title Search +// @router /search +// @Tag Search API func (c *ApiController) Search() { keyword := c.Input().Get("keyword") diff --git a/controllers/sensitive.go b/controllers/sensitive.go index 58179382..a211202f 100644 --- a/controllers/sensitive.go +++ b/controllers/sensitive.go @@ -18,6 +18,9 @@ import ( "github.com/casbin/casnode/object" ) +// @Title AddSensitive +// @router /add-sensitive [get] +// @Tag Seneistive API func (c *ApiController) AddSensitive() { if c.RequireAdmin() { return @@ -42,6 +45,9 @@ func (c *ApiController) AddSensitive() { c.ResponseOk() } +// @Title DelSensitive +// @router /del-sensitive [get] +// @Tag Seneistive API func (c *ApiController) DelSensitive() { if c.RequireAdmin() { return @@ -62,6 +68,9 @@ func (c *ApiController) DelSensitive() { c.ResponseOk() } +// @Title GetSensitive +// @router /get-sensitive [get] +// @Tag Seneistive API func (c *ApiController) GetSensitive() { c.Data["json"] = object.GetSensitiveWords() c.ServeJSON() diff --git a/controllers/tab.go b/controllers/tab.go index aa90a37f..b168eb14 100644 --- a/controllers/tab.go +++ b/controllers/tab.go @@ -21,21 +21,33 @@ import ( "github.com/casbin/casnode/util" ) +// @router /get-tabs [get] +// @Title GetTabs +// @Tag Tab API func (c *ApiController) GetTabs() { c.Data["json"] = object.GetHomePageTabs() c.ServeJSON() } +// @router /get-all-tabs [get] +// @Title GetAllTabs +// @Tag Tab API func (c *ApiController) GetAllTabs() { c.Data["json"] = object.GetAllTabs() c.ServeJSON() } +// @router /get-tabs-admin [get] +// @Title GetAllTabsAdmin +// @Tag Tab API func (c *ApiController) GetAllTabsAdmin() { c.Data["json"] = object.GetAllTabsAdmin() c.ServeJSON() } +// @router /get-tabs-admin [get] +// @Title GetTabAdmin +// @Tag Tab API func (c *ApiController) GetTabAdmin() { id := c.Input().Get("id") @@ -43,6 +55,9 @@ func (c *ApiController) GetTabAdmin() { c.ServeJSON() } +// @router /get-tabs-admin [get] +// @Title AddTab +// @Tag Tab API func (c *ApiController) AddTab() { if c.RequireAdmin() { return @@ -82,6 +97,9 @@ func (c *ApiController) AddTab() { c.ResponseOk(res) } +// @router /update-tab [post] +// @Title UpdateTab +// @Tag Tab API func (c *ApiController) UpdateTab() { if c.RequireAdmin() { return @@ -108,6 +126,9 @@ func (c *ApiController) UpdateTab() { c.ResponseOk(res) } +// @router /delete-tab [post] +// @Title DeleteTab +// @Tag Tab API func (c *ApiController) DeleteTab() { if c.RequireAdmin() { return @@ -120,6 +141,9 @@ func (c *ApiController) DeleteTab() { c.ServeJSON() } +// @router /get-tab-with-nodes [get] +// @Title GetTabWithNodes +// @Tag Tab API func (c *ApiController) GetTabWithNodes() { id := c.Input().Get("id") diff --git a/controllers/topic.go b/controllers/topic.go index e609bba7..346128b0 100644 --- a/controllers/topic.go +++ b/controllers/topic.go @@ -41,6 +41,7 @@ type NewTopicForm struct { // @Param page query string true "offset" // @Success 200 {array} object.TopicWithAvatar The Response object // @router /get-topics [get] +// @Tag Topic API func (c *ApiController) GetTopics() { limitStr := c.Input().Get("limit") pageStr := c.Input().Get("page") @@ -77,6 +78,7 @@ func (c *ApiController) GetTopics() { // @Param fcs query string true "sort: favorite count" // @Success 200 {object} controllers.Response The Response object // @router /get-topics-admin [get] +// @Tag Topic API func (c *ApiController) GetTopicsAdmin() { limitStr := c.Input().Get("limit") pageStr := c.Input().Get("page") @@ -118,6 +120,7 @@ func (c *ApiController) GetTopicsAdmin() { // @Param id query string true "id" // @Success 200 {object} object.TopicWithAvatar The Response object // @router /get-topic [get] +// @Tag Topic API func (c *ApiController) GetTopic() { user := c.GetSessionUser() @@ -143,6 +146,7 @@ func (c *ApiController) GetTopic() { //@Param id query string true "id" // @Success 200 {object} object.AdminTopicInfo The Response object // @router /get-topic-admin [get] +// @Tag Topic API func (c *ApiController) GetTopicAdmin() { idStr := c.Input().Get("id") @@ -171,6 +175,7 @@ func (c *ApiController) UpdateTopic() { // @Param form body controllers.NewTopicForm true "topic info" // @Success 200 {object} controllers.Response The Response object // @router /add-topic [post] +// @Tag Topic API func (c *ApiController) AddTopic() { if c.RequireSignedIn() { return @@ -266,6 +271,7 @@ func (c *ApiController) AddTopic() { // @Param pic formData string true "the picture base64 code" // @Success 200 {object} _controllers.Response The Response object // @router /upload-topic-pic [post] +// @Tag Topic API func (c *ApiController) UploadTopicPic() { if c.RequireSignedIn() { return @@ -294,6 +300,7 @@ func (c *ApiController) UploadTopicPic() { // @Param id query string true "topic id" // @Success 200 {bool} bool Delete success or failure // @router /delete-topic [post] +// @Tag Topic API func (c *ApiController) DeleteTopic() { idStr := c.Input().Get("id") user := c.GetSessionUser() @@ -315,6 +322,7 @@ func (c *ApiController) DeleteTopic() { // @Description get the total number of topics // @Success 200 {int} int The topic nums // @router /get-topics-num [get] +// @Tag Topic API func (c *ApiController) GetTopicsNum() { c.Data["json"] = object.GetTopicNum() c.ServeJSON() @@ -328,6 +336,7 @@ func (c *ApiController) GetTopicsNum() { // @Param page query string true "page offset" // @Success 200 {array} object.Topic The Response object // @router /get-all-created-topics [get] +// @Tag Topic API func (c *ApiController) GetAllCreatedTopics() { author := c.Input().Get("id") tab := c.Input().Get("tab") @@ -362,6 +371,7 @@ func (c *ApiController) GetAllCreatedTopics() { // @Param id query string true "member id" // @Success 200 {int} int topics count // @router /get-created-topics-num [get] +// @Tag Topic API func (c *ApiController) GetCreatedTopicsNum() { memberId := c.Input().Get("id") @@ -376,6 +386,7 @@ func (c *ApiController) GetCreatedTopicsNum() { // @Param page query string true "page offset" // @Success 200 {array} object.NodeTopic The Response object // @router /get-topics-by-node [get] +// @Tag Topic API func (c *ApiController) GetTopicsByNode() { nodeId := c.Input().Get("node-id") limitStr := c.Input().Get("limit") @@ -404,6 +415,7 @@ func (c *ApiController) GetTopicsByNode() { // @Param page query string true "page offset" // @Success 200 {array} object.NodeTopic The Response object // @router /get-topics-by-tag [get] +// @Tag Topic API func (c *ApiController) GetTopicsByTag() { tagId := c.Input().Get("tag-id") limitStr := c.Input().Get("limit") @@ -430,6 +442,7 @@ func (c *ApiController) GetTopicsByTag() { // @Param id query string true "topic id" // @Success 200 {object} controller.Response The Response object // @router /add-topic-hit-count [post] +// @Tag Topic API func (c *ApiController) AddTopicHitCount() { topicIdStr := c.Input().Get("id") @@ -462,6 +475,7 @@ func (c *ApiController) AddTopicHitCount() { // @Param page query string true "page offset" // @Success 200 {array} object.TopicWithAvatar The Response object // @router /get-topics-by-tab [get] +// @Tag Topic API func (c *ApiController) GetTopicsByTab() { tabId := c.Input().Get("tab-id") limitStr := c.Input().Get("limit") @@ -488,6 +502,7 @@ func (c *ApiController) GetTopicsByTab() { // @Param id query string true "topicId" // @Success 200 {object} controller.Response The Response object // @router /add-topic-browse-record [post] +// @Tag Topic API func (c *ApiController) AddTopicBrowseCount() { topicId := c.Input().Get("id") @@ -515,6 +530,7 @@ func (c *ApiController) AddTopicBrowseCount() { // @Param limit query string true "limit size" // @Success 200 {object} controller.Response The Response object // @router /get-hot-topic [get] +// @Tag Topic API func (c *ApiController) GetHotTopic() { limitStr := c.Input().Get("limit") defaultLimit := object.HotTopicNum @@ -541,6 +557,7 @@ func (c *ApiController) GetHotTopic() { // @Param limit query string true "limit size" // @Success 200 {object} controller.Response The Response object // @router /get-hot-topic [get] +// @Tag Topic API func (c *ApiController) GetSortedTopics() { limitStr := c.Input().Get("limit") pageStr := c.Input().Get("page") @@ -572,6 +589,7 @@ func (c *ApiController) GetSortedTopics() { // @Param updateTopicNode body controllers.updateTopicNode true "topic node info" // @Success 200 {object} controllers.Response The Response object // @router /update-topic-node [post] +// @Tag Topic API func (c *ApiController) UpdateTopicNode() { if c.RequireSignedIn() { return @@ -614,6 +632,7 @@ func (c *ApiController) UpdateTopicNode() { // @Param editType query string true "edit Type" // @Success 200 {object} controllers.Response The Response object // @router /edit-content [post] +// @Tag Topic API func (c *ApiController) EditContent() { if c.RequireSignedIn() { return @@ -675,6 +694,9 @@ func (c *ApiController) EditContent() { c.ServeJSON() } +// @Title TranslateTopic +// @router /translate-topic [get] +// @Tag Topic API func (c *ApiController) TranslateTopic() { topicIdStr := c.Input().Get("id") targetLang := c.Input().Get("target") @@ -705,6 +727,7 @@ func (c *ApiController) TranslateTopic() { // @Param id query string true "id" // @Success 200 {object} controllers.Response The Response object // @router /top-topic [post] +// @Tag Topic API func (c *ApiController) TopTopic() { if c.RequireSignedIn() { return @@ -750,6 +773,7 @@ func (c *ApiController) TopTopic() { // @Param id query string true "id" // @Success 200 {object} controllers.Response The Response object // @router /cancel-top-topic [post] +// @Tag Topic API func (c *ApiController) CancelTopTopic() { if c.RequireSignedIn() { return @@ -778,6 +802,9 @@ func (c *ApiController) CancelTopTopic() { c.ServeJSON() } +// @Title GetTopicByUrlPathAndTitle +// @router /get-topic-by-urlpath-and-title [get] +// @Tag Topic API func (c *ApiController) GetTopicByUrlPathAndTitle() { urlPath := c.Input().Get("urlPath") title := c.Input().Get("title") diff --git a/controllers/translator.go b/controllers/translator.go index 302e0f09..431d7070 100644 --- a/controllers/translator.go +++ b/controllers/translator.go @@ -6,6 +6,9 @@ import ( "github.com/casbin/casnode/object" ) +// @router /update-translator [post] +// @Title UpdateTranslator +// @Tag Translator API func (c *ApiController) UpdateTranslator() { if c.RequireAdmin() { return @@ -21,6 +24,9 @@ func (c *ApiController) UpdateTranslator() { c.ResponseOk() } +// @router /add-translator [post] +// @Title AddTranslator +// @Tag Translator API func (c *ApiController) AddTranslator() { if c.RequireAdmin() { return @@ -52,6 +58,9 @@ func (c *ApiController) AddTranslator() { } } +// @router /get-translator [get] +// @Title GetTranslator +// @Tag Translator API func (c *ApiController) GetTranslator() { id := c.Input().Get("id") res := object.GetTranslator(id) @@ -67,6 +76,9 @@ func (c *ApiController) GetEnableTranslator() { c.ServeJSON() } +// @router /visible-translator [get] +// @Title VisibleTranslator +// @Tag Translator API func (c *ApiController) VisibleTranslator() { c.ResponseOk(false) @@ -78,6 +90,9 @@ func (c *ApiController) VisibleTranslator() { } } +// @router /del-translator [post] +// @Title DelTranslator +// @Tag Translator API func (c *ApiController) DelTranslator() { id := c.Input().Get("id") resp := Response{Status: "fail", Msg: "Delete translator failed"} diff --git a/go.mod b/go.mod index 2ebaf7d8..7b759fbe 100644 --- a/go.mod +++ b/go.mod @@ -4,9 +4,7 @@ go 1.16 require ( github.com/adamzy/cedar-go v0.0.0-20170805034717-80a9c64b256d // indirect - github.com/aliyun/aliyun-oss-go-sdk v2.1.10+incompatible github.com/astaxie/beego v1.12.3 - github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect github.com/casbin/google-groups-crawler v0.1.3 github.com/casdoor/casdoor-go-sdk v0.1.5 github.com/chromedp/chromedp v0.6.10 @@ -22,7 +20,6 @@ require ( github.com/mozillazg/go-slugify v0.2.0 github.com/mozillazg/go-unidecode v0.1.1 // indirect github.com/prometheus/client_golang v1.11.0 // indirect - github.com/satori/go.uuid v1.2.0 // indirect github.com/shiena/ansicolor v0.0.0-20200904210342-c7312218db18 // indirect github.com/stretchr/testify v1.7.0 // indirect golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect diff --git a/go.sum b/go.sum index 9bd50112..284036d3 100644 --- a/go.sum +++ b/go.sum @@ -289,8 +289,6 @@ github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3x github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg= github.com/shiena/ansicolor v0.0.0-20200904210342-c7312218db18 h1:DAYUYH5869yV94zvCES9F51oYtN5oGlwjxJJz7ZCnik= github.com/shiena/ansicolor v0.0.0-20200904210342-c7312218db18/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg= @@ -464,7 +462,6 @@ golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/object/reply.go b/object/reply.go index 82c60287..edcf2681 100644 --- a/object/reply.go +++ b/object/reply.go @@ -49,7 +49,10 @@ func GetReplyCount() int { return int(count) } -// GetReplies returns more information about reply of a topic. +// @Title GetReplies +// @router /get-replies [get] +// @Description GetReplies returns more information about reply of a topic. +// @Tag Reply API func GetReplies(topicId int, user *auth.User, limit int, page int) ([]*ReplyWithAvatar, int) { replies := []*ReplyWithAvatar{} realPage := page diff --git a/swagger/swagger.json b/swagger/swagger.json index fbe6f296..c507e509 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -1,36 +1,78 @@ { "swagger": "2.0", "info": { - "title": "Casnode API", - "description": "Documentation of Casdoor API", - "version": "1.0.0", - "contact": { - "email": "admin@casbin.org" - } + "contact": {} }, "basePath": "/api", "paths": { - "/add-member": { + "/add-favorites": { "post": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Favorite API" ], - "description": "AddMember", - "operationId": "ApiController.AddMember", - "responses": { - "200": { - "description": "The Response object", - "schema": { - "$ref": "#/definitions/controllers.Response" - } - } - } + "operationId": "ApiController.AddFavorites" + } + }, + "/add-node": { + "post": { + "tags": [ + "Node API" + ], + "operationId": "ApiController.AddNode" + } + }, + "/add-node-browse-record": { + "post": { + "tags": [ + "Node API" + ], + "operationId": "ApiController.AddNodeBrowseCount" + } + }, + "/add-node-moderators": { + "post": { + "tags": [ + "Node API" + ], + "operationId": "ApiController.AddNodeModerators" + } + }, + "/add-plane": { + "post": { + "tags": [ + "Plane API" + ], + "operationId": "ApiController.AddPlane" + } + }, + "/add-reply": { + "post": { + "tags": [ + "Reply API" + ], + "operationId": "ApiController.AddReply" + } + }, + "/add-sensitive": { + "get": { + "tags": [ + "Seneistive API" + ], + "operationId": "ApiController.AddSensitive" + } + }, + "/add-thanks": { + "post": { + "tags": [ + "Balance API" + ], + "operationId": "ApiController.AddThanks" } }, "/add-topic": { "post": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Topic API" ], "description": "add one topic", "operationId": "ApiController.AddTopic", @@ -58,7 +100,7 @@ "/add-topic-browse-record": { "post": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Topic API" ], "description": "add topic browse count", "operationId": "ApiController.AddTopicBrowseCount", @@ -84,7 +126,7 @@ "/add-topic-hit-count": { "post": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Topic API" ], "description": "add topic hit count,together with node", "operationId": "ApiController.AddTopicHitCount", @@ -107,10 +149,18 @@ } } }, + "/add-translator": { + "post": { + "tags": [ + "Translator API" + ], + "operationId": "ApiController.AddTranslator" + } + }, "/cancel-top-topic": { "post": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Topic API" ], "description": "cancels top topic according to the topType in the url.", "operationId": "ApiController.CancelTopTopic", @@ -133,10 +183,82 @@ } } }, + "/del-sensitive": { + "get": { + "tags": [ + "Seneistive API" + ], + "operationId": "ApiController.DelSensitive" + } + }, + "/del-translator": { + "post": { + "tags": [ + "Translator API" + ], + "operationId": "ApiController.DelTranslator" + } + }, + "/delete-favorites": { + "post": { + "tags": [ + "Favorite API" + ], + "operationId": "ApiController.DeleteFavorites" + } + }, + "/delete-node": { + "post": { + "tags": [ + "Node API" + ], + "operationId": "ApiController.DeleteNode" + } + }, + "/delete-node-moderators": { + "post": { + "tags": [ + "Node API" + ], + "operationId": "ApiController.DeleteNodeModerators" + } + }, + "/delete-notifications": { + "get": { + "tags": [ + "Notification API" + ], + "operationId": "ApiController.DeleteNotification" + } + }, + "/delete-plane": { + "post": { + "tags": [ + "Plane API" + ], + "operationId": "ApiController.DeletePlane" + } + }, + "/delete-reply": { + "post": { + "tags": [ + "Reply API" + ], + "operationId": "ApiController.DeleteReply" + } + }, + "/delete-tab": { + "post": { + "tags": [ + "Tab API" + ], + "operationId": "ApiController.DeleteTab" + } + }, "/delete-topic": { "post": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Topic API" ], "description": "delete a topic by id", "operationId": "ApiController.DeleteTopic", @@ -159,7 +281,7 @@ "/edit-content": { "post": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Topic API" ], "description": "edit content", "operationId": "ApiController.EditContent", @@ -185,7 +307,7 @@ "/get-account": { "get": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Account API" ], "description": "Get current account", "operationId": "ApiController.GetAccount", @@ -199,10 +321,18 @@ } } }, + "/get-account-favorite-num": { + "get": { + "tags": [ + "Favorite API" + ], + "operationId": "ApiController.GetAccountFavoriteNum" + } + }, "/get-all-created-topics": { "get": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Topic API" ], "description": "get all created topics", "operationId": "ApiController.GetAllCreatedTopics", @@ -249,10 +379,50 @@ } } }, + "/get-all-tabs": { + "get": { + "tags": [ + "Tab API" + ], + "operationId": "ApiController.GetAllTabs" + } + }, + "/get-checkin-bonus": { + "get": { + "tags": [ + "Balance API" + ], + "operationId": "ApiController.GetCheckinBonus" + } + }, + "/get-checkin-bonus-status": { + "get": { + "tags": [ + "Balance API" + ], + "operationId": "ApiController.GetCheckinBonusStatus" + } + }, + "/get-community-health": { + "get": { + "tags": [ + "Info API" + ], + "operationId": "ApiController.GetCommunityHealth" + } + }, + "/get-consumption-record": { + "get": { + "tags": [ + "Balance API" + ], + "operationId": "ApiController.GetConsumptionRecord" + } + }, "/get-created-topics-num": { "get": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Topic API" ], "description": "get created topics count", "operationId": "ApiController.GetCreatedTopicsNum", @@ -272,10 +442,34 @@ } } }, + "/get-favorites": { + "get": { + "tags": [ + "Favorite API" + ], + "operationId": "ApiController.GetFavorites" + } + }, + "/get-favorites-status": { + "get": { + "tags": [ + "Favorite API" + ], + "operationId": "ApiController.GetFavoritesStatus" + } + }, + "/get-forum-version": { + "get": { + "tags": [ + "Info API" + ], + "operationId": "ApiController.GetForumVersion" + } + }, "/get-front-conf-by-field": { "get": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "FrontConf API" ], "description": "Get front confs by field", "operationId": "ApiController.GetFrontConfsByField", @@ -295,7 +489,7 @@ "/get-front-confs": { "get": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "FrontConf API" ], "description": "Get all front confs", "operationId": "ApiController.GetFrontConfs", @@ -312,14 +506,57 @@ } } }, + "/get-hot-node": { + "get": { + "tags": [ + "Node API" + ], + "operationId": "ApiController.GetHotNod" + } + }, "/get-hot-topic": { "get": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Topic API" ], - "description": "get hot topic", - "operationId": "ApiController.GetHotTopic", + "description": "get sorted topics", + "operationId": "ApiController.GetSortedTopics", "parameters": [ + { + "in": "query", + "name": "lps", + "description": "sort: last reply count", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "hs", + "description": "sort: hot", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "fcs", + "description": "sort: favorite count", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "cts", + "description": "sort: created time", + "required": true, + "type": "string" + }, + { + "in": "query", + "name": "page", + "description": "offset", + "required": true, + "type": "string" + }, { "in": "query", "name": "limit", @@ -338,10 +575,26 @@ } } }, + "/get-latest-node": { + "get": { + "tags": [ + "Node API" + ], + "operationId": "ApiController.GetLatestNode" + } + }, + "/get-latest-replies": { + "get": { + "tags": [ + "Reply API" + ], + "operationId": "ApiController.GetLatestReplies" + } + }, "/get-member": { "get": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Member API" ], "description": "get member by id", "operationId": "ApiController.GetMember", @@ -358,65 +611,16 @@ "200": { "description": "The Response object", "schema": { - "$ref": "#/definitions/object.Member" + "$ref": "#/definitions/auth.User" } } } } }, - "/get-member-admin": { - "get": { - "tags": [ - "github.com/casbin/casnode/controllersApiController" - ], - "description": "get member for admin by id", - "operationId": "ApiController.GetMemberAdmin", - "parameters": [ - { - "in": "query", - "name": "id", - "description": "id", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "The Response object", - "schema": { - "$ref": "#/definitions/object.AdminMemberInfo" - } - } - } - } - }, - "/get-member-avatar": { - "get": { - "tags": [ - "github.com/casbin/casnode/controllersApiController" - ], - "description": "get member avatar by id", - "operationId": "ApiController.GetMemberAvatar", - "parameters": [ - { - "in": "query", - "name": "id", - "description": "id", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { - "description": "{string} string Avatarlink" - } - } - } - }, "/get-member-editor-type": { "get": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Member API" ], "description": "member editortype", "operationId": "ApiController.GetMemberEditorType", @@ -433,7 +637,7 @@ "/get-member-language": { "get": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Member API" ], "description": "MemberLanguage", "operationId": "ApiController.GetMemberLanguage", @@ -447,88 +651,107 @@ } } }, - "/get-members": { + "/get-member-replies-num": { "get": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Reply API" ], - "description": "Get all members", - "operationId": "ApiController.GetMembers", - "responses": { - "200": { - "description": "The Response object", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/object.Member" - } - } - } - } + "description": "GetRepliesNum gets member's all replies num.", + "operationId": "ApiController.GetMemberRepliesNum" } }, - "/get-members-admin": { + "/get-node": { "get": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Node API" ], - "description": "Get admin allmembers", - "operationId": "ApiController.GetMembersAdmin", - "parameters": [ - { - "in": "query", - "name": "limit", - "description": "limit", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "query", - "name": "page", - "description": "page", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "query", - "name": "un", - "description": "search: username", - "required": true, - "type": "string" - }, - { - "in": "query", - "name": "cs", - "description": "sort: created time", - "required": true, - "type": "integer", - "format": "int64" - }, - { - "in": "query", - "name": "us", - "description": "sort: username", - "required": true, - "type": "integer", - "format": "int64" - } + "operationId": "ApiController.GetNode" + } + }, + "/get-node-info": { + "get": { + "tags": [ + "Node API" ], - "responses": { - "200": { - "description": "The Response object", - "schema": { - "$ref": "#/definitions/controllers.api_controller.Response" - } - } - } + "operationId": "ApiController.GetNodeInfo" + } + }, + "/get-node-relation": { + "get": { + "tags": [ + "Node API" + ], + "operationId": "ApiController.GetNodeRelation" + } + }, + "/get-nodes": { + "get": { + "tags": [ + "Node API" + ], + "operationId": "ApiController.GetNodes" + } + }, + "/get-nodes-admin": { + "get": { + "tags": [ + "Node API" + ], + "operationId": "ApiController.GetNodesAdmin" + } + }, + "/get-nodes-num": { + "get": { + "tags": [ + "Node API" + ], + "operationId": "ApiController.GetNodesNum" + } + }, + "/get-notifications": { + "get": { + "tags": [ + "Notification API" + ], + "operationId": "ApiController.GetNotifications" + } + }, + "/get-online-num": { + "get": { + "tags": [ + "Info API" + ], + "operationId": "ApiController.GetOnlineNum" + } + }, + "/get-plane": { + "get": { + "tags": [ + "Plane API" + ], + "operationId": "ApiController.GetPlane" + } + }, + "/get-plane-list": { + "get": { + "tags": [ + "Plane API" + ], + "operationId": "ApiController.GetPlaneLis" + } + }, + "/get-planes-admin": { + "get": { + "tags": [ + "Plane API" + ], + "operationId": "ApiController.GetPlaneAdmin" } }, "/get-ranking-rich": { "get": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Member API" ], "description": "RankingRich", "operationId": "ApiController.GetRankingRich", @@ -538,17 +761,81 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/object.Member" + "$ref": "#/definitions/auth.User" } } } } } }, + "/get-replies": { + "get": { + "tags": [ + "Reply API" + ], + "operationId": "ApiController.GetReplies" + } + }, + "/get-replies-of-topic": { + "get": { + "tags": [ + "Reply API" + ], + "operationId": "ApiController.GetAllRepliesOfTopic" + } + }, + "/get-reply": { + "get": { + "tags": [ + "Reply API" + ], + "operationId": "ApiController.GetReply" + } + }, + "/get-reply-with-details": { + "get": { + "tags": [ + "Reply API" + ], + "operationId": "ApiController.GetReplyWithDetails" + } + }, + "/get-sensitive": { + "get": { + "tags": [ + "Seneistive API" + ], + "operationId": "ApiController.GetSensitive" + } + }, + "/get-tab-with-nodes": { + "get": { + "tags": [ + "Tab API" + ], + "operationId": "ApiController.GetTabWithNodes" + } + }, + "/get-tabs": { + "get": { + "tags": [ + "Tab API" + ], + "operationId": "ApiController.GetTabs" + } + }, + "/get-tabs-admin": { + "get": { + "tags": [ + "Tab API" + ], + "operationId": "ApiController.AddTab" + } + }, "/get-topic": { "get": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Topic API" ], "description": "get one topic by id", "operationId": "ApiController.GetTopic", @@ -574,7 +861,7 @@ "/get-topic-admin": { "get": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Topic API" ], "description": "get topic for admin by id", "operationId": "ApiController.GetTopicAdmin", @@ -597,10 +884,18 @@ } } }, + "/get-topic-by-urlpath-and-title": { + "get": { + "tags": [ + "Topic API" + ], + "operationId": "ApiController.GetTopicByUrlPathAndTitle" + } + }, "/get-topics": { "get": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Topic API" ], "description": "get current topics", "operationId": "ApiController.GetTopics", @@ -636,7 +931,7 @@ "/get-topics-admin": { "get": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Topic API" ], "description": "get topics for admin", "operationId": "ApiController.GetTopicsAdmin", @@ -739,7 +1034,7 @@ "/get-topics-by-node": { "get": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Topic API" ], "description": "get topics by node", "operationId": "ApiController.GetTopicsByNode", @@ -782,7 +1077,7 @@ "/get-topics-by-tab": { "get": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Topic API" ], "description": "get topics by tab", "operationId": "ApiController.GetTopicsByTab", @@ -825,7 +1120,7 @@ "/get-topics-by-tag": { "get": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Topic API" ], "description": "get topics by tag", "operationId": "ApiController.GetTopicsByTag", @@ -868,7 +1163,7 @@ "/get-topics-num": { "get": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Topic API" ], "description": "get the total number of topics", "operationId": "ApiController.GetTopicsNum", @@ -879,10 +1174,34 @@ } } }, + "/get-translator": { + "get": { + "tags": [ + "Translator API" + ], + "operationId": "ApiController.GetTranslator" + } + }, + "/get-unread-notification-num": { + "post": { + "tags": [ + "Notification API" + ], + "operationId": "ApiController.GetUnreadNotificationNum" + } + }, + "/node-navigation": { + "get": { + "tags": [ + "Info API" + ], + "operationId": "ApiController.GetNodeNavigation" + } + }, "/read-poster": { "get": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Poster API" ], "description": "get poster by id", "operationId": "ApiController.ReadPoster", @@ -905,10 +1224,18 @@ } } }, + "/search": { + "get": { + "tags": [ + "Search API" + ], + "operationId": "ApiController.Search" + } + }, "/signin": { "post": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Account API" ], "description": "sign in as a member", "operationId": "ApiController.Signin", @@ -941,7 +1268,7 @@ "/signout": { "post": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Account API" ], "description": "sign out the current member", "operationId": "ApiController.Signout", @@ -958,7 +1285,7 @@ "/top-topic": { "post": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Topic API" ], "description": "tops topic according to the topType in the url.", "operationId": "ApiController.TopTopic", @@ -981,10 +1308,74 @@ } } }, + "/translate-topic": { + "get": { + "tags": [ + "Topic API" + ], + "operationId": "ApiController.TranslateTopic" + } + }, + "/update-expired-data": { + "post": { + "tags": [ + "Hot API" + ], + "operationId": "ApiController.ChangeExpiredDataStatus" + } + }, + "/update-front-conf": { + "post": { + "tags": [ + "FrontConf API" + ], + "operationId": "ApiController.UpdateFrontConf" + } + }, + "/update-hot-info": { + "post": { + "tags": [ + "Hot API" + ], + "operationId": "ApiController.UpdateHotInfo" + } + }, + "/update-member-editor-type": { + "post": { + "tags": [ + "Member API" + ], + "operationId": "ApiController.UpdateMemberEditorType" + } + }, + "/update-member-language": { + "post": { + "tags": [ + "Member API" + ], + "operationId": "ApiController.UpdateMemberLanguage" + } + }, + "/update-node": { + "post": { + "tags": [ + "Node API" + ], + "operationId": "ApiController.UpdateNode" + } + }, + "/update-plane": { + "post": { + "tags": [ + "Plane API" + ], + "operationId": "ApiController.UpdatePlane" + } + }, "/update-poster": { "post": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Poster API" ], "description": "update poster message", "operationId": "ApiController.UpdatePoster", @@ -998,10 +1389,42 @@ } } }, + "/update-read-status": { + "post": { + "tags": [ + "Notification API" + ], + "operationId": "ApiController.UpdateReadStatus" + } + }, + "/update-reply": { + "post": { + "tags": [ + "Reply API" + ], + "operationId": "ApiController.UpdateReply" + } + }, + "/update-tab": { + "post": { + "tags": [ + "Tab API" + ], + "operationId": "ApiController.UpdateTab" + } + }, + "/update-to-default-conf": { + "post": { + "tags": [ + "FrontConf API" + ], + "operationId": "ApiController.UpdateFrontConfToDefault" + } + }, "/update-topic-node": { "post": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Topic API" ], "description": "update the topic node", "operationId": "ApiController.UpdateTopicNode", @@ -1026,10 +1449,42 @@ } } }, + "/update-translator": { + "post": { + "tags": [ + "Translator API" + ], + "operationId": "ApiController.UpdateTranslator" + } + }, + "/upload-avatar": { + "post": { + "tags": [ + "File API" + ], + "operationId": "ApiController.UploadAvatar" + } + }, + "/upload-file": { + "post": { + "tags": [ + "File API" + ], + "operationId": "ApiController.UploadFile" + } + }, + "/upload-moderator": { + "post": { + "tags": [ + "File API" + ], + "operationId": "ApiController.ModeratorUpload" + } + }, "/upload-topic-pic": { "post": { "tags": [ - "github.com/casbin/casnode/controllersApiController" + "Topic API" ], "description": "upload topic picture", "operationId": "ApiController.UploadTopicPic", @@ -1051,14 +1506,22 @@ } } } + }, + "/visible-translator": { + "get": { + "tags": [ + "Translator API" + ], + "operationId": "ApiController.VisibleTranslator" + } } }, "definitions": { - "1278.0xc000185860.false": { + "87715.0xc0004fa000.false": { "title": "false", "type": "object" }, - "1312.0xc000185890.false": { + "87749.0xc0004fa030.false": { "title": "false", "type": "object" }, @@ -1070,6 +1533,10 @@ "title": "array", "type": "object" }, + "auth.User": { + "title": "User", + "type": "object" + }, "controller.Response": { "title": "Response", "type": "object" @@ -1103,10 +1570,10 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/1278.0xc000185860.false" + "$ref": "#/definitions/87715.0xc0004fa000.false" }, "data2": { - "$ref": "#/definitions/1312.0xc000185890.false" + "$ref": "#/definitions/87749.0xc0004fa030.false" }, "msg": { "type": "string" @@ -1121,10 +1588,10 @@ "type": "object", "properties": { "data": { - "$ref": "#/definitions/1278.0xc000185860.false" + "$ref": "#/definitions/87715.0xc0004fa000.false" }, "data2": { - "$ref": "#/definitions/1312.0xc000185890.false" + "$ref": "#/definitions/87749.0xc0004fa030.false" }, "msg": { "type": "string" @@ -1150,126 +1617,6 @@ } } }, - "object.AdminMemberInfo": { - "title": "AdminMemberInfo", - "type": "object", - "properties": { - "WechatVerifiedTime": { - "type": "string" - }, - "areaCode": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "company": { - "type": "string" - }, - "companyTitle": { - "type": "string" - }, - "createdTime": { - "type": "string" - }, - "editorType": { - "type": "string" - }, - "email": { - "type": "string" - }, - "emailReminder": { - "type": "boolean" - }, - "emailVerifiedTime": { - "type": "string" - }, - "fileQuota": { - "type": "integer", - "format": "int64" - }, - "fileUploadNum": { - "type": "integer", - "format": "int64" - }, - "githubAccount": { - "type": "string" - }, - "googleAccount": { - "type": "string" - }, - "id": { - "type": "string" - }, - "isModerator": { - "type": "boolean" - }, - "language": { - "type": "string" - }, - "latestLogin": { - "type": "string" - }, - "location": { - "type": "string" - }, - "no": { - "type": "integer", - "format": "int64" - }, - "onlineStatus": { - "type": "boolean" - }, - "phone": { - "type": "string" - }, - "phoneVerifiedTime": { - "type": "string" - }, - "qqAccount": { - "type": "string" - }, - "qqVerifiedTime": { - "type": "string" - }, - "ranking": { - "type": "integer", - "format": "int64" - }, - "renameQuota": { - "type": "integer", - "format": "int64" - }, - "replyNum": { - "type": "integer", - "format": "int64" - }, - "score": { - "type": "integer", - "format": "int64" - }, - "status": { - "type": "integer", - "format": "int64" - }, - "tagline": { - "type": "string" - }, - "topicNum": { - "type": "integer", - "format": "int64" - }, - "weChatAccount": { - "type": "string" - }, - "website": { - "type": "string" - } - } - }, "object.AdminTopicInfo": { "title": "AdminTopicInfo", "type": "object", @@ -1286,6 +1633,10 @@ "deleted": { "type": "boolean" }, + "downCount": { + "type": "integer", + "format": "int64" + }, "editorType": { "type": "string" }, @@ -1308,6 +1659,12 @@ "type": "integer", "format": "int64" }, + "ip": { + "type": "string" + }, + "isHidden": { + "type": "boolean" + }, "lastReplyTime": { "type": "string" }, @@ -1327,6 +1684,12 @@ "type": "integer", "format": "int64" }, + "state": { + "type": "string" + }, + "tabId": { + "type": "string" + }, "tabTopTime": { "type": "string" }, @@ -1363,107 +1726,6 @@ } } }, - "object.Member": { - "title": "Member", - "type": "object", - "properties": { - "WechatVerifiedTime": { - "type": "string" - }, - "areaCode": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "bio": { - "type": "string" - }, - "company": { - "type": "string" - }, - "companyTitle": { - "type": "string" - }, - "createdTime": { - "type": "string" - }, - "editorType": { - "type": "string" - }, - "email": { - "type": "string" - }, - "emailReminder": { - "type": "boolean" - }, - "emailVerifiedTime": { - "type": "string" - }, - "fileQuota": { - "type": "integer", - "format": "int64" - }, - "githubAccount": { - "type": "string" - }, - "googleAccount": { - "type": "string" - }, - "id": { - "type": "string" - }, - "isModerator": { - "type": "boolean" - }, - "language": { - "type": "string" - }, - "location": { - "type": "string" - }, - "no": { - "type": "integer", - "format": "int64" - }, - "onlineStatus": { - "type": "boolean" - }, - "phone": { - "type": "string" - }, - "phoneVerifiedTime": { - "type": "string" - }, - "qqAccount": { - "type": "string" - }, - "qqVerifiedTime": { - "type": "string" - }, - "ranking": { - "type": "integer", - "format": "int64" - }, - "renameQuota": { - "type": "integer", - "format": "int64" - }, - "score": { - "type": "integer", - "format": "int64" - }, - "tagline": { - "type": "string" - }, - "weChatAccount": { - "type": "string" - }, - "website": { - "type": "string" - } - } - }, "object.NodeTopic": { "title": "NodeTopic", "type": "object", @@ -1484,6 +1746,10 @@ "createdTime": { "type": "string" }, + "downCount": { + "type": "integer", + "format": "int64" + }, "editable": { "type": "boolean" }, @@ -1509,6 +1775,12 @@ "type": "integer", "format": "int64" }, + "ip": { + "type": "string" + }, + "isHidden": { + "type": "boolean" + }, "lastReplyTime": { "type": "string" }, @@ -1531,6 +1803,12 @@ "type": "integer", "format": "int64" }, + "state": { + "type": "string" + }, + "tabId": { + "type": "string" + }, "tabTopTime": { "type": "string" }, @@ -1589,6 +1867,10 @@ "createdTime": { "type": "string" }, + "downCount": { + "type": "integer", + "format": "int64" + }, "editorType": { "type": "string" }, @@ -1611,6 +1893,12 @@ "type": "integer", "format": "int64" }, + "ip": { + "type": "string" + }, + "isHidden": { + "type": "boolean" + }, "lastReplyTime": { "type": "string" }, @@ -1630,6 +1918,12 @@ "type": "integer", "format": "int64" }, + "state": { + "type": "string" + }, + "tabId": { + "type": "string" + }, "tabTopTime": { "type": "string" }, @@ -1667,6 +1961,10 @@ "createdTime": { "type": "string" }, + "downCount": { + "type": "integer", + "format": "int64" + }, "editable": { "type": "boolean" }, @@ -1692,6 +1990,12 @@ "type": "integer", "format": "int64" }, + "ip": { + "type": "string" + }, + "isHidden": { + "type": "boolean" + }, "lastReplyTime": { "type": "string" }, @@ -1714,6 +2018,12 @@ "type": "integer", "format": "int64" }, + "state": { + "type": "string" + }, + "tabId": { + "type": "string" + }, "tabTopTime": { "type": "string" }, diff --git a/swagger/swagger.yml b/swagger/swagger.yml index ad3ec0a4..f5c5cd97 100644 --- a/swagger/swagger.yml +++ b/swagger/swagger.yml @@ -1,27 +1,51 @@ swagger: "2.0" -info: - title: Casnode API - description: Documentation of Casdoor API - version: 1.0.0 - contact: - email: admin@casbin.org +info: {} basePath: /api paths: - /add-member: + /add-favorites: post: tags: - - github.com/casbin/casnode/controllersApiController - description: AddMember - operationId: ApiController.AddMember - responses: - "200": - description: The Response object - schema: - $ref: '#/definitions/controllers.Response' + - Favorite API + operationId: ApiController.AddFavorites + /add-node: + post: + tags: + - Node API + operationId: ApiController.AddNode + /add-node-browse-record: + post: + tags: + - Node API + operationId: ApiController.AddNodeBrowseCount + /add-node-moderators: + post: + tags: + - Node API + operationId: ApiController.AddNodeModerators + /add-plane: + post: + tags: + - Plane API + operationId: ApiController.AddPlane + /add-reply: + post: + tags: + - Reply API + operationId: ApiController.AddReply + /add-sensitive: + get: + tags: + - Seneistive API + operationId: ApiController.AddSensitive + /add-thanks: + post: + tags: + - Balance API + operationId: ApiController.AddThanks /add-topic: post: tags: - - github.com/casbin/casnode/controllersApiController + - Topic API description: add one topic operationId: ApiController.AddTopic parameters: @@ -39,7 +63,7 @@ paths: /add-topic-browse-record: post: tags: - - github.com/casbin/casnode/controllersApiController + - Topic API description: add topic browse count operationId: ApiController.AddTopicBrowseCount parameters: @@ -56,7 +80,7 @@ paths: /add-topic-hit-count: post: tags: - - github.com/casbin/casnode/controllersApiController + - Topic API description: add topic hit count,together with node operationId: ApiController.AddTopicHitCount parameters: @@ -70,10 +94,15 @@ paths: description: The Response object schema: $ref: '#/definitions/controller.Response' + /add-translator: + post: + tags: + - Translator API + operationId: ApiController.AddTranslator /cancel-top-topic: post: tags: - - github.com/casbin/casnode/controllersApiController + - Topic API description: cancels top topic according to the topType in the url. operationId: ApiController.CancelTopTopic parameters: @@ -87,10 +116,55 @@ paths: description: The Response object schema: $ref: '#/definitions/controllers.Response' + /del-sensitive: + get: + tags: + - Seneistive API + operationId: ApiController.DelSensitive + /del-translator: + post: + tags: + - Translator API + operationId: ApiController.DelTranslator + /delete-favorites: + post: + tags: + - Favorite API + operationId: ApiController.DeleteFavorites + /delete-node: + post: + tags: + - Node API + operationId: ApiController.DeleteNode + /delete-node-moderators: + post: + tags: + - Node API + operationId: ApiController.DeleteNodeModerators + /delete-notifications: + get: + tags: + - Notification API + operationId: ApiController.DeleteNotification + /delete-plane: + post: + tags: + - Plane API + operationId: ApiController.DeletePlane + /delete-reply: + post: + tags: + - Reply API + operationId: ApiController.DeleteReply + /delete-tab: + post: + tags: + - Tab API + operationId: ApiController.DeleteTab /delete-topic: post: tags: - - github.com/casbin/casnode/controllersApiController + - Topic API description: delete a topic by id operationId: ApiController.DeleteTopic parameters: @@ -105,7 +179,7 @@ paths: /edit-content: post: tags: - - github.com/casbin/casnode/controllersApiController + - Topic API description: edit content operationId: ApiController.EditContent parameters: @@ -122,7 +196,7 @@ paths: /get-account: get: tags: - - github.com/casbin/casnode/controllersApiController + - Account API description: Get current account operationId: ApiController.GetAccount responses: @@ -130,10 +204,15 @@ paths: description: The Response object schema: $ref: '#/definitions/controllers.api_controller.Response' + /get-account-favorite-num: + get: + tags: + - Favorite API + operationId: ApiController.GetAccountFavoriteNum /get-all-created-topics: get: tags: - - github.com/casbin/casnode/controllersApiController + - Topic API description: get all created topics operationId: ApiController.GetAllCreatedTopics parameters: @@ -164,10 +243,35 @@ paths: type: array items: $ref: '#/definitions/object.Topic' + /get-all-tabs: + get: + tags: + - Tab API + operationId: ApiController.GetAllTabs + /get-checkin-bonus: + get: + tags: + - Balance API + operationId: ApiController.GetCheckinBonus + /get-checkin-bonus-status: + get: + tags: + - Balance API + operationId: ApiController.GetCheckinBonusStatus + /get-community-health: + get: + tags: + - Info API + operationId: ApiController.GetCommunityHealth + /get-consumption-record: + get: + tags: + - Balance API + operationId: ApiController.GetConsumptionRecord /get-created-topics-num: get: tags: - - github.com/casbin/casnode/controllersApiController + - Topic API description: get created topics count operationId: ApiController.GetCreatedTopicsNum parameters: @@ -179,10 +283,25 @@ paths: responses: "200": description: '{int} int topics count' + /get-favorites: + get: + tags: + - Favorite API + operationId: ApiController.GetFavorites + /get-favorites-status: + get: + tags: + - Favorite API + operationId: ApiController.GetFavoritesStatus + /get-forum-version: + get: + tags: + - Info API + operationId: ApiController.GetForumVersion /get-front-conf-by-field: get: tags: - - github.com/casbin/casnode/controllersApiController + - FrontConf API description: Get front confs by field operationId: ApiController.GetFrontConfsByField responses: @@ -195,7 +314,7 @@ paths: /get-front-confs: get: tags: - - github.com/casbin/casnode/controllersApiController + - FrontConf API description: Get all front confs operationId: ApiController.GetFrontConfs responses: @@ -205,13 +324,43 @@ paths: type: array items: $ref: '#/definitions/array' + /get-hot-node: + get: + tags: + - Node API + operationId: ApiController.GetHotNod /get-hot-topic: get: tags: - - github.com/casbin/casnode/controllersApiController - description: get hot topic - operationId: ApiController.GetHotTopic + - Topic API + description: get sorted topics + operationId: ApiController.GetSortedTopics parameters: + - in: query + name: lps + description: 'sort: last reply count' + required: true + type: string + - in: query + name: hs + description: 'sort: hot' + required: true + type: string + - in: query + name: fcs + description: 'sort: favorite count' + required: true + type: string + - in: query + name: cts + description: 'sort: created time' + required: true + type: string + - in: query + name: page + description: offset + required: true + type: string - in: query name: limit description: limit size @@ -222,10 +371,20 @@ paths: description: The Response object schema: $ref: '#/definitions/controller.Response' + /get-latest-node: + get: + tags: + - Node API + operationId: ApiController.GetLatestNode + /get-latest-replies: + get: + tags: + - Reply API + operationId: ApiController.GetLatestReplies /get-member: get: tags: - - github.com/casbin/casnode/controllersApiController + - Member API description: get member by id operationId: ApiController.GetMember parameters: @@ -238,43 +397,11 @@ paths: "200": description: The Response object schema: - $ref: '#/definitions/object.Member' - /get-member-admin: - get: - tags: - - github.com/casbin/casnode/controllersApiController - description: get member for admin by id - operationId: ApiController.GetMemberAdmin - parameters: - - in: query - name: id - description: id - required: true - type: string - responses: - "200": - description: The Response object - schema: - $ref: '#/definitions/object.AdminMemberInfo' - /get-member-avatar: - get: - tags: - - github.com/casbin/casnode/controllersApiController - description: get member avatar by id - operationId: ApiController.GetMemberAvatar - parameters: - - in: query - name: id - description: id - required: true - type: string - responses: - "200": - description: '{string} string Avatarlink' + $ref: '#/definitions/auth.User' /get-member-editor-type: get: tags: - - github.com/casbin/casnode/controllersApiController + - Member API description: member editortype operationId: ApiController.GetMemberEditorType responses: @@ -285,7 +412,7 @@ paths: /get-member-language: get: tags: - - github.com/casbin/casnode/controllersApiController + - Member API description: MemberLanguage operationId: ApiController.GetMemberLanguage responses: @@ -293,64 +420,71 @@ paths: description: The Response object schema: $ref: '#/definitions/controllers.Response' - /get-members: + /get-member-replies-num: get: tags: - - github.com/casbin/casnode/controllersApiController - description: Get all members - operationId: ApiController.GetMembers - responses: - "200": - description: The Response object - schema: - type: array - items: - $ref: '#/definitions/object.Member' - /get-members-admin: + - Reply API + description: GetRepliesNum gets member's all replies num. + operationId: ApiController.GetMemberRepliesNum + /get-node: get: tags: - - github.com/casbin/casnode/controllersApiController - description: Get admin allmembers - operationId: ApiController.GetMembersAdmin - parameters: - - in: query - name: limit - description: limit - required: true - type: integer - format: int64 - - in: query - name: page - description: page - required: true - type: integer - format: int64 - - in: query - name: un - description: 'search: username' - required: true - type: string - - in: query - name: cs - description: 'sort: created time' - required: true - type: integer - format: int64 - - in: query - name: us - description: 'sort: username' - required: true - type: integer - format: int64 - responses: - "200": - description: The Response object - schema: - $ref: '#/definitions/controllers.api_controller.Response' + - Node API + operationId: ApiController.GetNode + /get-node-info: + get: + tags: + - Node API + operationId: ApiController.GetNodeInfo + /get-node-relation: + get: + tags: + - Node API + operationId: ApiController.GetNodeRelation + /get-nodes: + get: + tags: + - Node API + operationId: ApiController.GetNodes + /get-nodes-admin: + get: + tags: + - Node API + operationId: ApiController.GetNodesAdmin + /get-nodes-num: + get: + tags: + - Node API + operationId: ApiController.GetNodesNum + /get-notifications: + get: + tags: + - Notification API + operationId: ApiController.GetNotifications + /get-online-num: + get: + tags: + - Info API + operationId: ApiController.GetOnlineNum + /get-plane: + get: + tags: + - Plane API + operationId: ApiController.GetPlane + /get-plane-list: + get: + tags: + - Plane API + operationId: ApiController.GetPlaneLis + /get-planes-admin: + get: + tags: + - Plane API + operationId: ApiController.GetPlaneAdmin /get-ranking-rich: get: tags: - - github.com/casbin/casnode/controllersApiController + - Member API description: RankingRich operationId: ApiController.GetRankingRich responses: @@ -359,11 +493,51 @@ paths: schema: type: array items: - $ref: '#/definitions/object.Member' + $ref: '#/definitions/auth.User' + /get-replies: + get: + tags: + - Reply API + operationId: ApiController.GetReplies + /get-replies-of-topic: + get: + tags: + - Reply API + operationId: ApiController.GetAllRepliesOfTopic + /get-reply: + get: + tags: + - Reply API + operationId: ApiController.GetReply + /get-reply-with-details: + get: + tags: + - Reply API + operationId: ApiController.GetReplyWithDetails + /get-sensitive: + get: + tags: + - Seneistive API + operationId: ApiController.GetSensitive + /get-tab-with-nodes: + get: + tags: + - Tab API + operationId: ApiController.GetTabWithNodes + /get-tabs: + get: + tags: + - Tab API + operationId: ApiController.GetTabs + /get-tabs-admin: + get: + tags: + - Tab API + operationId: ApiController.AddTab /get-topic: get: tags: - - github.com/casbin/casnode/controllersApiController + - Topic API description: get one topic by id operationId: ApiController.GetTopic parameters: @@ -380,7 +554,7 @@ paths: /get-topic-admin: get: tags: - - github.com/casbin/casnode/controllersApiController + - Topic API description: get topic for admin by id operationId: ApiController.GetTopicAdmin parameters: @@ -394,10 +568,15 @@ paths: description: The Response object schema: $ref: '#/definitions/object.AdminTopicInfo' + /get-topic-by-urlpath-and-title: + get: + tags: + - Topic API + operationId: ApiController.GetTopicByUrlPathAndTitle /get-topics: get: tags: - - github.com/casbin/casnode/controllersApiController + - Topic API description: get current topics operationId: ApiController.GetTopics parameters: @@ -421,7 +600,7 @@ paths: /get-topics-admin: get: tags: - - github.com/casbin/casnode/controllersApiController + - Topic API description: get topics for admin operationId: ApiController.GetTopicsAdmin parameters: @@ -493,7 +672,7 @@ paths: /get-topics-by-node: get: tags: - - github.com/casbin/casnode/controllersApiController + - Topic API description: get topics by node operationId: ApiController.GetTopicsByNode parameters: @@ -522,7 +701,7 @@ paths: /get-topics-by-tab: get: tags: - - github.com/casbin/casnode/controllersApiController + - Topic API description: get topics by tab operationId: ApiController.GetTopicsByTab parameters: @@ -551,7 +730,7 @@ paths: /get-topics-by-tag: get: tags: - - github.com/casbin/casnode/controllersApiController + - Topic API description: get topics by tag operationId: ApiController.GetTopicsByTag parameters: @@ -580,16 +759,31 @@ paths: /get-topics-num: get: tags: - - github.com/casbin/casnode/controllersApiController + - Topic API description: get the total number of topics operationId: ApiController.GetTopicsNum responses: "200": description: '{int} int The topic nums' + /get-translator: + get: + tags: + - Translator API + operationId: ApiController.GetTranslator + /get-unread-notification-num: + post: + tags: + - Notification API + operationId: ApiController.GetUnreadNotificationNum + /node-navigation: + get: + tags: + - Info API + operationId: ApiController.GetNodeNavigation /read-poster: get: tags: - - github.com/casbin/casnode/controllersApiController + - Poster API description: get poster by id operationId: ApiController.ReadPoster parameters: @@ -603,10 +797,15 @@ paths: description: The Response object schema: $ref: '#/definitions/object.Poster' + /search: + get: + tags: + - Search API + operationId: ApiController.Search /signin: post: tags: - - github.com/casbin/casnode/controllersApiController + - Account API description: sign in as a member operationId: ApiController.Signin parameters: @@ -628,7 +827,7 @@ paths: /signout: post: tags: - - github.com/casbin/casnode/controllersApiController + - Account API description: sign out the current member operationId: ApiController.Signout responses: @@ -639,7 +838,7 @@ paths: /top-topic: post: tags: - - github.com/casbin/casnode/controllersApiController + - Topic API description: tops topic according to the topType in the url. operationId: ApiController.TopTopic parameters: @@ -653,10 +852,50 @@ paths: description: The Response object schema: $ref: '#/definitions/controllers.Response' + /translate-topic: + get: + tags: + - Topic API + operationId: ApiController.TranslateTopic + /update-expired-data: + post: + tags: + - Hot API + operationId: ApiController.ChangeExpiredDataStatus + /update-front-conf: + post: + tags: + - FrontConf API + operationId: ApiController.UpdateFrontConf + /update-hot-info: + post: + tags: + - Hot API + operationId: ApiController.UpdateHotInfo + /update-member-editor-type: + post: + tags: + - Member API + operationId: ApiController.UpdateMemberEditorType + /update-member-language: + post: + tags: + - Member API + operationId: ApiController.UpdateMemberLanguage + /update-node: + post: + tags: + - Node API + operationId: ApiController.UpdateNode + /update-plane: + post: + tags: + - Plane API + operationId: ApiController.UpdatePlane /update-poster: post: tags: - - github.com/casbin/casnode/controllersApiController + - Poster API description: update poster message operationId: ApiController.UpdatePoster responses: @@ -664,10 +903,30 @@ paths: description: The Response object schema: $ref: '#/definitions/controllers.Response' + /update-read-status: + post: + tags: + - Notification API + operationId: ApiController.UpdateReadStatus + /update-reply: + post: + tags: + - Reply API + operationId: ApiController.UpdateReply + /update-tab: + post: + tags: + - Tab API + operationId: ApiController.UpdateTab + /update-to-default-conf: + post: + tags: + - FrontConf API + operationId: ApiController.UpdateFrontConfToDefault /update-topic-node: post: tags: - - github.com/casbin/casnode/controllersApiController + - Topic API description: update the topic node operationId: ApiController.UpdateTopicNode parameters: @@ -682,10 +941,30 @@ paths: description: The Response object schema: $ref: '#/definitions/controllers.Response' + /update-translator: + post: + tags: + - Translator API + operationId: ApiController.UpdateTranslator + /upload-avatar: + post: + tags: + - File API + operationId: ApiController.UploadAvatar + /upload-file: + post: + tags: + - File API + operationId: ApiController.UploadFile + /upload-moderator: + post: + tags: + - File API + operationId: ApiController.ModeratorUpload /upload-topic-pic: post: tags: - - github.com/casbin/casnode/controllersApiController + - Topic API description: upload topic picture operationId: ApiController.UploadTopicPic parameters: @@ -699,19 +978,27 @@ paths: description: The Response object schema: $ref: '#/definitions/_controllers.Response' + /visible-translator: + get: + tags: + - Translator API + operationId: ApiController.VisibleTranslator definitions: _controllers.Response: title: Response type: object - 1278.0xc000185860.false: + 87715.0xc0004fa000.false: title: "false" type: object - 1312.0xc000185890.false: + 87749.0xc0004fa030.false: title: "false" type: object array: title: array type: object + auth.User: + title: User + type: object controller.Response: title: Response type: object @@ -736,9 +1023,9 @@ definitions: type: object properties: data: - $ref: '#/definitions/1278.0xc000185860.false' + $ref: '#/definitions/87715.0xc0004fa000.false' data2: - $ref: '#/definitions/1312.0xc000185890.false' + $ref: '#/definitions/87749.0xc0004fa030.false' msg: type: string status: @@ -748,9 +1035,9 @@ definitions: type: object properties: data: - $ref: '#/definitions/1278.0xc000185860.false' + $ref: '#/definitions/87715.0xc0004fa000.false' data2: - $ref: '#/definitions/1312.0xc000185890.false' + $ref: '#/definitions/87749.0xc0004fa030.false' msg: type: string status: @@ -766,89 +1053,6 @@ definitions: type: string nodeName: type: string - object.AdminMemberInfo: - title: AdminMemberInfo - type: object - properties: - WechatVerifiedTime: - type: string - areaCode: - type: string - avatar: - type: string - bio: - type: string - company: - type: string - companyTitle: - type: string - createdTime: - type: string - editorType: - type: string - email: - type: string - emailReminder: - type: boolean - emailVerifiedTime: - type: string - fileQuota: - type: integer - format: int64 - fileUploadNum: - type: integer - format: int64 - githubAccount: - type: string - googleAccount: - type: string - id: - type: string - isModerator: - type: boolean - language: - type: string - latestLogin: - type: string - location: - type: string - "no": - type: integer - format: int64 - onlineStatus: - type: boolean - phone: - type: string - phoneVerifiedTime: - type: string - qqAccount: - type: string - qqVerifiedTime: - type: string - ranking: - type: integer - format: int64 - renameQuota: - type: integer - format: int64 - replyNum: - type: integer - format: int64 - score: - type: integer - format: int64 - status: - type: integer - format: int64 - tagline: - type: string - topicNum: - type: integer - format: int64 - weChatAccount: - type: string - website: - type: string object.AdminTopicInfo: title: AdminTopicInfo type: object @@ -861,6 +1065,9 @@ definitions: type: string deleted: type: boolean + downCount: + type: integer + format: int64 editorType: type: string favoriteCount: @@ -877,6 +1084,10 @@ definitions: id: type: integer format: int64 + ip: + type: string + isHidden: + type: boolean lastReplyTime: type: string lastReplyUser: @@ -890,6 +1101,10 @@ definitions: replyCount: type: integer format: int64 + state: + type: string + tabId: + type: string tabTopTime: type: string tags: @@ -913,75 +1128,6 @@ definitions: type: string Value: type: string - object.Member: - title: Member - type: object - properties: - WechatVerifiedTime: - type: string - areaCode: - type: string - avatar: - type: string - bio: - type: string - company: - type: string - companyTitle: - type: string - createdTime: - type: string - editorType: - type: string - email: - type: string - emailReminder: - type: boolean - emailVerifiedTime: - type: string - fileQuota: - type: integer - format: int64 - githubAccount: - type: string - googleAccount: - type: string - id: - type: string - isModerator: - type: boolean - language: - type: string - location: - type: string - "no": - type: integer - format: int64 - onlineStatus: - type: boolean - phone: - type: string - phoneVerifiedTime: - type: string - qqAccount: - type: string - qqVerifiedTime: - type: string - ranking: - type: integer - format: int64 - renameQuota: - type: integer - format: int64 - score: - type: integer - format: int64 - tagline: - type: string - weChatAccount: - type: string - website: - type: string object.NodeTopic: title: NodeTopic type: object @@ -997,6 +1143,9 @@ definitions: format: int64 createdTime: type: string + downCount: + type: integer + format: int64 editable: type: boolean editorType: @@ -1015,6 +1164,10 @@ definitions: id: type: integer format: int64 + ip: + type: string + isHidden: + type: boolean lastReplyTime: type: string lastReplyUser: @@ -1030,6 +1183,10 @@ definitions: replyCount: type: integer format: int64 + state: + type: string + tabId: + type: string tabTopTime: type: string tags: @@ -1069,6 +1226,9 @@ definitions: type: string createdTime: type: string + downCount: + type: integer + format: int64 editorType: type: string favoriteCount: @@ -1085,6 +1245,10 @@ definitions: id: type: integer format: int64 + ip: + type: string + isHidden: + type: boolean lastReplyTime: type: string lastReplyUser: @@ -1098,6 +1262,10 @@ definitions: replyCount: type: integer format: int64 + state: + type: string + tabId: + type: string tabTopTime: type: string tags: @@ -1123,6 +1291,9 @@ definitions: type: string createdTime: type: string + downCount: + type: integer + format: int64 editable: type: boolean editorType: @@ -1141,6 +1312,10 @@ definitions: id: type: integer format: int64 + ip: + type: string + isHidden: + type: boolean lastReplyTime: type: string lastReplyUser: @@ -1156,6 +1331,10 @@ definitions: replyCount: type: integer format: int64 + state: + type: string + tabId: + type: string tabTopTime: type: string tags: