DeployHelper/internal/model/sys_deploy_file.go

33 lines
1.6 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package model
import (
"time"
)
// SysDeployFile 部署文件记录表
type SysDeployFile struct {
FileId string `gorm:"column:file_id;type:varchar(64);primary_key;comment:文件ID" json:"fileId"`
ParentId string `gorm:"column:parent_id;type:varchar(64);not null;comment:项目ID" json:"parentId" binding:"required"`
FileName string `gorm:"column:file_name;type:varchar(255);not null;comment:原始文件名" json:"fileName" binding:"required"`
FileSize int64 `gorm:"column:file_size;type:bigint;comment:文件大小(字节)" json:"fileSize"`
FileHash string `gorm:"column:file_hash;type:varchar(64);comment:文件哈希值" json:"fileHash"`
FilePath string `gorm:"column:file_path;type:varchar(255);comment:文件路径" json:"filePath"`
Status string `gorm:"column:status;type:char(1);default:0;comment:文件状态0未使用 1使用中" json:"status"`
DelFlag string `gorm:"column:del_flag;type:char(1);default:0;comment:删除标志0代表存在 1代表删除" json:"delFlag"`
CreateBy string `gorm:"column:create_by;type:varchar(64);comment:创建者" json:"createBy"`
CreateTime *time.Time `gorm:"column:create_time;type:datetime;comment:创建时间" json:"createTime"`
UpdateBy string `gorm:"column:update_by;type:varchar(64);comment:更新者" json:"updateBy"`
UpdateTime *time.Time `gorm:"column:update_time;type:datetime;comment:更新时间" json:"updateTime"`
}
// TableName 表名
func (m *SysDeployFile) TableName() string {
return "sys_deploy_file"
}
// FileStatus 文件状态常量
const (
FileStatusNotUsed = "0" // 未使用
FileStatusInUse = "1" // 使用中
)