dto

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicResult

type BasicResult struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

BasicResult 基础返回结果

type CreateTaskResult

type CreateTaskResult struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	TaskID  string `json:"taskId"`
}

CreateTaskResult 创建任务结果

type ExportResult

type ExportResult struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Path    string `json:"path"`
}

ExportResult 导出结果

type FileInfo

type FileInfo struct {
	Path    string `json:"path"`
	Name    string `json:"name"`
	Format  string `json:"format"`
	Size    int64  `json:"size"`
	ModTime string `json:"modTime"`
}

FileInfo 文件信息

type FileJob

type FileJob struct {
	JobID        string        `json:"jobId"`
	TaskID       string        `json:"taskId"`
	SourcePath   string        `json:"sourcePath"`
	TargetPath   string        `json:"targetPath"`
	Format       string        `json:"format"`
	Attempt      int           `json:"attempt"`
	MaxAttempts  int           `json:"maxAttempts"`
	Status       FileJobStatus `json:"status"`
	ErrorCode    string        `json:"errorCode"`
	ErrorMessage string        `json:"errorMessage"`
	BytesBefore  int64         `json:"bytesBefore"`
	BytesAfter   int64         `json:"bytesAfter"`
	DurationMs   int64         `json:"durationMs"`
}

FileJob 单文件任务

type FileJobPage

type FileJobPage struct {
	Code     int        `json:"code"`
	Message  string     `json:"message"`
	Total    int        `json:"total"`
	Page     int        `json:"page"`
	PageSize int        `json:"pageSize"`
	Items    []*FileJob `json:"items"`
}

FileJobPage 文件任务分页结果

type FileJobStatus

type FileJobStatus string

FileJobStatus 单文件状态

const (
	FileJobStatusPending       FileJobStatus = "PENDING"
	FileJobStatusRunning       FileJobStatus = "RUNNING"
	FileJobStatusSuccess       FileJobStatus = "SUCCESS"
	FileJobStatusFailed        FileJobStatus = "FAILED"
	FileJobStatusSkippedNoGain FileJobStatus = "SKIPPED_NO_GAIN"
)

type FilterInfo

type FilterInfo struct {
	Path   string `json:"path"`
	Reason string `json:"reason"`
}

FilterInfo 过滤文件信息

type OutputMode

type OutputMode string

OutputMode 输出模式

const (
	OutputModeAuto   OutputMode = "AUTO"
	OutputModeManual OutputMode = "MANUAL"
)

type Preset

type Preset string

Preset 压缩预设

const (
	PresetHighQuality     Preset = "HIGH_QUALITY"
	PresetBalanced        Preset = "BALANCED"
	PresetHighCompression Preset = "HIGH_COMPRESSION"
)

type PreviewPairResult

type PreviewPairResult struct {
	Code         int    `json:"code"`
	Message      string `json:"message"`
	JobID        string `json:"jobId"`
	SourcePath   string `json:"sourcePath"`
	TargetPath   string `json:"targetPath"`
	SourceSize   int64  `json:"sourceSize"`
	TargetSize   int64  `json:"targetSize"`
	SourceBase64 string `json:"sourceBase64"`
	TargetBase64 string `json:"targetBase64"`
}

PreviewPairResult 预览对结果

type ProgressSnapshot

type ProgressSnapshot struct {
	TaskID                     string  `json:"taskId"`
	State                      string  `json:"state"`
	TotalFiles                 int     `json:"totalFiles"`
	DoneFiles                  int     `json:"doneFiles"`
	SuccessFiles               int     `json:"successFiles"`
	FailedFiles                int     `json:"failedFiles"`
	CurrentFile                string  `json:"currentFile"`
	CurrentFileProgressPercent float64 `json:"currentFileProgressPercent"`
	ElapsedSeconds             int     `json:"elapsedSeconds"`
	RemainingSeconds           int     `json:"remainingSeconds"`
	ETASeconds                 int     `json:"etaSeconds"`
	ThroughputFilesPerSec      float64 `json:"throughputFilesPerSec"`
}

ProgressSnapshot 进度快照

type ResultSummary

type ResultSummary struct {
	TotalFiles   int     `json:"totalFiles"`
	SuccessFiles int     `json:"successFiles"`
	FailedFiles  int     `json:"failedFiles"`
	BytesBefore  int64   `json:"bytesBefore"`
	BytesAfter   int64   `json:"bytesAfter"`
	BytesSaved   int64   `json:"bytesSaved"`
	SavedPercent float64 `json:"savedPercent"`
}

ResultSummary 结果统计

type ScanResult

type ScanResult struct {
	Code           int          `json:"code"`
	Message        string       `json:"message"`
	TotalFiles     int          `json:"totalFiles"`
	TotalBytes     int64        `json:"totalBytes"`
	SupportedFiles []FileInfo   `json:"supportedFiles"`
	FilteredFiles  []FilterInfo `json:"filteredFiles"`
}

ScanResult 扫描结果

type SelectDirResult

type SelectDirResult struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Path    string `json:"path"`
}

SelectDirResult 选择目录结果

type SelectPathsResult

type SelectPathsResult struct {
	Code    int      `json:"code"`
	Message string   `json:"message"`
	Paths   []string `json:"paths"`
}

SelectPathsResult 选择路径结果

type Task

type Task struct {
	TaskID     string     `json:"taskId"`
	State      TaskState  `json:"state"`
	Config     TaskConfig `json:"config"`
	CreatedAt  string     `json:"createdAt"`
	StartedAt  string     `json:"startedAt"`
	FinishedAt string     `json:"finishedAt"`
}

Task 任务实体

type TaskConfig

type TaskConfig struct {
	InputPaths          []string `json:"inputPaths"`
	OutputMode          string   `json:"outputMode"`
	OutputDir           string   `json:"outputDir"`
	KeepStruct          bool     `json:"keepStructure"`
	NameConflictPolicy  string   `json:"nameConflictPolicy"`
	Preset              string   `json:"preset"`
	QualityMin          int      `json:"qualityMin"`
	MaxWidth            int      `json:"maxWidth"`
	MaxHeight           int      `json:"maxHeight"`
	RetryTimes          int      `json:"retryTimes"`
	RetryBackoffSeconds []int    `json:"retryBackoffSeconds"`
}

TaskConfig 任务配置

type TaskState

type TaskState string

TaskState 任务状态定义

const (
	TaskStatePending   TaskState = "PENDING"
	TaskStateRunning   TaskState = "RUNNING"
	TaskStatePaused    TaskState = "PAUSED"
	TaskStateCompleted TaskState = "COMPLETED"
	TaskStateFailed    TaskState = "FAILED"
	TaskStateCancelled TaskState = "CANCELLED"
)

type TaskStatusResult

type TaskStatusResult struct {
	Total  int    `json:"total"`
	Done   int    `json:"done"`
	Failed int    `json:"failed"`
	Status string `json:"status"`
}

TaskStatusResult 任务状态结果

Jump to

Keyboard shortcuts

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