Files
iotlcm/server/internal/model/sys_oss.go
T
MiFaZhan 2ed5dfa6a1 chore: 初始开源发布
iotlcm-app:小程序端 + 用户端服务。

- app/:uni-app 小程序前端(基于 unibest,MIT)
  - 微信 AppID → YOUR_WX_APPID,uni-app AppID → __UNI__YOURAPPID
  - 内网后端地址 → admin.iotlcm.example.com
  - 应用标题与 unibest 模板 README 重写(保留上游致谢与 MIT 声明)
- server/:GoFrame 用户端服务(基于 XiuAdmin,Apache-2.0)
  - module xiuadmin → git.5iot.com/iotlcm-public/iotlcm-app(360 文件)
  - 支付回调地址 → app.iotlcm.example.com,商户名与应用名泛化
  - 真实手机号 → 合法 11 位编造号(保留号段前 3 位 + 后 4 位)
  - 依赖号码尾部的断言同步更新
  - 补 server/LICENSE(Apache-2.0)
- 移除内部资产:CI 触发器
- 补根 README,LF 行尾 + .gitattributes

已知:TestSysDept_RefreshDeptAncestors 在源仓同一提交上同样失败,属既有缺陷。
2026-10-26 14:01:25 +08:00

113 lines
5.2 KiB
Go

// package model
// @Link https://github.com/xiujiecn/xiu-admin
// @Copyright Copyright (c) 2025 LiXiujie
// @Author Lxj <li@xiujie.cn>
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
package model
import (
"git.5iot.com/iotlcm-public/iotlcm-app/internal/model/entity"
"git.5iot.com/iotlcm-public/iotlcm-app/internal/model/request"
"github.com/gogf/gf/v2/net/ghttp"
"github.com/gogf/gf/v2/os/gtime"
)
type SysOssListModel struct {
OssId int64 `json:"ossId" orm:"oss_id" description:"对象存储主键"`
TenantId string `json:"tenantId" orm:"tenant_id" description:"租户编号"`
FileName string `json:"fileName" orm:"file_name" description:"文件名"`
OriginalName string `json:"originalName" orm:"original_name" description:"原名"`
FileSuffix string `json:"fileSuffix" orm:"file_suffix" description:"文件后缀名"`
Url string `json:"url" orm:"url" description:"URL地址"`
CreatedDept int64 `json:"createdDept" orm:"created_dept" description:"创建部门"`
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"`
CreatedBy int64 `json:"createdBy" orm:"created_by" description:"创建者"`
Service string `json:"service" orm:"service" description:"服务商"`
}
type SysOssListParam struct {
request.PageInfo
FileName string `json:"fileName" orm:"file_name" description:"文件名"`
OriginalName string `json:"originalName" orm:"original_name" description:"原名"`
FileSuffix string `json:"fileSuffix" orm:"file_suffix" description:"文件后缀名"`
Service string `json:"service" orm:"service" description:"服务商"`
CreatedAt []string `json:"createdAt" orm:"created_at" description:"创建时间"`
}
type SysOssViewParam struct {
OssId int64 `json:"ossId" orm:"oss_id" description:"对象存储主键"`
}
type SysOssViewModel struct {
entity.SysOss
}
type SysOssDownloadParam struct {
OssId int64 `json:"ossId" orm:"oss_id" description:"对象存储主键"`
}
type SysOssDownloadModel struct {
*entity.SysOss
}
type SysOssDeleteParam struct {
OssIds []int64 `json:"ossIds" description:"对象存储主键"`
}
type SysOssDeleteModel struct {
entity.SysOss
}
type SysOssUploadParam struct {
File *ghttp.UploadFile `json:"file" description:"文件"`
FileType string `json:"fileType" description:"文件类型"`
IsDevice bool `json:"isDevice" description:"是否是设备文件"`
NewFileType int `json:"newFileType" description:"新文件类型 1:用户文件 2:用户图片 3:设备文件 4:iot配置图片 5:iot固件文件 6:项目图片 7:项目文件"`
SubDirName string `json:"subDirName" description:"子目录名称或路径"`
SaveOriginalName int `json:"saveOriginalName" description:"是否保存原始文件名 0:否 1:是 默认否"`
NotAddDate int `json:"notAddDate" description:"存储路径不添加日期 0:添加 1:不添加 默认添加"`
}
type SysOssUploadModel struct {
entity.SysOss
}
type SysOssMoveFileParam struct {
FilePath string `json:"filePath" description:"文件路径"`
NewFileType int `json:"newFileType" description:"新文件类型 1:用户文件 2:用户图片 3:设备文件 4:iot配置图片 5:iot固件文件 6:项目图片 7:项目文件"`
SubDirName string `json:"subDirName" description:"子目录名称或路径"`
SaveOriginalName int `json:"saveOriginalName" description:"是否保存原始文件名 0:否 1:是 默认否"`
NotAddDate int `json:"notAddDate" description:"存储路径不添加日期 0:添加 1:不添加 默认添加"`
}
type SysOssMoveFileModel struct {
*entity.SysOss
}
type SysOssSaveContentParam struct {
Content []byte `json:"content" description:"内容"`
FileName string `json:"fileName" description:"文件名"`
NewFileType int `json:"newFileType" description:"新文件类型 1:用户文件 2:用户图片 3:设备文件 4:iot配置图片 5:iot固件文件 6:项目图片 7:项目文件"`
SubDirName string `json:"subDirName" description:"子目录名称或路径"`
SaveOriginalName int `json:"saveOriginalName" description:"是否保存原始文件名 0:否 1:是 默认否"`
NotAddDate int `json:"notAddDate" description:"存储路径不添加日期 0:添加 1:不添加 默认添加"`
}
type SysOssSaveContentModel struct {
*entity.SysOss
}
type UploadResponse struct {
Size int64 `json:"size"` // 文件大小
Path string `json:"path"` // 文件路径
FullPath string `json:"full_path"` // 文件全路径
Name string `json:"name"` // 文件名
OriginalName string `json:"original_name"` // 文件原名
Type string `json:"type"` // 文件类型 http Content-type
Ext string `json:"ext"` // 文件扩展名 不包含.
Md5 string `json:"md5"` // 文件MD5
Crc16 uint16 `json:"crc16"` // 文件CRC-16/MODBUS
Sum16 uint16 `json:"sum16"` // 文件SUM16
}