// Code generated by goctl. DO NOT EDIT.
// goctl 1.10.1

package handler

import (
	"net/http"

	ai "haixun-backend/internal/handler/ai"
	auth "haixun-backend/internal/handler/auth"
	brand "haixun-backend/internal/handler/brand"
	copy_mission "haixun-backend/internal/handler/copy_mission"
	job "haixun-backend/internal/handler/job"
	member "haixun-backend/internal/handler/member"
	normal "haixun-backend/internal/handler/normal"
	permission "haixun-backend/internal/handler/permission"
	persona "haixun-backend/internal/handler/persona"
	placement_topic "haixun-backend/internal/handler/placement_topic"
	setting "haixun-backend/internal/handler/setting"
	threads_account "haixun-backend/internal/handler/threads_account"
	"haixun-backend/internal/svc"

	"github.com/zeromicro/go-zero/rest"
)

func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
	server.AddRoutes(
		[]rest.Route{
			{
				Method:  http.MethodGet,
				Path:    "/providers",
				Handler: ai.ListAiProvidersHandler(serverCtx),
			},
		},
		rest.WithPrefix("/api/v1/ai"),
	)

	server.AddRoutes(
		rest.WithMiddlewares(
			[]rest.Middleware{serverCtx.MemberAuth},
			[]rest.Route{
				{
					Method:  http.MethodPost,
					Path:    "/chat",
					Handler: ai.ChatHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/chat/stream",
					Handler: ai.ChatStreamHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/providers/:provider/models",
					Handler: ai.ListAiProviderModelsHandler(serverCtx),
				},
			}...,
		),
		rest.WithPrefix("/api/v1/ai"),
	)

	server.AddRoutes(
		rest.WithMiddlewares(
			[]rest.Middleware{serverCtx.AuthJWT},
			[]rest.Route{
				{
					Method:  http.MethodPost,
					Path:    "/islander/chat/stream",
					Handler: ai.IslanderChatStreamHandler(serverCtx),
				},
			}...,
		),
		rest.WithPrefix("/api/v1/ai"),
	)

	server.AddRoutes(
		[]rest.Route{
			{
				Method:  http.MethodPost,
				Path:    "/login",
				Handler: auth.LoginHandler(serverCtx),
			},
			{
				Method:  http.MethodPost,
				Path:    "/refresh",
				Handler: auth.RefreshHandler(serverCtx),
			},
			{
				Method:  http.MethodPost,
				Path:    "/register",
				Handler: auth.RegisterHandler(serverCtx),
			},
		},
		rest.WithPrefix("/api/v1/auth"),
	)

	server.AddRoutes(
		rest.WithMiddlewares(
			[]rest.Middleware{serverCtx.AuthJWT},
			[]rest.Route{
				{
					Method:  http.MethodPost,
					Path:    "/logout",
					Handler: auth.LogoutHandler(serverCtx),
				},
			}...,
		),
		rest.WithPrefix("/api/v1/auth"),
	)

	server.AddRoutes(
		rest.WithMiddlewares(
			[]rest.Middleware{serverCtx.AuthJWT},
			[]rest.Route{
				{
					Method:  http.MethodGet,
					Path:    "/",
					Handler: brand.ListBrandsHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/",
					Handler: brand.CreateBrandHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/:id",
					Handler: brand.GetBrandHandler(serverCtx),
				},
				{
					Method:  http.MethodPatch,
					Path:    "/:id",
					Handler: brand.UpdateBrandHandler(serverCtx),
				},
				{
					Method:  http.MethodDelete,
					Path:    "/:id",
					Handler: brand.DeleteBrandHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/:id/content-matrix",
					Handler: brand.GetBrandContentMatrixHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/:id/content-matrix/generate",
					Handler: brand.GenerateBrandContentMatrixHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/:id/knowledge-graph",
					Handler: brand.GetKnowledgeGraphHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/:id/knowledge-graph/expand",
					Handler: brand.ExpandKnowledgeGraphHandler(serverCtx),
				},
				{
					Method:  http.MethodPatch,
					Path:    "/:id/knowledge-graph/nodes",
					Handler: brand.PatchKnowledgeGraphNodesHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/:id/outreach-drafts/generate",
					Handler: brand.GenerateOutreachDraftsHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/:id/outreach-drafts/publish",
					Handler: brand.PublishOutreachDraftHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/:id/products",
					Handler: brand.ListBrandProductsHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/:id/products",
					Handler: brand.CreateBrandProductHandler(serverCtx),
				},
				{
					Method:  http.MethodPatch,
					Path:    "/:id/products/:productId",
					Handler: brand.UpdateBrandProductHandler(serverCtx),
				},
				{
					Method:  http.MethodDelete,
					Path:    "/:id/products/:productId",
					Handler: brand.DeleteBrandProductHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/:id/scan-jobs",
					Handler: brand.StartBrandScanJobHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/:id/scan-posts",
					Handler: brand.ListBrandScanPostsHandler(serverCtx),
				},
				{
					Method:  http.MethodPatch,
					Path:    "/:id/scan-posts/:postId",
					Handler: brand.PatchScanPostOutreachHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/:id/scan-schedule",
					Handler: brand.GetBrandScanScheduleHandler(serverCtx),
				},
				{
					Method:  http.MethodPut,
					Path:    "/:id/scan-schedule",
					Handler: brand.UpsertBrandScanScheduleHandler(serverCtx),
				},
			}...,
		),
		rest.WithPrefix("/api/v1/brands"),
	)

	server.AddRoutes(
		rest.WithMiddlewares(
			[]rest.Middleware{serverCtx.AuthJWT},
			[]rest.Route{
				{
					Method:  http.MethodPost,
					Path:    "/:personaId/copy-mission-inspiration",
					Handler: copy_mission.InspireCopyMissionHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/:personaId/copy-missions",
					Handler: copy_mission.ListCopyMissionsHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/:personaId/copy-missions",
					Handler: copy_mission.CreateCopyMissionHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/:personaId/copy-missions/:id",
					Handler: copy_mission.GetCopyMissionHandler(serverCtx),
				},
				{
					Method:  http.MethodPatch,
					Path:    "/:personaId/copy-missions/:id",
					Handler: copy_mission.UpdateCopyMissionHandler(serverCtx),
				},
				{
					Method:  http.MethodDelete,
					Path:    "/:personaId/copy-missions/:id",
					Handler: copy_mission.DeleteCopyMissionHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/:personaId/copy-missions/:id/analyze-jobs",
					Handler: copy_mission.StartCopyMissionAnalyzeJobHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/:personaId/copy-missions/:id/copy-draft-jobs",
					Handler: copy_mission.StartCopyMissionCopyDraftJobHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/:personaId/copy-missions/:id/copy-drafts",
					Handler: copy_mission.ListCopyMissionCopyDraftsHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/:personaId/copy-missions/:id/matrix-drafts",
					Handler: copy_mission.GenerateCopyMissionMatrixHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/:personaId/copy-missions/:id/matrix-jobs",
					Handler: copy_mission.StartCopyMissionMatrixJobHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/:personaId/copy-missions/:id/scan-jobs",
					Handler: copy_mission.StartCopyMissionScanJobHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/:personaId/copy-missions/:id/scan-posts",
					Handler: copy_mission.ListCopyMissionScanPostsHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/:personaId/copy-missions/:id/scan-schedule",
					Handler: copy_mission.GetCopyMissionScanScheduleHandler(serverCtx),
				},
				{
					Method:  http.MethodPut,
					Path:    "/:personaId/copy-missions/:id/scan-schedule",
					Handler: copy_mission.UpsertCopyMissionScanScheduleHandler(serverCtx),
				},
			}...,
		),
		rest.WithPrefix("/api/v1/personas"),
	)

	server.AddRoutes(
		rest.WithMiddlewares(
			[]rest.Middleware{serverCtx.WorkerSecret},
			[]rest.Route{
				{
					Method:  http.MethodPost,
					Path:    "/workers/jobs/:id/analyze-style8d",
					Handler: job.AnalyzeStyle8DFromWorkerHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/workers/jobs/:id/cancel-ack",
					Handler: job.AckWorkerJobCancelHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/workers/jobs/:id/cancel-check",
					Handler: job.CheckWorkerJobCancelHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/workers/jobs/:id/complete",
					Handler: job.CompleteWorkerJobHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/workers/jobs/:id/fail",
					Handler: job.FailWorkerJobHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/workers/jobs/:id/heartbeat",
					Handler: job.RefreshWorkerJobLockHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/workers/jobs/:id/progress",
					Handler: job.UpdateWorkerJobProgressHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/workers/jobs/claim",
					Handler: job.ClaimWorkerJobHandler(serverCtx),
				},
				{
					Method:  http.MethodPatch,
					Path:    "/workers/personas/:id/style-profile",
					Handler: job.StorePersonaStyleProfileFromWorkerHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/workers/threads-accounts/:id/session",
					Handler: job.GetWorkerThreadsAccountSessionHandler(serverCtx),
				},
			}...,
		),
		rest.WithPrefix("/api/v1/internal"),
	)

	server.AddRoutes(
		rest.WithMiddlewares(
			[]rest.Middleware{serverCtx.AuthJWT},
			[]rest.Route{
				{
					Method:  http.MethodGet,
					Path:    "/job/schedules",
					Handler: job.ListJobSchedulesHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/job/schedules",
					Handler: job.CreateJobScheduleHandler(serverCtx),
				},
				{
					Method:  http.MethodPut,
					Path:    "/job/schedules/:id",
					Handler: job.UpdateJobScheduleHandler(serverCtx),
				},
				{
					Method:  http.MethodDelete,
					Path:    "/job/schedules/:id",
					Handler: job.DeleteJobScheduleHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/job/schedules/:id/disable",
					Handler: job.DisableJobScheduleHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/job/schedules/:id/enable",
					Handler: job.EnableJobScheduleHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/job/templates",
					Handler: job.ListJobTemplatesHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/job/templates/:type",
					Handler: job.GetJobTemplateHandler(serverCtx),
				},
				{
					Method:  http.MethodPut,
					Path:    "/job/templates/:type",
					Handler: job.UpsertJobTemplateHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/jobs",
					Handler: job.CreateJobHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/jobs",
					Handler: job.ListJobsHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/jobs/:id",
					Handler: job.GetJobHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/jobs/:id/cancel",
					Handler: job.CancelJobHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/jobs/:id/events",
					Handler: job.ListJobEventsHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/jobs/:id/retry",
					Handler: job.RetryJobHandler(serverCtx),
				},
			}...,
		),
		rest.WithPrefix("/api/v1"),
	)

	server.AddRoutes(
		rest.WithMiddlewares(
			[]rest.Middleware{serverCtx.AuthJWT},
			[]rest.Route{
				{
					Method:  http.MethodGet,
					Path:    "/me",
					Handler: member.GetMemberMeHandler(serverCtx),
				},
				{
					Method:  http.MethodPatch,
					Path:    "/me",
					Handler: member.UpdateMemberMeHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/me/placement-settings",
					Handler: member.GetMemberPlacementSettingsHandler(serverCtx),
				},
				{
					Method:  http.MethodPatch,
					Path:    "/me/placement-settings",
					Handler: member.UpdateMemberPlacementSettingsHandler(serverCtx),
				},
			}...,
		),
		rest.WithPrefix("/api/v1/members"),
	)

	server.AddRoutes(
		[]rest.Route{
			{
				Method:  http.MethodGet,
				Path:    "/health",
				Handler: normal.HealthHandler(serverCtx),
			},
		},
		rest.WithPrefix("/api/v1"),
	)

	server.AddRoutes(
		rest.WithMiddlewares(
			[]rest.Middleware{serverCtx.AuthJWT},
			[]rest.Route{
				{
					Method:  http.MethodGet,
					Path:    "/catalog",
					Handler: permission.GetPermissionCatalogHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/me",
					Handler: permission.GetMePermissionsHandler(serverCtx),
				},
			}...,
		),
		rest.WithPrefix("/api/v1/permissions"),
	)

	server.AddRoutes(
		rest.WithMiddlewares(
			[]rest.Middleware{serverCtx.AuthJWT},
			[]rest.Route{
				{
					Method:  http.MethodGet,
					Path:    "/",
					Handler: persona.ListPersonasHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/",
					Handler: persona.CreatePersonaHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/:id",
					Handler: persona.GetPersonaHandler(serverCtx),
				},
				{
					Method:  http.MethodPatch,
					Path:    "/:id",
					Handler: persona.UpdatePersonaHandler(serverCtx),
				},
				{
					Method:  http.MethodDelete,
					Path:    "/:id",
					Handler: persona.DeletePersonaHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/:id/copy-drafts",
					Handler: persona.ListPersonaCopyDraftsHandler(serverCtx),
				},
				{
					Method:  http.MethodPatch,
					Path:    "/:id/copy-drafts/:draftId",
					Handler: persona.UpdatePersonaCopyDraftHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/:id/copy-drafts/:draftId/publish",
					Handler: persona.PublishPersonaCopyDraftHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/:id/copy-drafts/generate",
					Handler: persona.GeneratePersonaCopyDraftHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/:id/style-analysis",
					Handler: persona.StartPersonaStyleAnalysisHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/:id/viral-scan-jobs",
					Handler: persona.StartPersonaViralScanJobHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/:id/viral-scan-posts",
					Handler: persona.ListPersonaViralScanPostsHandler(serverCtx),
				},
			}...,
		),
		rest.WithPrefix("/api/v1/personas"),
	)

	server.AddRoutes(
		rest.WithMiddlewares(
			[]rest.Middleware{serverCtx.AuthJWT},
			[]rest.Route{
				{
					Method:  http.MethodGet,
					Path:    "/",
					Handler: placement_topic.ListPlacementTopicsHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/",
					Handler: placement_topic.CreatePlacementTopicHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/:id",
					Handler: placement_topic.GetPlacementTopicHandler(serverCtx),
				},
				{
					Method:  http.MethodPatch,
					Path:    "/:id",
					Handler: placement_topic.UpdatePlacementTopicHandler(serverCtx),
				},
				{
					Method:  http.MethodDelete,
					Path:    "/:id",
					Handler: placement_topic.DeletePlacementTopicHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/:id/content-matrix",
					Handler: placement_topic.GetPlacementTopicContentMatrixHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/:id/content-matrix/generate",
					Handler: placement_topic.GeneratePlacementTopicContentMatrixHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/:id/knowledge-graph",
					Handler: placement_topic.GetPlacementTopicGraphHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/:id/knowledge-graph/expand",
					Handler: placement_topic.ExpandPlacementTopicGraphHandler(serverCtx),
				},
				{
					Method:  http.MethodPatch,
					Path:    "/:id/knowledge-graph/nodes",
					Handler: placement_topic.PatchPlacementTopicGraphNodesHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/:id/outreach-drafts/generate",
					Handler: placement_topic.GeneratePlacementTopicOutreachDraftsHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/:id/outreach-drafts/publish",
					Handler: placement_topic.PublishPlacementTopicOutreachDraftHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/:id/scan-jobs",
					Handler: placement_topic.StartPlacementTopicScanJobHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/:id/scan-posts",
					Handler: placement_topic.ListPlacementTopicScanPostsHandler(serverCtx),
				},
				{
					Method:  http.MethodPatch,
					Path:    "/:id/scan-posts/:postId",
					Handler: placement_topic.PatchPlacementTopicScanPostOutreachHandler(serverCtx),
				},
				{
					Method:  http.MethodDelete,
					Path:    "/:id/scan-posts/:postId",
					Handler: placement_topic.DeletePlacementTopicScanPostHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/:id/scan-posts/batch-delete",
					Handler: placement_topic.BatchDeletePlacementTopicScanPostsHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/:id/scan-schedule",
					Handler: placement_topic.GetPlacementTopicScanScheduleHandler(serverCtx),
				},
				{
					Method:  http.MethodPut,
					Path:    "/:id/scan-schedule",
					Handler: placement_topic.UpsertPlacementTopicScanScheduleHandler(serverCtx),
				},
			}...,
		),
		rest.WithPrefix("/api/v1/placement/topics"),
	)

	server.AddRoutes(
		rest.WithMiddlewares(
			[]rest.Middleware{serverCtx.AuthJWT},
			[]rest.Route{
				{
					Method:  http.MethodGet,
					Path:    "/:scope/:scope_id",
					Handler: setting.ListSettingsHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/:scope/:scope_id/:key",
					Handler: setting.GetSettingHandler(serverCtx),
				},
				{
					Method:  http.MethodPut,
					Path:    "/:scope/:scope_id/:key",
					Handler: setting.UpsertSettingHandler(serverCtx),
				},
				{
					Method:  http.MethodDelete,
					Path:    "/:scope/:scope_id/:key",
					Handler: setting.DeleteSettingHandler(serverCtx),
				},
			}...,
		),
		rest.WithPrefix("/api/v1/settings"),
	)

	server.AddRoutes(
		rest.WithMiddlewares(
			[]rest.Middleware{serverCtx.AuthJWT},
			[]rest.Route{
				{
					Method:  http.MethodGet,
					Path:    "/",
					Handler: threads_account.ListThreadsAccountsHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/",
					Handler: threads_account.CreateThreadsAccountHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/:id",
					Handler: threads_account.GetThreadsAccountHandler(serverCtx),
				},
				{
					Method:  http.MethodPatch,
					Path:    "/:id",
					Handler: threads_account.UpdateThreadsAccountHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/:id/activate",
					Handler: threads_account.ActivateThreadsAccountHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/:id/ai-settings",
					Handler: threads_account.GetThreadsAccountAiSettingsHandler(serverCtx),
				},
				{
					Method:  http.MethodPut,
					Path:    "/:id/ai-settings",
					Handler: threads_account.UpdateThreadsAccountAiSettingsHandler(serverCtx),
				},
				{
					Method:  http.MethodGet,
					Path:    "/:id/connection",
					Handler: threads_account.GetThreadsAccountConnectionHandler(serverCtx),
				},
				{
					Method:  http.MethodPatch,
					Path:    "/:id/connection",
					Handler: threads_account.UpdateThreadsAccountConnectionHandler(serverCtx),
				},
				{
					Method:  http.MethodPost,
					Path:    "/:id/session/import",
					Handler: threads_account.ImportThreadsAccountSessionHandler(serverCtx),
				},
			}...,
		),
		rest.WithPrefix("/api/v1/threads-accounts"),
	)
}
