2023-06-24 20:39:55 +08:00
// SiYuan - Refactor your thinking
2022-05-26 15:18:53 +08:00
// Copyright (c) 2020-present, b3log.org
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package api
import (
"github.com/gin-gonic/gin"
"github.com/siyuan-note/siyuan/kernel/model"
)
func ServeAPI ( ginServer * gin . Engine ) {
// 不需要鉴权
ginServer . Handle ( "GET" , "/api/system/bootProgress" , bootProgress )
ginServer . Handle ( "POST" , "/api/system/bootProgress" , bootProgress )
ginServer . Handle ( "GET" , "/api/system/version" , version )
ginServer . Handle ( "POST" , "/api/system/version" , version )
ginServer . Handle ( "POST" , "/api/system/currentTime" , currentTime )
ginServer . Handle ( "POST" , "/api/system/uiproc" , addUIProcess )
ginServer . Handle ( "POST" , "/api/system/loginAuth" , model . LoginAuth )
ginServer . Handle ( "POST" , "/api/system/logoutAuth" , model . LogoutAuth )
2022-07-16 10:48:33 +08:00
ginServer . Handle ( "GET" , "/api/system/getCaptcha" , model . GetCaptcha )
2022-05-26 15:18:53 +08:00
// 需要鉴权
ginServer . Handle ( "POST" , "/api/system/getEmojiConf" , model . CheckAuth , getEmojiConf )
2023-10-22 10:31:06 +08:00
ginServer . Handle ( "POST" , "/api/system/setAPIToken" , model . CheckAuth , model . CheckReadonly , setAPIToken )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/system/setAccessAuthCode" , model . CheckAuth , model . CheckReadonly , setAccessAuthCode )
2023-09-04 09:05:03 +08:00
ginServer . Handle ( "POST" , "/api/system/setFollowSystemLockScreen" , model . CheckAuth , model . CheckReadonly , setFollowSystemLockScreen )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/system/setNetworkServe" , model . CheckAuth , model . CheckReadonly , setNetworkServe )
ginServer . Handle ( "POST" , "/api/system/setUploadErrLog" , model . CheckAuth , model . CheckReadonly , setUploadErrLog )
ginServer . Handle ( "POST" , "/api/system/setAutoLaunch" , model . CheckAuth , model . CheckReadonly , setAutoLaunch )
ginServer . Handle ( "POST" , "/api/system/setGoogleAnalytics" , model . CheckAuth , model . CheckReadonly , setGoogleAnalytics )
ginServer . Handle ( "POST" , "/api/system/setDownloadInstallPkg" , model . CheckAuth , model . CheckReadonly , setDownloadInstallPkg )
ginServer . Handle ( "POST" , "/api/system/setNetworkProxy" , model . CheckAuth , model . CheckReadonly , setNetworkProxy )
ginServer . Handle ( "POST" , "/api/system/setWorkspaceDir" , model . CheckAuth , model . CheckReadonly , setWorkspaceDir )
2023-01-08 22:44:36 +08:00
ginServer . Handle ( "POST" , "/api/system/getWorkspaces" , model . CheckAuth , getWorkspaces )
2023-02-12 22:51:04 +08:00
ginServer . Handle ( "POST" , "/api/system/getMobileWorkspaces" , model . CheckAuth , getMobileWorkspaces )
2023-07-07 18:55:52 +08:00
ginServer . Handle ( "POST" , "/api/system/checkWorkspaceDir" , model . CheckAuth , model . CheckReadonly , checkWorkspaceDir )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/system/createWorkspaceDir" , model . CheckAuth , model . CheckReadonly , createWorkspaceDir )
ginServer . Handle ( "POST" , "/api/system/removeWorkspaceDir" , model . CheckAuth , model . CheckReadonly , removeWorkspaceDir )
2023-09-08 15:36:11 +08:00
ginServer . Handle ( "POST" , "/api/system/removeWorkspaceDirPhysically" , model . CheckAuth , model . CheckReadonly , removeWorkspaceDirPhysically )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/system/setAppearanceMode" , model . CheckAuth , setAppearanceMode )
ginServer . Handle ( "POST" , "/api/system/getSysFonts" , model . CheckAuth , getSysFonts )
ginServer . Handle ( "POST" , "/api/system/exit" , model . CheckAuth , exit )
2023-04-19 09:53:46 +08:00
ginServer . Handle ( "POST" , "/api/system/setUILayout" , setUILayout ) // 这里不加鉴权 After modifying the access authentication code on the browser side, the other side does not refresh https://github.com/siyuan-note/siyuan/issues/8028
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/system/getConf" , model . CheckAuth , getConf )
ginServer . Handle ( "POST" , "/api/system/checkUpdate" , model . CheckAuth , checkUpdate )
2022-08-27 01:19:52 +08:00
ginServer . Handle ( "POST" , "/api/system/exportLog" , model . CheckAuth , exportLog )
2023-04-06 21:56:52 +08:00
ginServer . Handle ( "POST" , "/api/system/getChangelog" , model . CheckAuth , getChangelog )
2022-10-30 23:06:12 +08:00
2023-03-10 09:56:26 +08:00
ginServer . Handle ( "POST" , "/api/storage/setLocalStorage" , model . CheckAuth , setLocalStorage )
2022-10-30 23:06:12 +08:00
ginServer . Handle ( "POST" , "/api/storage/getLocalStorage" , model . CheckAuth , getLocalStorage )
2023-03-10 09:56:26 +08:00
ginServer . Handle ( "POST" , "/api/storage/setLocalStorageVal" , model . CheckAuth , setLocalStorageVal )
2023-03-22 15:21:23 +08:00
ginServer . Handle ( "POST" , "/api/storage/removeLocalStorageVals" , model . CheckAuth , model . CheckReadonly , removeLocalStorageVals )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/storage/setCriterion" , model . CheckAuth , model . CheckReadonly , setCriterion )
2022-12-03 23:49:18 +08:00
ginServer . Handle ( "POST" , "/api/storage/getCriteria" , model . CheckAuth , getCriteria )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/storage/removeCriterion" , model . CheckAuth , model . CheckReadonly , removeCriterion )
2022-12-10 17:07:33 +08:00
ginServer . Handle ( "POST" , "/api/storage/getRecentDocs" , model . CheckAuth , getRecentDocs )
2022-05-26 15:18:53 +08:00
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/account/login" , model . CheckAuth , model . CheckReadonly , login )
ginServer . Handle ( "POST" , "/api/account/checkActivationcode" , model . CheckAuth , model . CheckReadonly , checkActivationcode )
ginServer . Handle ( "POST" , "/api/account/useActivationcode" , model . CheckAuth , model . CheckReadonly , useActivationcode )
ginServer . Handle ( "POST" , "/api/account/deactivate" , model . CheckAuth , model . CheckReadonly , deactivateUser )
ginServer . Handle ( "POST" , "/api/account/startFreeTrial" , model . CheckAuth , model . CheckReadonly , startFreeTrial )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/notebook/lsNotebooks" , model . CheckAuth , lsNotebooks )
2023-03-10 09:47:34 +08:00
ginServer . Handle ( "POST" , "/api/notebook/openNotebook" , model . CheckAuth , openNotebook )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/notebook/closeNotebook" , model . CheckAuth , model . CheckReadonly , closeNotebook )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/notebook/getNotebookConf" , model . CheckAuth , getNotebookConf )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/notebook/setNotebookConf" , model . CheckAuth , model . CheckReadonly , setNotebookConf )
ginServer . Handle ( "POST" , "/api/notebook/createNotebook" , model . CheckAuth , model . CheckReadonly , createNotebook )
2023-03-10 09:47:34 +08:00
ginServer . Handle ( "POST" , "/api/notebook/removeNotebook" , model . CheckAuth , removeNotebook )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/notebook/renameNotebook" , model . CheckAuth , model . CheckReadonly , renameNotebook )
ginServer . Handle ( "POST" , "/api/notebook/changeSortNotebook" , model . CheckAuth , model . CheckReadonly , changeSortNotebook )
ginServer . Handle ( "POST" , "/api/notebook/setNotebookIcon" , model . CheckAuth , model . CheckReadonly , setNotebookIcon )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/filetree/searchDocs" , model . CheckAuth , searchDocs )
ginServer . Handle ( "POST" , "/api/filetree/listDocsByPath" , model . CheckAuth , listDocsByPath )
ginServer . Handle ( "POST" , "/api/filetree/getDoc" , model . CheckAuth , getDoc )
2023-02-03 20:47:43 +08:00
ginServer . Handle ( "POST" , "/api/filetree/getDocCreateSavePath" , model . CheckAuth , getDocCreateSavePath )
2022-12-12 10:18:22 +08:00
ginServer . Handle ( "POST" , "/api/filetree/getRefCreateSavePath" , model . CheckAuth , getRefCreateSavePath )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/filetree/changeSort" , model . CheckAuth , model . CheckReadonly , changeSort )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/filetree/createDocWithMd" , model . CheckAuth , model . CheckReadonly , createDocWithMd )
ginServer . Handle ( "POST" , "/api/filetree/createDailyNote" , model . CheckAuth , model . CheckReadonly , createDailyNote )
ginServer . Handle ( "POST" , "/api/filetree/createDoc" , model . CheckAuth , model . CheckReadonly , createDoc )
ginServer . Handle ( "POST" , "/api/filetree/renameDoc" , model . CheckAuth , model . CheckReadonly , renameDoc )
ginServer . Handle ( "POST" , "/api/filetree/removeDoc" , model . CheckAuth , model . CheckReadonly , removeDoc )
2022-11-03 14:27:17 +08:00
ginServer . Handle ( "POST" , "/api/filetree/removeDocs" , model . CheckAuth , model . CheckReadonly , removeDocs )
ginServer . Handle ( "POST" , "/api/filetree/moveDocs" , model . CheckAuth , model . CheckReadonly , moveDocs )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/filetree/duplicateDoc" , model . CheckAuth , model . CheckReadonly , duplicateDoc )
ginServer . Handle ( "POST" , "/api/filetree/getHPathByPath" , model . CheckAuth , getHPathByPath )
2022-11-04 21:37:10 +08:00
ginServer . Handle ( "POST" , "/api/filetree/getHPathsByPaths" , model . CheckAuth , getHPathsByPaths )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/filetree/getHPathByID" , model . CheckAuth , getHPathByID )
ginServer . Handle ( "POST" , "/api/filetree/getFullHPathByID" , model . CheckAuth , getFullHPathByID )
2023-11-15 09:08:41 +08:00
ginServer . Handle ( "POST" , "/api/filetree/getIDsByHPath" , model . CheckAuth , getIDsByHPath )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/filetree/doc2Heading" , model . CheckAuth , model . CheckReadonly , doc2Heading )
ginServer . Handle ( "POST" , "/api/filetree/heading2Doc" , model . CheckAuth , model . CheckReadonly , heading2Doc )
ginServer . Handle ( "POST" , "/api/filetree/li2Doc" , model . CheckAuth , model . CheckReadonly , li2Doc )
ginServer . Handle ( "POST" , "/api/filetree/refreshFiletree" , model . CheckAuth , model . CheckReadonly , refreshFiletree )
ginServer . Handle ( "POST" , "/api/format/autoSpace" , model . CheckAuth , model . CheckReadonly , autoSpace )
ginServer . Handle ( "POST" , "/api/format/netImg2LocalAssets" , model . CheckAuth , model . CheckReadonly , netImg2LocalAssets )
ginServer . Handle ( "POST" , "/api/history/getNotebookHistory" , model . CheckAuth , getNotebookHistory )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/history/rollbackNotebookHistory" , model . CheckAuth , model . CheckReadonly , rollbackNotebookHistory )
ginServer . Handle ( "POST" , "/api/history/rollbackAssetsHistory" , model . CheckAuth , model . CheckReadonly , rollbackAssetsHistory )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/history/getDocHistoryContent" , model . CheckAuth , getDocHistoryContent )
ginServer . Handle ( "POST" , "/api/history/rollbackDocHistory" , model . CheckAuth , model . CheckReadonly , rollbackDocHistory )
ginServer . Handle ( "POST" , "/api/history/clearWorkspaceHistory" , model . CheckAuth , model . CheckReadonly , clearWorkspaceHistory )
2022-08-29 00:17:29 +08:00
ginServer . Handle ( "POST" , "/api/history/reindexHistory" , model . CheckAuth , model . CheckReadonly , reindexHistory )
ginServer . Handle ( "POST" , "/api/history/searchHistory" , model . CheckAuth , model . CheckReadonly , searchHistory )
2022-11-07 21:12:29 +08:00
ginServer . Handle ( "POST" , "/api/history/getHistoryItems" , model . CheckAuth , model . CheckReadonly , getHistoryItems )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/outline/getDocOutline" , model . CheckAuth , getDocOutline )
ginServer . Handle ( "POST" , "/api/bookmark/getBookmark" , model . CheckAuth , getBookmark )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/bookmark/renameBookmark" , model . CheckAuth , model . CheckReadonly , renameBookmark )
ginServer . Handle ( "POST" , "/api/bookmark/removeBookmark" , model . CheckAuth , model . CheckReadonly , removeBookmark )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/tag/getTag" , model . CheckAuth , getTag )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/tag/renameTag" , model . CheckAuth , model . CheckReadonly , renameTag )
ginServer . Handle ( "POST" , "/api/tag/removeTag" , model . CheckAuth , model . CheckReadonly , removeTag )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/lute/spinBlockDOM" , model . CheckAuth , spinBlockDOM ) // 未测试
ginServer . Handle ( "POST" , "/api/lute/html2BlockDOM" , model . CheckAuth , html2BlockDOM )
ginServer . Handle ( "POST" , "/api/lute/copyStdMarkdown" , model . CheckAuth , copyStdMarkdown )
ginServer . Handle ( "POST" , "/api/query/sql" , model . CheckAuth , SQL )
ginServer . Handle ( "POST" , "/api/search/searchTag" , model . CheckAuth , searchTag )
ginServer . Handle ( "POST" , "/api/search/searchTemplate" , model . CheckAuth , searchTemplate )
2023-03-23 19:29:36 +08:00
ginServer . Handle ( "POST" , "/api/search/removeTemplate" , model . CheckAuth , removeTemplate )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/search/searchWidget" , model . CheckAuth , searchWidget )
ginServer . Handle ( "POST" , "/api/search/searchRefBlock" , model . CheckAuth , searchRefBlock )
ginServer . Handle ( "POST" , "/api/search/searchEmbedBlock" , model . CheckAuth , searchEmbedBlock )
ginServer . Handle ( "POST" , "/api/search/fullTextSearchBlock" , model . CheckAuth , fullTextSearchBlock )
ginServer . Handle ( "POST" , "/api/search/searchAsset" , model . CheckAuth , searchAsset )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/search/findReplace" , model . CheckAuth , model . CheckReadonly , findReplace )
2023-08-11 10:28:32 +08:00
ginServer . Handle ( "POST" , "/api/search/fullTextSearchAssetContent" , model . CheckAuth , fullTextSearchAssetContent )
2023-08-12 22:48:46 +08:00
ginServer . Handle ( "POST" , "/api/search/getAssetContent" , model . CheckAuth , getAssetContent )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/block/getBlockInfo" , model . CheckAuth , getBlockInfo )
ginServer . Handle ( "POST" , "/api/block/getBlockDOM" , model . CheckAuth , getBlockDOM )
2022-06-27 23:03:31 +08:00
ginServer . Handle ( "POST" , "/api/block/getBlockKramdown" , model . CheckAuth , getBlockKramdown )
2023-05-13 21:50:32 +08:00
ginServer . Handle ( "POST" , "/api/block/getChildBlocks" , model . CheckAuth , getChildBlocks )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/block/getBlockBreadcrumb" , model . CheckAuth , getBlockBreadcrumb )
2022-10-25 14:41:29 +08:00
ginServer . Handle ( "POST" , "/api/block/getBlockIndex" , model . CheckAuth , getBlockIndex )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/block/getRefIDs" , model . CheckAuth , getRefIDs )
ginServer . Handle ( "POST" , "/api/block/getRefIDsByFileAnnotationID" , model . CheckAuth , getRefIDsByFileAnnotationID )
ginServer . Handle ( "POST" , "/api/block/getBlockDefIDsByRefText" , model . CheckAuth , getBlockDefIDsByRefText )
ginServer . Handle ( "POST" , "/api/block/getRefText" , model . CheckAuth , getRefText )
2023-09-30 17:56:47 +08:00
ginServer . Handle ( "POST" , "/api/block/getDOMText" , model . CheckAuth , getDOMText )
2022-10-01 13:00:39 +08:00
ginServer . Handle ( "POST" , "/api/block/getTreeStat" , model . CheckAuth , getTreeStat )
2022-06-27 16:13:11 +08:00
ginServer . Handle ( "POST" , "/api/block/getBlocksWordCount" , model . CheckAuth , getBlocksWordCount )
ginServer . Handle ( "POST" , "/api/block/getContentWordCount" , model . CheckAuth , getContentWordCount )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/block/getRecentUpdatedBlocks" , model . CheckAuth , getRecentUpdatedBlocks )
ginServer . Handle ( "POST" , "/api/block/getDocInfo" , model . CheckAuth , getDocInfo )
ginServer . Handle ( "POST" , "/api/block/checkBlockExist" , model . CheckAuth , checkBlockExist )
ginServer . Handle ( "POST" , "/api/block/checkBlockFold" , model . CheckAuth , checkBlockFold )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/block/insertBlock" , model . CheckAuth , model . CheckReadonly , insertBlock )
ginServer . Handle ( "POST" , "/api/block/prependBlock" , model . CheckAuth , model . CheckReadonly , prependBlock )
ginServer . Handle ( "POST" , "/api/block/appendBlock" , model . CheckAuth , model . CheckReadonly , appendBlock )
ginServer . Handle ( "POST" , "/api/block/updateBlock" , model . CheckAuth , model . CheckReadonly , updateBlock )
ginServer . Handle ( "POST" , "/api/block/deleteBlock" , model . CheckAuth , model . CheckReadonly , deleteBlock )
2023-04-06 18:22:41 +08:00
ginServer . Handle ( "POST" , "/api/block/moveBlock" , model . CheckAuth , model . CheckReadonly , moveBlock )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/block/setBlockReminder" , model . CheckAuth , model . CheckReadonly , setBlockReminder )
2022-09-25 19:04:42 +08:00
ginServer . Handle ( "POST" , "/api/block/getHeadingLevelTransaction" , model . CheckAuth , getHeadingLevelTransaction )
2022-10-10 17:04:11 +08:00
ginServer . Handle ( "POST" , "/api/block/getHeadingDeleteTransaction" , model . CheckAuth , getHeadingDeleteTransaction )
2022-11-21 22:41:44 +08:00
ginServer . Handle ( "POST" , "/api/block/getHeadingChildrenIDs" , model . CheckAuth , getHeadingChildrenIDs )
2022-09-27 21:52:30 +08:00
ginServer . Handle ( "POST" , "/api/block/getHeadingChildrenDOM" , model . CheckAuth , getHeadingChildrenDOM )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/block/swapBlockRef" , model . CheckAuth , model . CheckReadonly , swapBlockRef )
ginServer . Handle ( "POST" , "/api/block/transferBlockRef" , model . CheckAuth , model . CheckReadonly , transferBlockRef )
2023-10-28 11:25:21 +08:00
ginServer . Handle ( "POST" , "/api/block/getParentNextChildID" , model . CheckAuth , model . CheckReadonly , getParentNextChildID )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/file/getFile" , model . CheckAuth , getFile )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/file/putFile" , model . CheckAuth , model . CheckReadonly , putFile )
ginServer . Handle ( "POST" , "/api/file/copyFile" , model . CheckAuth , model . CheckReadonly , copyFile )
2023-03-15 22:19:25 +08:00
ginServer . Handle ( "POST" , "/api/file/removeFile" , model . CheckAuth , model . CheckReadonly , removeFile )
2023-05-23 09:01:37 +08:00
ginServer . Handle ( "POST" , "/api/file/renameFile" , model . CheckAuth , model . CheckReadonly , renameFile )
2023-03-24 11:40:12 +08:00
ginServer . Handle ( "POST" , "/api/file/readDir" , model . CheckAuth , model . CheckReadonly , readDir )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/ref/refreshBacklink" , model . CheckAuth , refreshBacklink )
ginServer . Handle ( "POST" , "/api/ref/getBacklink" , model . CheckAuth , getBacklink )
2022-10-02 12:08:49 +08:00
ginServer . Handle ( "POST" , "/api/ref/getBacklink2" , model . CheckAuth , getBacklink2 )
2022-09-29 12:11:52 +08:00
ginServer . Handle ( "POST" , "/api/ref/getBacklinkDoc" , model . CheckAuth , getBacklinkDoc )
2022-10-01 16:01:34 +08:00
ginServer . Handle ( "POST" , "/api/ref/getBackmentionDoc" , model . CheckAuth , getBackmentionDoc )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/attr/getBookmarkLabels" , model . CheckAuth , getBookmarkLabels )
2023-03-10 09:58:18 +08:00
ginServer . Handle ( "POST" , "/api/attr/resetBlockAttrs" , model . CheckAuth , model . CheckReadonly , resetBlockAttrs )
ginServer . Handle ( "POST" , "/api/attr/setBlockAttrs" , model . CheckAuth , setBlockAttrs )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/attr/getBlockAttrs" , model . CheckAuth , getBlockAttrs )
ginServer . Handle ( "POST" , "/api/cloud/getCloudSpace" , model . CheckAuth , getCloudSpace )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/sync/setSyncEnable" , model . CheckAuth , model . CheckReadonly , setSyncEnable )
2023-06-11 23:24:17 +08:00
ginServer . Handle ( "POST" , "/api/sync/setSyncPerception" , model . CheckAuth , model . CheckReadonly , setSyncPerception )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/sync/setSyncGenerateConflictDoc" , model . CheckAuth , model . CheckReadonly , setSyncGenerateConflictDoc )
ginServer . Handle ( "POST" , "/api/sync/setSyncMode" , model . CheckAuth , model . CheckReadonly , setSyncMode )
ginServer . Handle ( "POST" , "/api/sync/setSyncProvider" , model . CheckAuth , model . CheckReadonly , setSyncProvider )
ginServer . Handle ( "POST" , "/api/sync/setSyncProviderS3" , model . CheckAuth , model . CheckReadonly , setSyncProviderS3 )
ginServer . Handle ( "POST" , "/api/sync/setSyncProviderWebDAV" , model . CheckAuth , model . CheckReadonly , setSyncProviderWebDAV )
ginServer . Handle ( "POST" , "/api/sync/setCloudSyncDir" , model . CheckAuth , model . CheckReadonly , setCloudSyncDir )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/sync/createCloudSyncDir" , model . CheckAuth , model . CheckReadonly , createCloudSyncDir )
ginServer . Handle ( "POST" , "/api/sync/removeCloudSyncDir" , model . CheckAuth , model . CheckReadonly , removeCloudSyncDir )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/sync/listCloudSyncDir" , model . CheckAuth , model . CheckReadonly , listCloudSyncDir )
ginServer . Handle ( "POST" , "/api/sync/performSync" , model . CheckAuth , model . CheckReadonly , performSync )
ginServer . Handle ( "POST" , "/api/sync/performBootSync" , model . CheckAuth , model . CheckReadonly , performBootSync )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/sync/getBootSync" , model . CheckAuth , getBootSync )
2023-06-12 10:37:54 +08:00
ginServer . Handle ( "POST" , "/api/sync/getSyncInfo" , model . CheckAuth , getSyncInfo )
2023-11-01 09:58:32 +08:00
ginServer . Handle ( "POST" , "/api/sync/exportSyncProviderS3" , model . CheckAuth , exportSyncProviderS3 )
2023-11-01 10:26:47 +08:00
ginServer . Handle ( "POST" , "/api/sync/importSyncProviderS3" , model . CheckAuth , importSyncProviderS3 )
2023-11-01 09:58:32 +08:00
ginServer . Handle ( "POST" , "/api/sync/exportSyncProviderWebDAV" , model . CheckAuth , exportSyncProviderWebDAV )
2023-11-01 10:26:47 +08:00
ginServer . Handle ( "POST" , "/api/sync/importSyncProviderWebDAV" , model . CheckAuth , importSyncProviderWebDAV )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/inbox/getShorthands" , model . CheckAuth , getShorthands )
2022-10-22 19:52:58 +08:00
ginServer . Handle ( "POST" , "/api/inbox/getShorthand" , model . CheckAuth , getShorthand )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/inbox/removeShorthands" , model . CheckAuth , model . CheckReadonly , removeShorthands )
2022-05-26 15:18:53 +08:00
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/extension/copy" , model . CheckAuth , model . CheckReadonly , extensionCopy )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/clipboard/readFilePaths" , model . CheckAuth , readFilePaths )
ginServer . Handle ( "POST" , "/api/asset/uploadCloud" , model . CheckAuth , model . CheckReadonly , uploadCloud )
ginServer . Handle ( "POST" , "/api/asset/insertLocalAssets" , model . CheckAuth , model . CheckReadonly , insertLocalAssets )
ginServer . Handle ( "POST" , "/api/asset/resolveAssetPath" , model . CheckAuth , resolveAssetPath )
ginServer . Handle ( "POST" , "/api/asset/upload" , model . CheckAuth , model . CheckReadonly , model . Upload )
ginServer . Handle ( "POST" , "/api/asset/setFileAnnotation" , model . CheckAuth , model . CheckReadonly , setFileAnnotation )
ginServer . Handle ( "POST" , "/api/asset/getFileAnnotation" , model . CheckAuth , getFileAnnotation )
ginServer . Handle ( "POST" , "/api/asset/getUnusedAssets" , model . CheckAuth , getUnusedAssets )
2023-06-04 10:30:19 +08:00
ginServer . Handle ( "POST" , "/api/asset/getMissingAssets" , model . CheckAuth , getMissingAssets )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/asset/removeUnusedAsset" , model . CheckAuth , model . CheckReadonly , removeUnusedAsset )
ginServer . Handle ( "POST" , "/api/asset/removeUnusedAssets" , model . CheckAuth , model . CheckReadonly , removeUnusedAssets )
ginServer . Handle ( "POST" , "/api/asset/getDocImageAssets" , model . CheckAuth , model . CheckReadonly , getDocImageAssets )
2022-07-15 10:38:01 +08:00
ginServer . Handle ( "POST" , "/api/asset/renameAsset" , model . CheckAuth , model . CheckReadonly , renameAsset )
2023-04-14 15:22:15 +08:00
ginServer . Handle ( "POST" , "/api/asset/getImageOCRText" , model . CheckAuth , model . CheckReadonly , getImageOCRText )
ginServer . Handle ( "POST" , "/api/asset/setImageOCRText" , model . CheckAuth , model . CheckReadonly , setImageOCRText )
2023-08-12 11:39:36 +08:00
ginServer . Handle ( "POST" , "/api/asset/fullReindexAssetContent" , model . CheckAuth , model . CheckReadonly , fullReindexAssetContent )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/export/batchExportMd" , model . CheckAuth , batchExportMd )
ginServer . Handle ( "POST" , "/api/export/exportMd" , model . CheckAuth , exportMd )
ginServer . Handle ( "POST" , "/api/export/exportSY" , model . CheckAuth , exportSY )
2022-07-24 22:05:14 +08:00
ginServer . Handle ( "POST" , "/api/export/exportNotebookSY" , model . CheckAuth , exportNotebookSY )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/export/exportMdContent" , model . CheckAuth , exportMdContent )
ginServer . Handle ( "POST" , "/api/export/exportHTML" , model . CheckAuth , exportHTML )
2022-09-08 10:20:06 +08:00
ginServer . Handle ( "POST" , "/api/export/exportPreviewHTML" , model . CheckAuth , exportPreviewHTML )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/export/exportMdHTML" , model . CheckAuth , exportMdHTML )
ginServer . Handle ( "POST" , "/api/export/exportDocx" , model . CheckAuth , exportDocx )
2023-02-23 10:50:08 +08:00
ginServer . Handle ( "POST" , "/api/export/processPDF" , model . CheckAuth , processPDF )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/export/preview" , model . CheckAuth , exportPreview )
2023-07-28 16:48:17 +08:00
ginServer . Handle ( "POST" , "/api/export/exportResources" , model . CheckAuth , exportResources )
2022-11-14 18:29:23 +08:00
ginServer . Handle ( "POST" , "/api/export/exportAsFile" , model . CheckAuth , exportAsFile )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/export/exportData" , model . CheckAuth , exportData )
ginServer . Handle ( "POST" , "/api/export/exportDataInFolder" , model . CheckAuth , exportDataInFolder )
2022-09-27 00:11:46 +08:00
ginServer . Handle ( "POST" , "/api/export/exportTempContent" , model . CheckAuth , exportTempContent )
2023-01-02 21:36:44 +08:00
ginServer . Handle ( "POST" , "/api/export/export2Liandi" , model . CheckAuth , export2Liandi )
2023-05-10 22:53:23 +08:00
ginServer . Handle ( "POST" , "/api/export/exportReStructuredText" , model . CheckAuth , exportReStructuredText )
ginServer . Handle ( "POST" , "/api/export/exportAsciiDoc" , model . CheckAuth , exportAsciiDoc )
2023-05-10 22:58:08 +08:00
ginServer . Handle ( "POST" , "/api/export/exportTextile" , model . CheckAuth , exportTextile )
2023-05-10 23:07:17 +08:00
ginServer . Handle ( "POST" , "/api/export/exportOPML" , model . CheckAuth , exportOPML )
2023-05-10 23:14:41 +08:00
ginServer . Handle ( "POST" , "/api/export/exportOrgMode" , model . CheckAuth , exportOrgMode )
2023-05-10 23:18:08 +08:00
ginServer . Handle ( "POST" , "/api/export/exportMediaWiki" , model . CheckAuth , exportMediaWiki )
2023-05-11 09:03:45 +08:00
ginServer . Handle ( "POST" , "/api/export/exportODT" , model . CheckAuth , exportODT )
2023-05-11 09:21:32 +08:00
ginServer . Handle ( "POST" , "/api/export/exportRTF" , model . CheckAuth , exportRTF )
2023-05-11 09:26:49 +08:00
ginServer . Handle ( "POST" , "/api/export/exportEPUB" , model . CheckAuth , exportEPUB )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/import/importStdMd" , model . CheckAuth , model . CheckReadonly , importStdMd )
ginServer . Handle ( "POST" , "/api/import/importData" , model . CheckAuth , model . CheckReadonly , importData )
ginServer . Handle ( "POST" , "/api/import/importSY" , model . CheckAuth , model . CheckReadonly , importSY )
2023-05-12 11:35:14 +08:00
ginServer . Handle ( "POST" , "/api/convert/pandoc" , model . CheckAuth , model . CheckReadonly , pandoc )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/template/render" , model . CheckAuth , renderTemplate )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/template/docSaveAsTemplate" , model . CheckAuth , model . CheckReadonly , docSaveAsTemplate )
2023-03-24 15:00:36 +08:00
ginServer . Handle ( "POST" , "/api/template/renderSprig" , model . CheckAuth , model . CheckReadonly , renderSprig )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/transactions" , model . CheckAuth , model . CheckReadonly , performTransactions )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/setting/setAccount" , model . CheckAuth , model . CheckReadonly , setAccount )
ginServer . Handle ( "POST" , "/api/setting/setEditor" , model . CheckAuth , model . CheckReadonly , setEditor )
ginServer . Handle ( "POST" , "/api/setting/setExport" , model . CheckAuth , model . CheckReadonly , setExport )
ginServer . Handle ( "POST" , "/api/setting/setFiletree" , model . CheckAuth , model . CheckReadonly , setFiletree )
ginServer . Handle ( "POST" , "/api/setting/setSearch" , model . CheckAuth , model . CheckReadonly , setSearch )
ginServer . Handle ( "POST" , "/api/setting/setKeymap" , model . CheckAuth , model . CheckReadonly , setKeymap )
ginServer . Handle ( "POST" , "/api/setting/setAppearance" , model . CheckAuth , model . CheckReadonly , setAppearance )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/setting/getCloudUser" , model . CheckAuth , getCloudUser )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/setting/logoutCloudUser" , model . CheckAuth , model . CheckReadonly , logoutCloudUser )
ginServer . Handle ( "POST" , "/api/setting/login2faCloudUser" , model . CheckAuth , model . CheckReadonly , login2faCloudUser )
ginServer . Handle ( "POST" , "/api/setting/setEmoji" , model . CheckAuth , model . CheckReadonly , setEmoji )
2023-03-19 17:06:09 +08:00
ginServer . Handle ( "POST" , "/api/setting/setFlashcard" , model . CheckAuth , model . CheckReadonly , setFlashcard )
2023-03-21 18:59:54 +08:00
ginServer . Handle ( "POST" , "/api/setting/setAI" , model . CheckAuth , model . CheckReadonly , setAI )
2023-05-25 10:40:09 +08:00
ginServer . Handle ( "POST" , "/api/setting/setBazaar" , model . CheckAuth , model . CheckReadonly , setBazaar )
2022-05-26 15:18:53 +08:00
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/graph/resetGraph" , model . CheckAuth , model . CheckReadonly , resetGraph )
ginServer . Handle ( "POST" , "/api/graph/resetLocalGraph" , model . CheckAuth , model . CheckReadonly , resetLocalGraph )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/graph/getGraph" , model . CheckAuth , getGraph )
ginServer . Handle ( "POST" , "/api/graph/getLocalGraph" , model . CheckAuth , getLocalGraph )
2023-04-25 18:52:19 +08:00
ginServer . Handle ( "POST" , "/api/bazaar/getBazaarPlugin" , model . CheckAuth , getBazaarPlugin )
ginServer . Handle ( "POST" , "/api/bazaar/getInstalledPlugin" , model . CheckAuth , getInstalledPlugin )
ginServer . Handle ( "POST" , "/api/bazaar/installBazaarPlugin" , model . CheckAuth , model . CheckReadonly , installBazaarPlugin )
ginServer . Handle ( "POST" , "/api/bazaar/uninstallBazaarPlugin" , model . CheckAuth , model . CheckReadonly , uninstallBazaarPlugin )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/bazaar/getBazaarWidget" , model . CheckAuth , getBazaarWidget )
2022-09-01 21:35:39 +08:00
ginServer . Handle ( "POST" , "/api/bazaar/getInstalledWidget" , model . CheckAuth , getInstalledWidget )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/bazaar/installBazaarWidget" , model . CheckAuth , model . CheckReadonly , installBazaarWidget )
ginServer . Handle ( "POST" , "/api/bazaar/uninstallBazaarWidget" , model . CheckAuth , model . CheckReadonly , uninstallBazaarWidget )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/bazaar/getBazaarIcon" , model . CheckAuth , getBazaarIcon )
2022-09-01 21:24:18 +08:00
ginServer . Handle ( "POST" , "/api/bazaar/getInstalledIcon" , model . CheckAuth , getInstalledIcon )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/bazaar/installBazaarIcon" , model . CheckAuth , model . CheckReadonly , installBazaarIcon )
ginServer . Handle ( "POST" , "/api/bazaar/uninstallBazaarIcon" , model . CheckAuth , model . CheckReadonly , uninstallBazaarIcon )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/bazaar/getBazaarTemplate" , model . CheckAuth , getBazaarTemplate )
2022-09-01 19:37:33 +08:00
ginServer . Handle ( "POST" , "/api/bazaar/getInstalledTemplate" , model . CheckAuth , getInstalledTemplate )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/bazaar/installBazaarTemplate" , model . CheckAuth , model . CheckReadonly , installBazaarTemplate )
ginServer . Handle ( "POST" , "/api/bazaar/uninstallBazaarTemplate" , model . CheckAuth , model . CheckReadonly , uninstallBazaarTemplate )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/bazaar/getBazaarTheme" , model . CheckAuth , getBazaarTheme )
2022-09-01 19:37:33 +08:00
ginServer . Handle ( "POST" , "/api/bazaar/getInstalledTheme" , model . CheckAuth , getInstalledTheme )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/bazaar/installBazaarTheme" , model . CheckAuth , model . CheckReadonly , installBazaarTheme )
ginServer . Handle ( "POST" , "/api/bazaar/uninstallBazaarTheme" , model . CheckAuth , model . CheckReadonly , uninstallBazaarTheme )
2022-05-26 15:18:53 +08:00
ginServer . Handle ( "POST" , "/api/bazaar/getBazaarPackageREAME" , model . CheckAuth , getBazaarPackageREAME )
2022-06-05 11:40:21 +08:00
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/repo/initRepoKey" , model . CheckAuth , model . CheckReadonly , initRepoKey )
ginServer . Handle ( "POST" , "/api/repo/initRepoKeyFromPassphrase" , model . CheckAuth , model . CheckReadonly , initRepoKeyFromPassphrase )
ginServer . Handle ( "POST" , "/api/repo/resetRepo" , model . CheckAuth , model . CheckReadonly , resetRepo )
2023-04-20 18:54:24 +08:00
ginServer . Handle ( "POST" , "/api/repo/purgeRepo" , model . CheckAuth , model . CheckReadonly , purgeRepo )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/repo/importRepoKey" , model . CheckAuth , model . CheckReadonly , importRepoKey )
ginServer . Handle ( "POST" , "/api/repo/createSnapshot" , model . CheckAuth , model . CheckReadonly , createSnapshot )
ginServer . Handle ( "POST" , "/api/repo/tagSnapshot" , model . CheckAuth , model . CheckReadonly , tagSnapshot )
ginServer . Handle ( "POST" , "/api/repo/checkoutRepo" , model . CheckAuth , model . CheckReadonly , checkoutRepo )
2022-07-05 21:21:47 +08:00
ginServer . Handle ( "POST" , "/api/repo/getRepoSnapshots" , model . CheckAuth , getRepoSnapshots )
ginServer . Handle ( "POST" , "/api/repo/getRepoTagSnapshots" , model . CheckAuth , getRepoTagSnapshots )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/repo/removeRepoTagSnapshot" , model . CheckAuth , model . CheckReadonly , removeRepoTagSnapshot )
2022-07-05 21:44:10 +08:00
ginServer . Handle ( "POST" , "/api/repo/getCloudRepoTagSnapshots" , model . CheckAuth , getCloudRepoTagSnapshots )
2023-04-21 17:04:26 +08:00
ginServer . Handle ( "POST" , "/api/repo/getCloudRepoSnapshots" , model . CheckAuth , getCloudRepoSnapshots )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/repo/removeCloudRepoTagSnapshot" , model . CheckAuth , model . CheckReadonly , removeCloudRepoTagSnapshot )
ginServer . Handle ( "POST" , "/api/repo/uploadCloudSnapshot" , model . CheckAuth , model . CheckReadonly , uploadCloudSnapshot )
ginServer . Handle ( "POST" , "/api/repo/downloadCloudSnapshot" , model . CheckAuth , model . CheckReadonly , downloadCloudSnapshot )
2022-12-15 10:25:33 +08:00
ginServer . Handle ( "POST" , "/api/repo/diffRepoSnapshots" , model . CheckAuth , diffRepoSnapshots )
2022-12-15 11:07:42 +08:00
ginServer . Handle ( "POST" , "/api/repo/openRepoSnapshotDoc" , model . CheckAuth , openRepoSnapshotDoc )
2022-06-13 16:33:54 +08:00
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/riff/createRiffDeck" , model . CheckAuth , model . CheckReadonly , createRiffDeck )
ginServer . Handle ( "POST" , "/api/riff/renameRiffDeck" , model . CheckAuth , model . CheckReadonly , renameRiffDeck )
ginServer . Handle ( "POST" , "/api/riff/removeRiffDeck" , model . CheckAuth , model . CheckReadonly , removeRiffDeck )
2022-12-21 20:11:12 +08:00
ginServer . Handle ( "POST" , "/api/riff/getRiffDecks" , model . CheckAuth , getRiffDecks )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/riff/addRiffCards" , model . CheckAuth , model . CheckReadonly , addRiffCards )
ginServer . Handle ( "POST" , "/api/riff/removeRiffCards" , model . CheckAuth , model . CheckReadonly , removeRiffCards )
2022-12-21 15:58:29 +08:00
ginServer . Handle ( "POST" , "/api/riff/getRiffDueCards" , model . CheckAuth , getRiffDueCards )
2023-02-18 22:32:34 +08:00
ginServer . Handle ( "POST" , "/api/riff/getTreeRiffDueCards" , model . CheckAuth , getTreeRiffDueCards )
2023-02-27 09:46:39 +08:00
ginServer . Handle ( "POST" , "/api/riff/getNotebookRiffDueCards" , model . CheckAuth , getNotebookRiffDueCards )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/riff/reviewRiffCard" , model . CheckAuth , model . CheckReadonly , reviewRiffCard )
2023-03-18 17:10:14 +08:00
ginServer . Handle ( "POST" , "/api/riff/skipReviewRiffCard" , model . CheckAuth , model . CheckReadonly , skipReviewRiffCard )
2022-12-29 21:46:35 +08:00
ginServer . Handle ( "POST" , "/api/riff/getRiffCards" , model . CheckAuth , getRiffCards )
2023-02-18 23:53:28 +08:00
ginServer . Handle ( "POST" , "/api/riff/getTreeRiffCards" , model . CheckAuth , getTreeRiffCards )
2023-02-27 15:52:45 +08:00
ginServer . Handle ( "POST" , "/api/riff/getNotebookRiffCards" , model . CheckAuth , getNotebookRiffCards )
2023-11-16 11:37:56 +08:00
ginServer . Handle ( "POST" , "/api/riff/resetRiffCards" , model . CheckAuth , resetRiffCards )
2022-12-21 15:03:49 +08:00
2022-06-05 11:40:21 +08:00
ginServer . Handle ( "POST" , "/api/notification/pushMsg" , model . CheckAuth , pushMsg )
ginServer . Handle ( "POST" , "/api/notification/pushErrMsg" , model . CheckAuth , pushErrMsg )
2022-10-11 23:33:27 +08:00
ginServer . Handle ( "POST" , "/api/snippet/getSnippet" , model . CheckAuth , getSnippet )
2022-10-26 20:44:45 +08:00
ginServer . Handle ( "POST" , "/api/snippet/setSnippet" , model . CheckAuth , setSnippet )
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/snippet/removeSnippet" , model . CheckAuth , model . CheckReadonly , removeSnippet )
2022-10-26 12:09:41 +08:00
ginServer . Handle ( "GET" , "/snippets/*filepath" , serveSnippets )
2023-03-03 15:01:42 +08:00
ginServer . Handle ( "POST" , "/api/av/renderAttributeView" , model . CheckAuth , renderAttributeView )
2023-07-30 20:35:03 +08:00
ginServer . Handle ( "POST" , "/api/av/getAttributeViewKeys" , model . CheckAuth , getAttributeViewKeys )
2023-07-31 23:34:36 +08:00
ginServer . Handle ( "POST" , "/api/av/setAttributeViewBlockAttr" , model . CheckAuth , setAttributeViewBlockAttr )
2023-03-03 22:39:45 +08:00
2023-03-10 09:37:59 +08:00
ginServer . Handle ( "POST" , "/api/ai/chatGPT" , model . CheckAuth , model . CheckReadonly , chatGPT )
ginServer . Handle ( "POST" , "/api/ai/chatGPTWithAction" , model . CheckAuth , model . CheckReadonly , chatGPTWithAction )
2023-05-04 19:48:03 +08:00
2023-09-01 20:13:24 +08:00
ginServer . Handle ( "POST" , "/api/petal/loadPetals" , model . CheckAuth , loadPetals )
2023-05-05 16:20:23 +08:00
ginServer . Handle ( "POST" , "/api/petal/setPetalEnabled" , model . CheckAuth , model . CheckReadonly , setPetalEnabled )
2023-07-10 23:02:17 +08:00
ginServer . Handle ( "POST" , "/api/network/forwardProxy" , model . CheckAuth , model . CheckReadonly , forwardProxy )
2023-08-23 17:31:59 +08:00
ginServer . Handle ( "GET" , "/ws/broadcast" , model . CheckAuth , broadcast )
ginServer . Handle ( "GET" , "/api/broadcast/channels" , model . CheckAuth , getChannels )
ginServer . Handle ( "POST" , "/api/broadcast/postMessage" , model . CheckAuth , postMessage )
ginServer . Handle ( "POST" , "/api/broadcast/getChannelInfo" , model . CheckAuth , getChannelInfo )
2023-08-26 22:38:02 +08:00
ginServer . Handle ( "POST" , "/api/archive/zip" , model . CheckAuth , zip )
ginServer . Handle ( "POST" , "/api/archive/unzip" , model . CheckAuth , unzip )
2022-05-26 15:18:53 +08:00
}