web

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExportFilterCondition

type ExportFilterCondition struct {
	FieldUID string      `json:"field_uid"`
	Operator string      `json:"operator"`
	Value    interface{} `json:"value"`
}

ExportFilterCondition 导出筛选条件

type ExportFilterGroup

type ExportFilterGroup struct {
	Filters []ExportFilterCondition `json:"filters"`
}

ExportFilterGroup 导出筛选条件组 (组内 AND)

type ExportReq

type ExportReq struct {
	ModelUID     string              `json:"model_uid" binding:"required"`
	Scope        ExportScope         `json:"scope" binding:"required"`
	ResourceIDs  []int64             `json:"resource_ids"`  // string or number
	FilterGroups []ExportFilterGroup `json:"filter_groups"` // scope='all' 或 'current' 时可选
	Fields       []string            `json:"fields"`        // 导出字段列表 (可选)
	FileName     string              `json:"file_name"`     // 文件名 (可选)
}

ExportReq 导出数据请求

type ExportScope

type ExportScope string

ExportScope 导出范围枚举

const (
	ExportScopeAll      ExportScope = "all"
	ExportScopeCurrent  ExportScope = "current"
	ExportScopeSelected ExportScope = "selected"
)

func (ExportScope) String

func (s ExportScope) String() string

type ExportTemplateReq

type ExportTemplateReq struct {
	ModelUID string `json:"model_uid" binding:"required"`
}

ExportTemplateReq 导出模板请求

type GenerateUploadURLReq

type GenerateUploadURLReq struct {
	FileName string `json:"file_name" binding:"required"`
}

GenerateUploadURLReq 生成上传 URL 请求

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(svc service.IDataIOService, storage *storage.S3Storage) *Handler

func (*Handler) Export

func (h *Handler) Export(ctx *gin.Context, req ExportReq) (ginx.Result, error)

Export 导出数据

func (*Handler) ExportTemplate

func (h *Handler) ExportTemplate(ctx *gin.Context) (ginx.Result, error)

ExportTemplate 导出空白导入模板

func (*Handler) Import

func (h *Handler) Import(ctx *gin.Context, req ImportReq) (ginx.Result, error)

Import 导入数据 NOTE: 前端先通过 GenerateUploadURL 上传文件到 S3,然后调用此接口传入 file_key 进行导入

func (*Handler) PrivateRoutes

func (h *Handler) PrivateRoutes(server *gin.Engine)

type ImportReq

type ImportReq struct {
	ModelUID string `json:"model_uid" binding:"required"` // 模型 UID
	FileKey  string `json:"file_key" binding:"required"`  // S3 文件 key
}

ImportReq 导入数据请求

type ImportV2Req

type ImportV2Req struct {
	ModelUID string `form:"model_uid" binding:"required"` // 模型 UID
}

ImportV2Req 导入数据请求 V2 (直接上传文件)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL