table_router.go 3.1 KB
package routers

import (
	"github.com/beego/beego/v2/server/web"
	"gitlab.fjmaimaimai.com/allied-creation/character-library-metadata-bastion/pkg/port/beego/controllers"
)

func init() {
	tableController := &controllers.TableController{}
	tableController.BaseController.ErrorResolver, _ = controllers.NewCommErrorResolver()
	web.Router("/data/tables/", tableController, "Post:CreateTable")
	//web.Router("/data/tables/:tableId", tableController, "Put:UpdateTable")
	web.Router("/data/tables/:tableId", tableController, "Get:GetTable")
	web.Router("/data/tables/prepare", tableController, "Get:PrepareTable")
	web.Router("/data/tables/:tableId", tableController, "Delete:RemoveTable")
	web.Router("/data/tables/", tableController, "Get:ListTable")
	web.Router("/data/tables/search", tableController, "Post:Search")
	web.Router("/data/tables/relation-graph", tableController, "Post:RelationGraph")
	web.Router("/data/tables/apply-on", tableController, "Post:ApplyOn")
	web.Router("/data/tables/valid-expr-sql", tableController, "Post:ValidExprSql")
	web.Router("/data/tables/check", tableController, "Post:CheckRowDuplicate")
	web.Router("/data/tables/check-row-value-duplicate", tableController, "Post:CheckRowValueDuplicate")
	web.Router("/data/tables/search-appended-list", tableController, "Post:SearchAppendedList")
	web.Router("/data/tables/search-sub-table-list", tableController, "Post:SearchSubTableList")
	web.Router("/data/tables/search-query-set-tables", tableController, "Post:SearchQuerySetTables")
	web.Router("/data/tables/dependency-graph", tableController, "Post:DependencyGraph")

	//web.Router("/data/tables/split-data-table", tableController, "Post:SplitDataTable")
	//web.Router("/data/tables/batch-edit-sub-table", tableController, "Post:BatchEditSubTable")
	web.Router("/data/tables/copy-data-table", tableController, "Post:CopyDataTable")
	web.Router("/data/tables/update-table-struct/:tableId", tableController, "Put:UpdateTableStruct")
	web.Router("/data/tables/add-sub-table", tableController, "Post:AddTableStruct")
	web.Router("/data/tables/export-table", tableController, "Post:ExportDataTable")

	web.Router("/data/tables/table-preview", tableController, "Post:TablePreview")
	web.Router("/data/tables/row-edit", tableController, "Post:RowEdit")
	web.Router("/data/tables/row-delete", tableController, "Post:RowsDelete")

	web.Router("/data/field-optional-values", tableController, "Post:FieldOptionalValues")
	web.Router("/data/table-object-search", tableController, "Post:TableObjectSearch")

	web.Router("/business/db-table-preview", tableController, "Post:DBTablePreview")
	web.Router("/data/table-preview", tableController, "Post:Preview")

	web.Router("/data/reset-header-row", tableController, "Post:TableResetHeaderRow")

	web.Router("/data/tables/exec/:name", tableController, "Get:ExecScript")

	// 外部接口
	web.Router("/api/tables/field-optional-values", tableController, "Post:FieldOptionalValues")
	web.Router("/api/tables/table-object-search", tableController, "Post:ApiTableObjectSearch")
	web.Router("/api/tables/table-preview", tableController, "Post:Preview")
	web.Router("/api/tables/:tableId", tableController, "Get:GetTable")
}