router.go 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. // SiYuan - Build Your Eternal Digital Garden
  2. // Copyright (c) 2020-present, b3log.org
  3. //
  4. // This program is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU Affero General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU Affero General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU Affero General Public License
  15. // along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. package api
  17. import (
  18. "github.com/gin-gonic/gin"
  19. "github.com/siyuan-note/siyuan/kernel/model"
  20. )
  21. func ServeAPI(ginServer *gin.Engine) {
  22. // 不需要鉴权
  23. ginServer.Handle("GET", "/api/system/bootProgress", bootProgress)
  24. ginServer.Handle("POST", "/api/system/bootProgress", bootProgress)
  25. ginServer.Handle("GET", "/api/system/version", version)
  26. ginServer.Handle("POST", "/api/system/version", version)
  27. ginServer.Handle("POST", "/api/system/currentTime", currentTime)
  28. ginServer.Handle("POST", "/api/system/uiproc", addUIProcess)
  29. ginServer.Handle("POST", "/api/system/loginAuth", model.LoginAuth)
  30. ginServer.Handle("POST", "/api/system/logoutAuth", model.LogoutAuth)
  31. ginServer.Handle("GET", "/api/system/getCaptcha", model.GetCaptcha)
  32. // 需要鉴权
  33. ginServer.Handle("POST", "/api/system/getEmojiConf", model.CheckAuth, getEmojiConf)
  34. ginServer.Handle("POST", "/api/system/setAccessAuthCode", model.CheckAuth, setAccessAuthCode)
  35. ginServer.Handle("POST", "/api/system/setNetworkServe", model.CheckAuth, setNetworkServe)
  36. ginServer.Handle("POST", "/api/system/setUploadErrLog", model.CheckAuth, setUploadErrLog)
  37. ginServer.Handle("POST", "/api/system/setGoogleAnalytics", model.CheckAuth, setGoogleAnalytics)
  38. ginServer.Handle("POST", "/api/system/setDownloadInstallPkg", model.CheckAuth, setDownloadInstallPkg)
  39. ginServer.Handle("POST", "/api/system/setNetworkProxy", model.CheckAuth, setNetworkProxy)
  40. ginServer.Handle("POST", "/api/system/setWorkspaceDir", model.CheckAuth, setWorkspaceDir)
  41. ginServer.Handle("POST", "/api/system/listWorkspaceDirs", model.CheckAuth, listWorkspaceDirs)
  42. ginServer.Handle("POST", "/api/system/setAppearanceMode", model.CheckAuth, setAppearanceMode)
  43. ginServer.Handle("POST", "/api/system/getSysFonts", model.CheckAuth, getSysFonts)
  44. ginServer.Handle("POST", "/api/system/exit", model.CheckAuth, exit)
  45. ginServer.Handle("POST", "/api/system/setUILayout", model.CheckAuth, setUILayout)
  46. ginServer.Handle("POST", "/api/system/getConf", model.CheckAuth, getConf)
  47. ginServer.Handle("POST", "/api/system/checkUpdate", model.CheckAuth, checkUpdate)
  48. ginServer.Handle("POST", "/api/system/exportLog", model.CheckAuth, exportLog)
  49. ginServer.Handle("POST", "/api/storage/setLocalStorage", model.CheckAuth, setLocalStorage)
  50. ginServer.Handle("POST", "/api/storage/getLocalStorage", model.CheckAuth, getLocalStorage)
  51. ginServer.Handle("POST", "/api/storage/setLocalStorageVal", model.CheckAuth, setLocalStorageVal)
  52. ginServer.Handle("POST", "/api/storage/removeLocalStorageVal", model.CheckAuth, removeLocalStorageVal)
  53. ginServer.Handle("POST", "/api/storage/setCriterion", model.CheckAuth, setCriterion)
  54. ginServer.Handle("POST", "/api/storage/getCriteria", model.CheckAuth, getCriteria)
  55. ginServer.Handle("POST", "/api/storage/removeCriterion", model.CheckAuth, removeCriterion)
  56. ginServer.Handle("POST", "/api/storage/setRecentDoc", model.CheckAuth, setRecentDoc)
  57. ginServer.Handle("POST", "/api/storage/getRecentDocs", model.CheckAuth, getRecentDocs)
  58. ginServer.Handle("POST", "/api/account/login", model.CheckAuth, login)
  59. ginServer.Handle("POST", "/api/account/checkActivationcode", model.CheckAuth, checkActivationcode)
  60. ginServer.Handle("POST", "/api/account/useActivationcode", model.CheckAuth, useActivationcode)
  61. ginServer.Handle("POST", "/api/account/deactivate", model.CheckAuth, deactivateUser)
  62. ginServer.Handle("POST", "/api/account/startFreeTrial", model.CheckAuth, startFreeTrial)
  63. ginServer.Handle("POST", "/api/notebook/lsNotebooks", model.CheckAuth, lsNotebooks)
  64. ginServer.Handle("POST", "/api/notebook/openNotebook", model.CheckAuth, openNotebook)
  65. ginServer.Handle("POST", "/api/notebook/closeNotebook", model.CheckAuth, closeNotebook)
  66. ginServer.Handle("POST", "/api/notebook/getNotebookConf", model.CheckAuth, getNotebookConf)
  67. ginServer.Handle("POST", "/api/notebook/setNotebookConf", model.CheckAuth, setNotebookConf)
  68. ginServer.Handle("POST", "/api/notebook/createNotebook", model.CheckAuth, createNotebook)
  69. ginServer.Handle("POST", "/api/notebook/removeNotebook", model.CheckAuth, removeNotebook)
  70. ginServer.Handle("POST", "/api/notebook/renameNotebook", model.CheckAuth, renameNotebook)
  71. ginServer.Handle("POST", "/api/notebook/changeSortNotebook", model.CheckAuth, changeSortNotebook)
  72. ginServer.Handle("POST", "/api/notebook/setNotebookIcon", model.CheckAuth, setNotebookIcon)
  73. ginServer.Handle("POST", "/api/filetree/searchDocs", model.CheckAuth, searchDocs)
  74. ginServer.Handle("POST", "/api/filetree/listDocsByPath", model.CheckAuth, listDocsByPath)
  75. ginServer.Handle("POST", "/api/filetree/getDoc", model.CheckAuth, getDoc)
  76. ginServer.Handle("POST", "/api/filetree/getDocNameTemplate", model.CheckAuth, getDocNameTemplate)
  77. ginServer.Handle("POST", "/api/filetree/getRefCreateSavePath", model.CheckAuth, getRefCreateSavePath)
  78. ginServer.Handle("POST", "/api/filetree/changeSort", model.CheckAuth, changeSort)
  79. ginServer.Handle("POST", "/api/filetree/lockFile", model.CheckAuth, lockFile)
  80. ginServer.Handle("POST", "/api/filetree/createDocWithMd", model.CheckAuth, model.CheckReadonly, createDocWithMd)
  81. ginServer.Handle("POST", "/api/filetree/createDailyNote", model.CheckAuth, model.CheckReadonly, createDailyNote)
  82. ginServer.Handle("POST", "/api/filetree/createDoc", model.CheckAuth, model.CheckReadonly, createDoc)
  83. ginServer.Handle("POST", "/api/filetree/renameDoc", model.CheckAuth, model.CheckReadonly, renameDoc)
  84. ginServer.Handle("POST", "/api/filetree/removeDoc", model.CheckAuth, model.CheckReadonly, removeDoc)
  85. ginServer.Handle("POST", "/api/filetree/removeDocs", model.CheckAuth, model.CheckReadonly, removeDocs)
  86. ginServer.Handle("POST", "/api/filetree/moveDocs", model.CheckAuth, model.CheckReadonly, moveDocs)
  87. ginServer.Handle("POST", "/api/filetree/duplicateDoc", model.CheckAuth, model.CheckReadonly, duplicateDoc)
  88. ginServer.Handle("POST", "/api/filetree/getHPathByPath", model.CheckAuth, getHPathByPath)
  89. ginServer.Handle("POST", "/api/filetree/getHPathsByPaths", model.CheckAuth, getHPathsByPaths)
  90. ginServer.Handle("POST", "/api/filetree/getHPathByID", model.CheckAuth, getHPathByID)
  91. ginServer.Handle("POST", "/api/filetree/getFullHPathByID", model.CheckAuth, getFullHPathByID)
  92. ginServer.Handle("POST", "/api/filetree/doc2Heading", model.CheckAuth, model.CheckReadonly, doc2Heading)
  93. ginServer.Handle("POST", "/api/filetree/heading2Doc", model.CheckAuth, model.CheckReadonly, heading2Doc)
  94. ginServer.Handle("POST", "/api/filetree/li2Doc", model.CheckAuth, model.CheckReadonly, li2Doc)
  95. ginServer.Handle("POST", "/api/filetree/refreshFiletree", model.CheckAuth, model.CheckReadonly, refreshFiletree)
  96. ginServer.Handle("POST", "/api/filetree/reindexTree", model.CheckAuth, model.CheckReadonly, reindexTree)
  97. ginServer.Handle("POST", "/api/format/autoSpace", model.CheckAuth, model.CheckReadonly, autoSpace)
  98. ginServer.Handle("POST", "/api/format/netImg2LocalAssets", model.CheckAuth, model.CheckReadonly, netImg2LocalAssets)
  99. ginServer.Handle("POST", "/api/history/getNotebookHistory", model.CheckAuth, getNotebookHistory)
  100. ginServer.Handle("POST", "/api/history/rollbackNotebookHistory", model.CheckAuth, rollbackNotebookHistory)
  101. ginServer.Handle("POST", "/api/history/rollbackAssetsHistory", model.CheckAuth, rollbackAssetsHistory)
  102. ginServer.Handle("POST", "/api/history/getDocHistoryContent", model.CheckAuth, getDocHistoryContent)
  103. ginServer.Handle("POST", "/api/history/rollbackDocHistory", model.CheckAuth, model.CheckReadonly, rollbackDocHistory)
  104. ginServer.Handle("POST", "/api/history/clearWorkspaceHistory", model.CheckAuth, model.CheckReadonly, clearWorkspaceHistory)
  105. ginServer.Handle("POST", "/api/history/reindexHistory", model.CheckAuth, model.CheckReadonly, reindexHistory)
  106. ginServer.Handle("POST", "/api/history/searchHistory", model.CheckAuth, model.CheckReadonly, searchHistory)
  107. ginServer.Handle("POST", "/api/history/getHistoryItems", model.CheckAuth, model.CheckReadonly, getHistoryItems)
  108. ginServer.Handle("POST", "/api/outline/getDocOutline", model.CheckAuth, getDocOutline)
  109. ginServer.Handle("POST", "/api/bookmark/getBookmark", model.CheckAuth, getBookmark)
  110. ginServer.Handle("POST", "/api/bookmark/renameBookmark", model.CheckAuth, renameBookmark)
  111. ginServer.Handle("POST", "/api/bookmark/removeBookmark", model.CheckAuth, removeBookmark)
  112. ginServer.Handle("POST", "/api/tag/getTag", model.CheckAuth, getTag)
  113. ginServer.Handle("POST", "/api/tag/renameTag", model.CheckAuth, renameTag)
  114. ginServer.Handle("POST", "/api/tag/removeTag", model.CheckAuth, removeTag)
  115. ginServer.Handle("POST", "/api/lute/spinBlockDOM", model.CheckAuth, spinBlockDOM) // 未测试
  116. ginServer.Handle("POST", "/api/lute/html2BlockDOM", model.CheckAuth, html2BlockDOM)
  117. ginServer.Handle("POST", "/api/lute/copyStdMarkdown", model.CheckAuth, copyStdMarkdown)
  118. ginServer.Handle("POST", "/api/query/sql", model.CheckAuth, SQL)
  119. ginServer.Handle("POST", "/api/search/searchTag", model.CheckAuth, searchTag)
  120. ginServer.Handle("POST", "/api/search/searchTemplate", model.CheckAuth, searchTemplate)
  121. ginServer.Handle("POST", "/api/search/searchWidget", model.CheckAuth, searchWidget)
  122. ginServer.Handle("POST", "/api/search/searchRefBlock", model.CheckAuth, searchRefBlock)
  123. ginServer.Handle("POST", "/api/search/searchEmbedBlock", model.CheckAuth, searchEmbedBlock)
  124. ginServer.Handle("POST", "/api/search/fullTextSearchBlock", model.CheckAuth, fullTextSearchBlock)
  125. ginServer.Handle("POST", "/api/search/searchAsset", model.CheckAuth, searchAsset)
  126. ginServer.Handle("POST", "/api/search/findReplace", model.CheckAuth, findReplace)
  127. ginServer.Handle("POST", "/api/block/getBlockInfo", model.CheckAuth, getBlockInfo)
  128. ginServer.Handle("POST", "/api/block/getBlockDOM", model.CheckAuth, getBlockDOM)
  129. ginServer.Handle("POST", "/api/block/getBlockKramdown", model.CheckAuth, getBlockKramdown)
  130. ginServer.Handle("POST", "/api/block/getBlockBreadcrumb", model.CheckAuth, getBlockBreadcrumb)
  131. ginServer.Handle("POST", "/api/block/getBlockIndex", model.CheckAuth, getBlockIndex)
  132. ginServer.Handle("POST", "/api/block/getRefIDs", model.CheckAuth, getRefIDs)
  133. ginServer.Handle("POST", "/api/block/getRefIDsByFileAnnotationID", model.CheckAuth, getRefIDsByFileAnnotationID)
  134. ginServer.Handle("POST", "/api/block/getBlockDefIDsByRefText", model.CheckAuth, getBlockDefIDsByRefText)
  135. ginServer.Handle("POST", "/api/block/getRefText", model.CheckAuth, getRefText)
  136. ginServer.Handle("POST", "/api/block/getTreeStat", model.CheckAuth, getTreeStat)
  137. ginServer.Handle("POST", "/api/block/getBlocksWordCount", model.CheckAuth, getBlocksWordCount)
  138. ginServer.Handle("POST", "/api/block/getContentWordCount", model.CheckAuth, getContentWordCount)
  139. ginServer.Handle("POST", "/api/block/getRecentUpdatedBlocks", model.CheckAuth, getRecentUpdatedBlocks)
  140. ginServer.Handle("POST", "/api/block/getDocInfo", model.CheckAuth, getDocInfo)
  141. ginServer.Handle("POST", "/api/block/checkBlockExist", model.CheckAuth, checkBlockExist)
  142. ginServer.Handle("POST", "/api/block/checkBlockFold", model.CheckAuth, checkBlockFold)
  143. ginServer.Handle("POST", "/api/block/insertBlock", model.CheckAuth, insertBlock)
  144. ginServer.Handle("POST", "/api/block/prependBlock", model.CheckAuth, prependBlock)
  145. ginServer.Handle("POST", "/api/block/appendBlock", model.CheckAuth, appendBlock)
  146. ginServer.Handle("POST", "/api/block/updateBlock", model.CheckAuth, updateBlock)
  147. ginServer.Handle("POST", "/api/block/deleteBlock", model.CheckAuth, deleteBlock)
  148. ginServer.Handle("POST", "/api/block/setBlockReminder", model.CheckAuth, setBlockReminder)
  149. ginServer.Handle("POST", "/api/block/getHeadingLevelTransaction", model.CheckAuth, getHeadingLevelTransaction)
  150. ginServer.Handle("POST", "/api/block/getHeadingDeleteTransaction", model.CheckAuth, getHeadingDeleteTransaction)
  151. ginServer.Handle("POST", "/api/block/getHeadingChildrenIDs", model.CheckAuth, getHeadingChildrenIDs)
  152. ginServer.Handle("POST", "/api/block/getHeadingChildrenDOM", model.CheckAuth, getHeadingChildrenDOM)
  153. ginServer.Handle("POST", "/api/block/swapBlockRef", model.CheckAuth, swapBlockRef)
  154. ginServer.Handle("POST", "/api/file/getFile", model.CheckAuth, getFile)
  155. ginServer.Handle("POST", "/api/file/putFile", model.CheckAuth, putFile)
  156. ginServer.Handle("POST", "/api/file/copyFile", model.CheckAuth, copyFile)
  157. ginServer.Handle("POST", "/api/ref/refreshBacklink", model.CheckAuth, refreshBacklink)
  158. ginServer.Handle("POST", "/api/ref/getBacklink", model.CheckAuth, getBacklink)
  159. ginServer.Handle("POST", "/api/ref/getBacklink2", model.CheckAuth, getBacklink2)
  160. ginServer.Handle("POST", "/api/ref/getBacklinkDoc", model.CheckAuth, getBacklinkDoc)
  161. ginServer.Handle("POST", "/api/ref/getBackmentionDoc", model.CheckAuth, getBackmentionDoc)
  162. ginServer.Handle("POST", "/api/attr/getBookmarkLabels", model.CheckAuth, getBookmarkLabels)
  163. ginServer.Handle("POST", "/api/attr/resetBlockAttrs", model.CheckAuth, model.CheckReadonly, resetBlockAttrs)
  164. ginServer.Handle("POST", "/api/attr/setBlockAttrs", model.CheckAuth, model.CheckReadonly, setBlockAttrs)
  165. ginServer.Handle("POST", "/api/attr/getBlockAttrs", model.CheckAuth, getBlockAttrs)
  166. ginServer.Handle("POST", "/api/cloud/getCloudSpace", model.CheckAuth, getCloudSpace)
  167. ginServer.Handle("POST", "/api/sync/setSyncEnable", model.CheckAuth, setSyncEnable)
  168. ginServer.Handle("POST", "/api/sync/setSyncGenerateConflictDoc", model.CheckAuth, setSyncGenerateConflictDoc)
  169. ginServer.Handle("POST", "/api/sync/setSyncMode", model.CheckAuth, setSyncMode)
  170. ginServer.Handle("POST", "/api/sync/setSyncProvider", model.CheckAuth, setSyncProvider)
  171. ginServer.Handle("POST", "/api/sync/setSyncProviderS3", model.CheckAuth, setSyncProviderS3)
  172. ginServer.Handle("POST", "/api/sync/setSyncProviderWebDAV", model.CheckAuth, setSyncProviderWebDAV)
  173. ginServer.Handle("POST", "/api/sync/setCloudSyncDir", model.CheckAuth, setCloudSyncDir)
  174. ginServer.Handle("POST", "/api/sync/createCloudSyncDir", model.CheckAuth, model.CheckReadonly, createCloudSyncDir)
  175. ginServer.Handle("POST", "/api/sync/removeCloudSyncDir", model.CheckAuth, model.CheckReadonly, removeCloudSyncDir)
  176. ginServer.Handle("POST", "/api/sync/listCloudSyncDir", model.CheckAuth, listCloudSyncDir)
  177. ginServer.Handle("POST", "/api/sync/performSync", model.CheckAuth, performSync)
  178. ginServer.Handle("POST", "/api/sync/performBootSync", model.CheckAuth, performBootSync)
  179. ginServer.Handle("POST", "/api/sync/getBootSync", model.CheckAuth, getBootSync)
  180. ginServer.Handle("POST", "/api/inbox/getShorthands", model.CheckAuth, getShorthands)
  181. ginServer.Handle("POST", "/api/inbox/getShorthand", model.CheckAuth, getShorthand)
  182. ginServer.Handle("POST", "/api/inbox/removeShorthands", model.CheckAuth, removeShorthands)
  183. ginServer.Handle("POST", "/api/extension/copy", model.CheckAuth, extensionCopy)
  184. ginServer.Handle("POST", "/api/clipboard/readFilePaths", model.CheckAuth, readFilePaths)
  185. ginServer.Handle("POST", "/api/asset/uploadCloud", model.CheckAuth, model.CheckReadonly, uploadCloud)
  186. ginServer.Handle("POST", "/api/asset/insertLocalAssets", model.CheckAuth, model.CheckReadonly, insertLocalAssets)
  187. ginServer.Handle("POST", "/api/asset/resolveAssetPath", model.CheckAuth, resolveAssetPath)
  188. ginServer.Handle("POST", "/api/asset/upload", model.CheckAuth, model.CheckReadonly, model.Upload)
  189. ginServer.Handle("POST", "/api/asset/setFileAnnotation", model.CheckAuth, model.CheckReadonly, setFileAnnotation)
  190. ginServer.Handle("POST", "/api/asset/getFileAnnotation", model.CheckAuth, getFileAnnotation)
  191. ginServer.Handle("POST", "/api/asset/getUnusedAssets", model.CheckAuth, getUnusedAssets)
  192. ginServer.Handle("POST", "/api/asset/removeUnusedAsset", model.CheckAuth, model.CheckReadonly, removeUnusedAsset)
  193. ginServer.Handle("POST", "/api/asset/removeUnusedAssets", model.CheckAuth, model.CheckReadonly, removeUnusedAssets)
  194. ginServer.Handle("POST", "/api/asset/getDocImageAssets", model.CheckAuth, model.CheckReadonly, getDocImageAssets)
  195. ginServer.Handle("POST", "/api/asset/renameAsset", model.CheckAuth, model.CheckReadonly, renameAsset)
  196. ginServer.Handle("POST", "/api/export/batchExportMd", model.CheckAuth, batchExportMd)
  197. ginServer.Handle("POST", "/api/export/exportMd", model.CheckAuth, exportMd)
  198. ginServer.Handle("POST", "/api/export/exportSY", model.CheckAuth, exportSY)
  199. ginServer.Handle("POST", "/api/export/exportNotebookSY", model.CheckAuth, exportNotebookSY)
  200. ginServer.Handle("POST", "/api/export/exportMdContent", model.CheckAuth, exportMdContent)
  201. ginServer.Handle("POST", "/api/export/exportHTML", model.CheckAuth, exportHTML)
  202. ginServer.Handle("POST", "/api/export/exportPreviewHTML", model.CheckAuth, exportPreviewHTML)
  203. ginServer.Handle("POST", "/api/export/exportMdHTML", model.CheckAuth, exportMdHTML)
  204. ginServer.Handle("POST", "/api/export/exportDocx", model.CheckAuth, exportDocx)
  205. ginServer.Handle("POST", "/api/export/addPDFOutline", model.CheckAuth, addPDFOutline)
  206. ginServer.Handle("POST", "/api/export/preview", model.CheckAuth, exportPreview)
  207. ginServer.Handle("POST", "/api/export/exportAsFile", model.CheckAuth, exportAsFile)
  208. ginServer.Handle("POST", "/api/export/exportData", model.CheckAuth, exportData)
  209. ginServer.Handle("POST", "/api/export/exportDataInFolder", model.CheckAuth, exportDataInFolder)
  210. ginServer.Handle("POST", "/api/export/exportTempContent", model.CheckAuth, exportTempContent)
  211. ginServer.Handle("POST", "/api/import/importStdMd", model.CheckAuth, model.CheckReadonly, importStdMd)
  212. ginServer.Handle("POST", "/api/import/importData", model.CheckAuth, model.CheckReadonly, importData)
  213. ginServer.Handle("POST", "/api/import/importSY", model.CheckAuth, model.CheckReadonly, importSY)
  214. ginServer.Handle("POST", "/api/template/render", model.CheckAuth, renderTemplate)
  215. ginServer.Handle("POST", "/api/template/docSaveAsTemplate", model.CheckAuth, docSaveAsTemplate)
  216. ginServer.Handle("POST", "/api/transactions", model.CheckAuth, model.CheckReadonly, performTransactions)
  217. ginServer.Handle("POST", "/api/setting/setAccount", model.CheckAuth, setAccount)
  218. ginServer.Handle("POST", "/api/setting/setEditor", model.CheckAuth, setEditor)
  219. ginServer.Handle("POST", "/api/setting/setExport", model.CheckAuth, setExport)
  220. ginServer.Handle("POST", "/api/setting/setFiletree", model.CheckAuth, setFiletree)
  221. ginServer.Handle("POST", "/api/setting/setSearch", model.CheckAuth, setSearch)
  222. ginServer.Handle("POST", "/api/setting/setKeymap", model.CheckAuth, setKeymap)
  223. ginServer.Handle("POST", "/api/setting/setAppearance", model.CheckAuth, setAppearance)
  224. ginServer.Handle("POST", "/api/setting/getCloudUser", model.CheckAuth, getCloudUser)
  225. ginServer.Handle("POST", "/api/setting/logoutCloudUser", model.CheckAuth, logoutCloudUser)
  226. ginServer.Handle("POST", "/api/setting/login2faCloudUser", model.CheckAuth, login2faCloudUser)
  227. ginServer.Handle("POST", "/api/setting/getCustomCSS", model.CheckAuth, getCustomCSS)
  228. ginServer.Handle("POST", "/api/setting/setCustomCSS", model.CheckAuth, setCustomCSS)
  229. ginServer.Handle("POST", "/api/setting/setEmoji", model.CheckAuth, setEmoji)
  230. ginServer.Handle("POST", "/api/graph/resetGraph", model.CheckAuth, resetGraph)
  231. ginServer.Handle("POST", "/api/graph/resetLocalGraph", model.CheckAuth, resetLocalGraph)
  232. ginServer.Handle("POST", "/api/graph/getGraph", model.CheckAuth, getGraph)
  233. ginServer.Handle("POST", "/api/graph/getLocalGraph", model.CheckAuth, getLocalGraph)
  234. ginServer.Handle("POST", "/api/bazaar/getBazaarWidget", model.CheckAuth, getBazaarWidget)
  235. ginServer.Handle("POST", "/api/bazaar/getInstalledWidget", model.CheckAuth, getInstalledWidget)
  236. ginServer.Handle("POST", "/api/bazaar/installBazaarWidget", model.CheckAuth, installBazaarWidget)
  237. ginServer.Handle("POST", "/api/bazaar/uninstallBazaarWidget", model.CheckAuth, uninstallBazaarWidget)
  238. ginServer.Handle("POST", "/api/bazaar/getBazaarIcon", model.CheckAuth, getBazaarIcon)
  239. ginServer.Handle("POST", "/api/bazaar/getInstalledIcon", model.CheckAuth, getInstalledIcon)
  240. ginServer.Handle("POST", "/api/bazaar/installBazaarIcon", model.CheckAuth, installBazaarIcon)
  241. ginServer.Handle("POST", "/api/bazaar/uninstallBazaarIcon", model.CheckAuth, uninstallBazaarIcon)
  242. ginServer.Handle("POST", "/api/bazaar/getBazaarTemplate", model.CheckAuth, getBazaarTemplate)
  243. ginServer.Handle("POST", "/api/bazaar/getInstalledTemplate", model.CheckAuth, getInstalledTemplate)
  244. ginServer.Handle("POST", "/api/bazaar/installBazaarTemplate", model.CheckAuth, installBazaarTemplate)
  245. ginServer.Handle("POST", "/api/bazaar/uninstallBazaarTemplate", model.CheckAuth, uninstallBazaarTemplate)
  246. ginServer.Handle("POST", "/api/bazaar/getBazaarTheme", model.CheckAuth, getBazaarTheme)
  247. ginServer.Handle("POST", "/api/bazaar/getInstalledTheme", model.CheckAuth, getInstalledTheme)
  248. ginServer.Handle("POST", "/api/bazaar/installBazaarTheme", model.CheckAuth, installBazaarTheme)
  249. ginServer.Handle("POST", "/api/bazaar/uninstallBazaarTheme", model.CheckAuth, uninstallBazaarTheme)
  250. ginServer.Handle("POST", "/api/bazaar/getBazaarPackageREAME", model.CheckAuth, getBazaarPackageREAME)
  251. ginServer.Handle("POST", "/api/repo/initRepoKey", model.CheckAuth, initRepoKey)
  252. ginServer.Handle("POST", "/api/repo/initRepoKeyFromPassphrase", model.CheckAuth, initRepoKeyFromPassphrase)
  253. ginServer.Handle("POST", "/api/repo/resetRepo", model.CheckAuth, resetRepo)
  254. ginServer.Handle("POST", "/api/repo/importRepoKey", model.CheckAuth, importRepoKey)
  255. ginServer.Handle("POST", "/api/repo/createSnapshot", model.CheckAuth, createSnapshot)
  256. ginServer.Handle("POST", "/api/repo/tagSnapshot", model.CheckAuth, tagSnapshot)
  257. ginServer.Handle("POST", "/api/repo/checkoutRepo", model.CheckAuth, checkoutRepo)
  258. ginServer.Handle("POST", "/api/repo/getRepoSnapshots", model.CheckAuth, getRepoSnapshots)
  259. ginServer.Handle("POST", "/api/repo/getRepoTagSnapshots", model.CheckAuth, getRepoTagSnapshots)
  260. ginServer.Handle("POST", "/api/repo/removeRepoTagSnapshot", model.CheckAuth, removeRepoTagSnapshot)
  261. ginServer.Handle("POST", "/api/repo/getCloudRepoTagSnapshots", model.CheckAuth, getCloudRepoTagSnapshots)
  262. ginServer.Handle("POST", "/api/repo/removeCloudRepoTagSnapshot", model.CheckAuth, removeCloudRepoTagSnapshot)
  263. ginServer.Handle("POST", "/api/repo/uploadCloudSnapshot", model.CheckAuth, uploadCloudSnapshot)
  264. ginServer.Handle("POST", "/api/repo/downloadCloudSnapshot", model.CheckAuth, downloadCloudSnapshot)
  265. ginServer.Handle("POST", "/api/repo/diffRepoSnapshots", model.CheckAuth, diffRepoSnapshots)
  266. ginServer.Handle("POST", "/api/repo/openRepoSnapshotDoc", model.CheckAuth, openRepoSnapshotDoc)
  267. ginServer.Handle("POST", "/api/riff/createRiffDeck", model.CheckAuth, createRiffDeck)
  268. ginServer.Handle("POST", "/api/riff/renameRiffDeck", model.CheckAuth, renameRiffDeck)
  269. ginServer.Handle("POST", "/api/riff/getRiffDecks", model.CheckAuth, getRiffDecks)
  270. ginServer.Handle("POST", "/api/riff/addRiffCards", model.CheckAuth, addRiffCards)
  271. ginServer.Handle("POST", "/api/riff/removeRiffCards", model.CheckAuth, removeRiffCards)
  272. ginServer.Handle("POST", "/api/riff/getRiffDueCards", model.CheckAuth, getRiffDueCards)
  273. ginServer.Handle("POST", "/api/riff/renderRiffCard", model.CheckAuth, renderRiffCard)
  274. ginServer.Handle("POST", "/api/riff/reviewRiffCard", model.CheckAuth, reviewRiffCard)
  275. ginServer.Handle("POST", "/api/notification/pushMsg", model.CheckAuth, pushMsg)
  276. ginServer.Handle("POST", "/api/notification/pushErrMsg", model.CheckAuth, pushErrMsg)
  277. ginServer.Handle("POST", "/api/snippet/getSnippet", model.CheckAuth, getSnippet)
  278. ginServer.Handle("POST", "/api/snippet/setSnippet", model.CheckAuth, setSnippet)
  279. ginServer.Handle("POST", "/api/snippet/removeSnippet", model.CheckAuth, removeSnippet)
  280. ginServer.Handle("GET", "/snippets/*filepath", serveSnippets)
  281. }