Files
nl_cms-api/internal/model/attachment.go
2025-07-29 12:45:07 +08:00

40 lines
1.6 KiB
Go

package model
import (
"github.com/gogf/gf/v2/os/gtime"
)
// Attachment 附件模型
type Attachment struct {
Id int `json:"id" dc:"主键"`
OriginalName string `json:"original_name" dc:"原始文件名"`
FileName string `json:"file_name" dc:"存储文件名"`
FilePath string `json:"file_path" dc:"文件路径"`
FileUrl string `json:"file_url" dc:"文件URL"`
FileSize int64 `json:"file_size" dc:"文件大小(字节)"`
FileType string `json:"file_type" dc:"文件类型"`
MimeType string `json:"mime_type" dc:"MIME类型"`
FileExt string `json:"file_ext" dc:"文件扩展名"`
StorageType string `json:"storage_type" dc:"存储类型 local:本地 oss:阿里云OSS"`
UploadIp string `json:"upload_ip" dc:"上传IP"`
UploadedBy int `json:"uploaded_by" dc:"上传者ID"`
UsageCount int `json:"usage_count" dc:"使用次数"`
CreatedAt *gtime.Time `json:"created_at" dc:"创建时间"`
UpdatedAt *gtime.Time `json:"updated_at" dc:"更新时间"`
DeletedAt int `json:"deleted_at" dc:"删除时间"`
}
// UploadRequest 上传请求
type UploadRequest struct {
FileType string `json:"file_type" dc:"文件类型"`
Category string `json:"category" dc:"分类"`
}
// UploadResponse 上传响应
type UploadResponse struct {
Id int `json:"id" dc:"附件ID"`
FileName string `json:"file_name" dc:"文件名"`
FileUrl string `json:"file_url" dc:"文件URL"`
FileSize int64 `json:"file_size" dc:"文件大小"`
FileType string `json:"file_type" dc:"文件类型"`
}