Files
iotlcm/admin-svr/server/internal/model/download_center.go
T

70 lines
2.9 KiB
Go

package model
import (
"github.com/gogf/gf/v2/os/gtime"
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/model/request"
)
// ExportIdentitySnapshot 提交导出时的用户身份与角色范围快照。
// 异步执行时用它还原 ctx,保证 FilterAuth 仍按提交人的数据范围过滤。
type ExportIdentitySnapshot struct {
UserId int64 `json:"userId"`
DeptId int64 `json:"deptId"`
TenantId string `json:"tenantId"`
Roles []Role `json:"roles"`
AccessCodeList []string `json:"accessCodeList"`
CurrentRoleId string `json:"currentRoleId"`
CurrentRoleDataScope string `json:"currentRoleDataScope"`
}
// DownloadCenterListParam 下载中心列表查询
type DownloadCenterListParam struct {
request.PageInfo
BizKey string `json:"bizKey" dc:"业务标识"`
Status string `json:"status" dc:"状态,多个用逗号分隔 0排队 2生成中 1已完成 3失败"`
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间区间"`
}
// DownloadCenterListModel 下载中心列表项
type DownloadCenterListModel struct {
Id int64 `json:"id" dc:"主键ID"`
TaskNo string `json:"taskNo" dc:"任务编号"`
BizKey string `json:"bizKey" dc:"业务标识"`
BizName string `json:"bizName" dc:"业务名称"`
Status int `json:"status" dc:"状态"`
TotalCount int `json:"totalCount" dc:"导出总行数"`
FileName string `json:"fileName" dc:"文件名"`
FileSize int64 `json:"fileSize" dc:"文件大小"`
ErrorMessage string `json:"errorMessage" dc:"失败原因"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
FinishTime *gtime.Time `json:"finishTime" dc:"完成时间"`
ExpireTime *gtime.Time `json:"expireTime" dc:"过期时间"`
DeletedTime *gtime.Time `json:"deletedTime" dc:"文件清理时间"`
DeleteReason string `json:"deleteReason" dc:"清理原因 user/expired"`
}
// DownloadCenterTaskParam 按任务ID操作
type DownloadCenterTaskParam struct {
TaskId int64 `json:"taskId" v:"required|min:1#任务ID不能为空|任务ID不正确" dc:"任务ID"`
}
// DownloadCenterDownloadModel 下载结果
type DownloadCenterDownloadModel struct {
FileName string `json:"fileName" dc:"文件名"`
OssId int64 `json:"ossId" dc:"OSS文件ID"`
TaskNo string `json:"taskNo" dc:"任务编号"`
}
// DownloadCenterRecentParam 右上角全局入口:最近任务
type DownloadCenterRecentParam struct {
Limit int `json:"limit" d:"5" dc:"返回条数"`
}
// DownloadCenterRecentModel 全局入口返回
type DownloadCenterRecentModel struct {
Items []*DownloadCenterListModel `json:"items" dc:"最近任务"`
RunningCount int `json:"runningCount" dc:"进行中数量"`
FinishedCount int `json:"finishedCount" dc:"已完成数量"`
}