Commit eed1072e authored by yanzg's avatar yanzg

下载视频

parent 7a9d9290
package com.yanzuoguang.cloud.file.dao;
import com.yanzuoguang.cloud.vo.YzgFileVo;
import com.yanzuoguang.cloud.vo.req.YzgFileStatusReqVo;
import com.yanzuoguang.dao.BaseDao;
/**
* 日志接口基本操作类
*
* @author 颜佐光
*/
public interface YzgFileDao extends BaseDao {
/**
* 获取导出文件数量
*
* @param req 批次编号
* @return 文件数量
*/
int getUserCompanyCount(YzgFileVo req);
/**
* 获取导出文件数量
*
* @param req 批次编号
* @return 文件数量
*/
int getCallbackCount(YzgFileVo req);
/**
* 修改文件状态
*
* @param req 批次编号
* @return 文件数量
*/
int updateStatus(YzgFileStatusReqVo req);
}
package com.yanzuoguang.cloud.file.dao.impl;
import com.yanzuoguang.cloud.file.dao.YzgFileDao;
import com.yanzuoguang.cloud.vo.YzgFileVo;
import com.yanzuoguang.cloud.vo.req.YzgFileStatusReqVo;
import com.yanzuoguang.dao.DaoConst;
import com.yanzuoguang.dao.impl.BaseDaoImpl;
import com.yanzuoguang.mq.vo.MessageVo;
import com.yanzuoguang.util.vo.MapRow;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* 消息队列处理工具类
*
* @author 颜佐光
*/
@Component
public class YzgFileDaoImpl extends BaseDaoImpl implements YzgFileDao, InitializingBean {
private static final String QUERY_TABLE_SQL = "SHOW TABLES LIKE 'queue_message'";
private static final String CREATE_TABLE_SQL = "CREATE TABLE `queue_message` ( " +
" `MessageId` varchar(32) NOT NULL COMMENT '消息编号', " +
" `ExchangeName` varchar(255) NOT NULL DEFAULT '' COMMENT '交换器', " +
" `RouteKey` varchar(255) NOT NULL DEFAULT '' COMMENT '路由键', " +
" `Message` text NOT NULL COMMENT '消息内容', " +
" `DedTime` bigint(20) NOT NULL DEFAULT '0' COMMENT '死信时间', " +
" `HandleCount` int(11) NOT NULL DEFAULT '0' COMMENT '处理次数', " +
" `HandleTime` datetime NOT NULL COMMENT '上次处理时间', " +
" `BatchId` varchar(32) NOT NULL COMMENT '发送批次', " +
" `CreateTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', " +
" PRIMARY KEY (`MessageId`), " +
" KEY `IndexHandleTime` (`HandleTime`) " +
") ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='队列消息表'";
@Override
protected void init() {
register(MessageVo.class);
table.add(DaoConst.QUERY, "SELECT a.* FROM Queue_Message AS a WHERE 1=1 ")
.add("batchId", "AND a.batchId=?")
;
}
/**
* Invoked by a BeanFactory after it has set all bean properties supplied
* (and satisfied BeanFactoryAware and ApplicationContextAware).
* <p>This method allows the bean instance to perform initialization only
* possible when all bean properties have been set and to throw an
* exception in the event of misconfiguration.
*
* @throws Exception in the event of misconfiguration (such
* as failure to set an essential property) or if initialization fails.
*/
@Override
public void afterPropertiesSet() throws Exception {
List<MapRow> tables = this.getDb().query(YzgFileDaoImpl.class, "QUERY_TABLE_SQL", QUERY_TABLE_SQL);
if (tables.isEmpty()) {
this.getDb().update(YzgFileDaoImpl.class, "CREATE_TABLE_SQL", CREATE_TABLE_SQL);
} else {
// this.getDb().update(YzgFileDaoImpl.class, "ALTER_TABLE_SQL", ALTER_TABLE_SQL);
}
}
/**
* 获取导出文件数量
*
* @param req 批次编号
* @return 文件数量
*/
@Override
public int getUserCompanyCount(YzgFileVo req) {
return 0;
}
/**
* 获取导出文件数量
*
* @param req 批次编号
* @return 文件数量
*/
@Override
public int getCallbackCount(YzgFileVo req) {
return 0;
}
/**
* 修改文件状态
*
* @param req 批次编号
* @return 文件数量
*/
@Override
public int updateStatus(YzgFileStatusReqVo req) {
return 0;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment