|
|
@@ -7,32 +7,32 @@ import (
|
|
|
)
|
|
|
|
|
|
type PublishLibraries struct {
|
|
|
- ID int64 `gorm:"column:id;type:int(10) unsigned;primary_key;AUTO_INCREMENT;comment:编号" json:"id" :"ID"` // 编号
|
|
|
- Name string `gorm:"column:name;type:varchar(64);comment:名称" json:"name" :"Name"` // 名称
|
|
|
- Resolution int `gorm:"column:resolution;type:int(11);comment:分辨率" json:"resolution" :"Resolution"` // 分辨率
|
|
|
- Duration int64 `gorm:"column:duration;type:bigint(20);default:0;comment:统计文件时长" json:"duration" :"Duration"` // 统计文件时长
|
|
|
- FileSize int64 `gorm:"column:file_size;type:bigint(20);default:0;comment:统计文件大小" json:"fileSize" :"FileSize"` // 统计文件大小
|
|
|
- InfoId string `gorm:"column:info_id;type:varchar(4000);comment:信息屏ID 组合" json:"infoId" :"InfoId"` // 信息屏ID 组合
|
|
|
- ImgDuration int `gorm:"column:img_duration;type:int(11);default:0;comment:图片播放时长(毫秒)" json:"imgDuration" :"ImgDuration"` // 图片播放时长(毫秒)
|
|
|
- StartTime common.Time `gorm:"column:start_time;type:date;comment:播放开始时间" json:"startTime" :"StartTime"` // 播放开始时间
|
|
|
- EndTime common.Time `gorm:"column:end_time;type:date;comment:播放结束时间" json:"endTime" :"EndTime"` // 播放结束时间
|
|
|
- NotificationType string `gorm:"column:notification_type;type:varchar(60);comment:通知类型 组合1短信2邮件3电话4微信" json:"notificationType" :"NotificationType"` // 通知类型 组合1短信2邮件3电话4微信
|
|
|
- CreateTime time.Time `gorm:"column:create_time;type:datetime;comment:新增时间" json:"createTime" :"CreateTime"` // 新增时间
|
|
|
- CreateUser int64 `gorm:"column:create_user;type:varchar(60);comment:增记录操作用户ID" json:"createUser" :"CreateUser"` // 新增记录操作用户ID
|
|
|
- CreateName string `gorm:"column:create_name;type:varchar(64);comment:新增用户姓名" json:"createName" :"CreateName"` // 新增用户姓名
|
|
|
- UpdateTime time.Time `gorm:"column:update_time;type:datetime;comment:修改时间" json:"updateTime" :"UpdateTime"` // 修改时间
|
|
|
- UpdateUser string `gorm:"column:update_user;type:varchar(60);comment:修改用户" json:"updateUser" :"UpdateUser"` // 修改用户
|
|
|
- IsDeleted int `gorm:"column:is_deleted;type:int(11);default:0;comment:是否删除 0=未删除,1=删除" json:"isDeleted" :"IsDeleted"` // 是否删除 0=未删除,1=删除
|
|
|
- Status int `gorm:"column:status;type:int(11);comment:状态 0审核1播放2暂停3取消4过期5审核不通过" json:"status" :"Status"` // 状态 0审核1播放2暂停3取消4过期5审核不通过
|
|
|
- TenantId int `gorm:"column:tenant_id;type:int(11);comment:租户ID" json:"tenantTd" :"TenantId"` // 租户ID
|
|
|
- Remarks string `gorm:"column:remarks;type:varchar(4000);comment:系统类型:0-多媒体系统,1-广播系统" json:"remarks" :"Remarks"` // 备注
|
|
|
- SysType int `gorm:"column:sys_type;type:int(11);default:0;comment:编号" json:"sysStype" :"SysType"` // 系统类型:0-多媒体系统,1-广播系统
|
|
|
- KsTime string `gorm:"column:ks_time;type:varchar(50);comment:播放开始时间" json:"ksTime" :"KsTime"` // 播放开始时间
|
|
|
- JsTime string `gorm:"column:js_time;type:varchar(50);comment:播放结束时间" json:"jsTime" :"JsTime"` // 播放结束时间
|
|
|
- FileId int `gorm:"column:file_id;type:int(11);comment:文件ID,系统类型为广播系统时使用" json:"fileId" :"FileId"` // 文件ID,系统类型为广播系统时使用
|
|
|
- TaskId int `gorm:"column:task_id;type:int(11);comment:任务ID,发布后才有用于控制启动与停止" json:"taskId" :"TaskId"` // 任务ID,发布后才有用于控制启动与停止
|
|
|
- PlayTime int `gorm:"column:play_time;type:int(11);default:1;comment:播放次数(1-100)" json:"playTime" :"PlayTime"` // 播放次数(1-100)
|
|
|
- PlayInterval int `gorm:"column:play_interval;type:int(11);default:0;comment: 播放间隔(0-360秒)" json:"playInterval" :"PlayInterval"` // 播放间隔(0-360秒)
|
|
|
+ ID int64 `gorm:"column:id;type:int(10) unsigned;primary_key;AUTO_INCREMENT;comment:编号" json:"id"`
|
|
|
+ Name string `gorm:"column:name;type:varchar(64);comment:名称" json:"name"` // 名称
|
|
|
+ Resolution int `gorm:"column:resolution;type:int(11);comment:分辨率" json:"resolution"` // 分辨率
|
|
|
+ Duration int64 `gorm:"column:duration;type:bigint(20);default:0;comment:统计文件时长" json:"duration"` // 统计文件时长
|
|
|
+ FileSize int64 `gorm:"column:file_size;type:bigint(20);default:0;comment:统计文件大小" json:"fileSize"` // 统计文件大小
|
|
|
+ InfoId string `gorm:"column:info_id;type:varchar(4000);comment:信息屏ID 组合" json:"infoId"` // 信息屏ID 组合
|
|
|
+ ImgDuration int `gorm:"column:img_duration;type:int(11);default:0;comment:图片播放时长(毫秒)" json:"imgDuration"` // 图片播放时长(毫秒)
|
|
|
+ StartTime common.Time `gorm:"column:start_time;type:date;comment:播放开始时间" json:"startTime"` // 播放开始时间
|
|
|
+ EndTime common.Time `gorm:"column:end_time;type:date;comment:播放结束时间" json:"endTime"` // 播放结束时间
|
|
|
+ NotificationType string `gorm:"column:notification_type;type:varchar(60);comment:通知类型 组合1短信2邮件3电话4微信" json:"notificationType"` // 通知类型 组合1短信2邮件3电话4微信
|
|
|
+ CreateTime time.Time `gorm:"column:create_time;type:datetime;comment:新增时间" json:"createTime"` // 新增时间
|
|
|
+ CreateUser int64 `gorm:"column:create_user;type:varchar(60);comment:增记录操作用户ID" json:"createUser"` // 新增记录操作用户ID
|
|
|
+ CreateName string `gorm:"column:create_name;type:varchar(64);comment:新增用户姓名" json:"createName"` // 新增用户姓名
|
|
|
+ UpdateTime time.Time `gorm:"column:update_time;type:datetime;comment:修改时间" json:"updateTime"` // 修改时间
|
|
|
+ UpdateUser string `gorm:"column:update_user;type:varchar(60);comment:修改用户" json:"updateUser"` // 修改用户
|
|
|
+ IsDeleted int `gorm:"column:is_deleted;type:int(11);default:0;comment:是否删除 0=未删除,1=删除" json:"isDeleted"` // 是否删除 0=未删除,1=删除
|
|
|
+ Status int `gorm:"column:status;type:int(11);comment:状态 0审核1播放2暂停3取消4过期5审核不通过" json:"status"` // 状态 0审核1播放2暂停3取消4过期5审核不通过
|
|
|
+ TenantId int `gorm:"column:tenant_id;type:int(11);comment:租户ID" json:"tenantTd"` // 租户ID
|
|
|
+ Remarks string `gorm:"column:remarks;type:varchar(4000);comment:系统类型:0-多媒体系统,1-广播系统" json:"remarks"` // 备注
|
|
|
+ SysType int `gorm:"column:sys_type;type:int(11);default:0;comment:编号" json:"sysStype"` // 系统类型:0-多媒体系统,1-广播系统
|
|
|
+ KsTime string `gorm:"column:ks_time;type:varchar(50);comment:播放开始时间" json:"ksTime"` // 播放开始时间
|
|
|
+ JsTime string `gorm:"column:js_time;type:varchar(50);comment:播放结束时间" json:"jsTime"` // 播放结束时间
|
|
|
+ FileId int `gorm:"column:file_id;type:int(11);comment:文件ID,系统类型为广播系统时使用" json:"fileId"` // 文件ID,系统类型为广播系统时使用
|
|
|
+ TaskId int `gorm:"column:task_id;type:int(11);comment:任务ID,发布后才有用于控制启动与停止" json:"taskId"` // 任务ID,发布后才有用于控制启动与停止
|
|
|
+ PlayTime int `gorm:"column:play_time;type:int(11);default:1;comment:播放次数(1-100)" json:"playTime"` // 播放次数(1-100)
|
|
|
+ PlayInterval int `gorm:"column:play_interval;type:int(11);default:0;comment: 播放间隔(0-360秒)" json:"playInterval"` // 播放间隔(0-360秒)
|
|
|
|
|
|
PlayPeriod string `gorm:"-" json:"playPeriod"` //播放期间
|
|
|
ResolutionName string `gorm:"-" json:"resolutionName"` //分辨率
|
|
|
@@ -48,7 +48,7 @@ func (c *PublishLibraries) GetList(offset int, limit int) ([]PublishLibraries, i
|
|
|
var count int64
|
|
|
db := Db.Debug().Model(&c).Where("tenant_id = ? and sys_type=? and is_deleted = 0", c.TenantId, c.SysType)
|
|
|
db.Count(&count)
|
|
|
- err := db.Offset(offset).Limit(limit).Find(&list).Error
|
|
|
+ err := db.Offset(offset).Limit(limit).Order("id desc").Find(&list).Error
|
|
|
return list, count, err
|
|
|
}
|
|
|
|
|
|
@@ -66,3 +66,15 @@ func (c *PublishLibraries) GetProgram() (int, error) {
|
|
|
err := Db.Debug().Model(&c).Where("id = ?", c.ID).First(&librarie).Error
|
|
|
return librarie.FileId, err
|
|
|
}
|
|
|
+
|
|
|
+// GetProgramByLedId 取led信息屏当前播放的节目 ID
|
|
|
+func (c *PublishLibraries) GetProgramByLedId(ledId int) (PublishLibraries, error) {
|
|
|
+ var librarie PublishLibraries
|
|
|
+ err := Db.Debug().Model(&c).Where("info_id IN (?) and is_deleted = 0 and status = 1 and sys_type = 0 and start_time <= CURDATE()", ledId).Order("id desc").First(&librarie).Error
|
|
|
+ return librarie, err
|
|
|
+}
|
|
|
+
|
|
|
+func (c PublishLibraries) Delete() error {
|
|
|
+ return Db.Debug().Model(&c).Where("id = ?", c.ID).Updates(map[string]interface{}{"update_time": c.UpdateTime,
|
|
|
+ "update_user": c.UpdateUser, "is_deleted": c.IsDeleted}).Error
|
|
|
+}
|