36 lines
711 B
Go
36 lines
711 B
Go
|
|
// Code scaffolded by goctl. Safe to edit.
|
||
|
|
// goctl 1.10.1
|
||
|
|
|
||
|
|
package handler
|
||
|
|
|
||
|
|
import (
|
||
|
|
"net/http"
|
||
|
|
|
||
|
|
"img_infinite_canvas/internal/svc"
|
||
|
|
|
||
|
|
"github.com/zeromicro/go-zero/rest"
|
||
|
|
)
|
||
|
|
|
||
|
|
func RegisterV1Handlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||
|
|
server.AddRoutes(
|
||
|
|
[]rest.Route{
|
||
|
|
{
|
||
|
|
Method: http.MethodPost,
|
||
|
|
Path: "/context/vision/recognize_object",
|
||
|
|
Handler: recognizeObjectHandler(serverCtx),
|
||
|
|
},
|
||
|
|
{
|
||
|
|
Method: http.MethodGet,
|
||
|
|
Path: "/generator/tasks",
|
||
|
|
Handler: getGeneratorTaskHandler(serverCtx),
|
||
|
|
},
|
||
|
|
{
|
||
|
|
Method: http.MethodPost,
|
||
|
|
Path: "/generator/tasks",
|
||
|
|
Handler: submitGeneratorTaskHandler(serverCtx),
|
||
|
|
},
|
||
|
|
},
|
||
|
|
rest.WithPrefix("/v1"),
|
||
|
|
)
|
||
|
|
}
|