Files
moteva/server/internal/handler/routes.go
T
root 263748af4a feat(api): add Lovart-style project and agent thread endpoints
Add canva/canda-compatible routes for lightweight project open/save and
agent thread history:
- POST /canva/project/queryProject, saveProject
- POST /canva/agent/queryAgentLastThread, agentThreadList
- GET /canda/chat-history, /canda/thread/status

Canvas save now accepts a compressed SHAKKERDATA:// snapshot payload,
preserves connections, and returns a SaveProject response; blank
successful image nodes are backfilled from generated artifacts. Frontend
designGateway adopts the new save/query flow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-08 19:10:08 +08:00

276 lines
6.7 KiB
Go

// Code generated by goctl. DO NOT EDIT.
// goctl 1.10.1
package handler
import (
"net/http"
"img_infinite_canvas/internal/svc"
"github.com/zeromicro/go-zero/rest"
)
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
[]rest.Route{
{
Method: http.MethodGet,
Path: "/account/devices",
Handler: listAccountDevicesHandler(serverCtx),
},
{
Method: http.MethodDelete,
Path: "/account/devices",
Handler: removeAccountDevicesHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/account/logout",
Handler: logoutAccountHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/account/profile",
Handler: getAccountProfileHandler(serverCtx),
},
{
Method: http.MethodPatch,
Path: "/account/profile",
Handler: updateAccountProfileHandler(serverCtx),
},
{
Method: http.MethodDelete,
Path: "/assets",
Handler: deleteAssetHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/assets/upload-url",
Handler: createAssetUploadHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/auth/china/password-login",
Handler: loginChinaPasswordHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/auth/china/sms-code",
Handler: requestChinaSmsCodeHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/auth/china/sms-login",
Handler: loginChinaSmsCodeHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/auth/china/wechat-login",
Handler: loginChinaWechatHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/auth/china/wechat/auth-url",
Handler: getWechatAuthUrlHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/auth/global/email-code",
Handler: requestGlobalEmailCodeHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/auth/global/email-login",
Handler: loginGlobalEmailCodeHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/auth/global/google-login",
Handler: loginGlobalGoogleHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/auth/options",
Handler: getAuthOptionsHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/canda/chat-history",
Handler: candaChatHistoryHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/canda/thread/status",
Handler: candaThreadStatusHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/canva/agent/agentThreadList",
Handler: agentThreadListHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/canva/agent/queryAgentLastThread",
Handler: queryAgentLastThreadHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/canva/project/queryProject",
Handler: queryProjectHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/canva/project/saveProject",
Handler: saveProjectHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/context/vision/recognize_object",
Handler: recognizeObjectHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/dashboard",
Handler: dashboardHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/generator/tasks",
Handler: getGeneratorTaskHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/generator/tasks",
Handler: submitGeneratorTaskHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/health",
Handler: healthHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/mockup/blob/:dataId",
Handler: getMockupBlobHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/projects",
Handler: listProjectsHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/projects",
Handler: createProjectHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/projects/:id",
Handler: getProjectHandler(serverCtx),
},
{
Method: http.MethodDelete,
Path: "/projects/:id",
Handler: deleteProjectHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/projects/:id/agent/chat",
Handler: agentChatHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/projects/:id/agent/status",
Handler: getAgentThreadStatusHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/projects/:id/agent/stop",
Handler: stopAgentTaskHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/projects/:id/agent/threads",
Handler: listAgentThreadsHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/projects/:id/agent/ws",
Handler: agentWebsocketHandler(serverCtx),
},
{
Method: http.MethodPatch,
Path: "/projects/:id/canvas",
Handler: saveCanvasHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/projects/:id/events",
Handler: projectEventsHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/projects/:id/generate",
Handler: generateProjectHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/projects/:id/generate/async",
Handler: generateProjectAsyncHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/projects/:id/history",
Handler: getProjectHistoryHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/projects/:id/layers/merge",
Handler: mergeLayersHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/projects/:id/nodes/:nodeId/actions/async",
Handler: runNodeActionAsyncHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/projects/:id/nodes/:nodeId/mockup-model",
Handler: generateMockupModelHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/projects/:id/nodes/:nodeId/mockup-surface",
Handler: prepareMockupSurfaceHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/projects/:id/nodes/:nodeId/text-extraction",
Handler: extractNodeTextHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/projects/:id/nodes/:nodeId/text-extraction/async",
Handler: extractNodeTextAsyncHandler(serverCtx),
},
{
Method: http.MethodPatch,
Path: "/projects/:id/title",
Handler: updateProjectTitleHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/projects/async",
Handler: createProjectAsyncHandler(serverCtx),
},
{
Method: http.MethodDelete,
Path: "/projects/batch-delete",
Handler: deleteProjectsHandler(serverCtx),
},
},
rest.WithPrefix("/api"),
)
}