Commit a70962da authored by yanzg's avatar yanzg

接口文档的支持

parent 8e341634
......@@ -2,6 +2,7 @@ package com.yanzuoguang.dao.impl;
import com.yanzuoguang.dao.BaseDao;
import com.yanzuoguang.dao.DaoConst;
import com.yanzuoguang.db.DbExecute;
import com.yanzuoguang.util.base.ObjectHelper;
import com.yanzuoguang.util.exception.CodeException;
import com.yanzuoguang.util.helper.DateHelper;
......@@ -23,9 +24,10 @@ import java.util.*;
public abstract class BaseDaoImpl extends BaseDaoSql implements BaseDao {
@Override
protected void initExecute(){
protected void initExecute(DbExecute db) {
}
/**
* 获取当前主键
*
......
......@@ -57,8 +57,8 @@ public abstract class BaseDaoSql {
*/
protected DbExecute getDb() {
if (this.db != null && !this.initSql) {
this.initExecute(this.db);
this.initSql = true;
this.initExecute();
}
return db;
}
......@@ -88,7 +88,7 @@ public abstract class BaseDaoSql {
/**
* 初始化执行
*/
protected abstract void initExecute();
protected abstract void initExecute(DbExecute db);
/**
* 注册SQL语句
......
......@@ -3,6 +3,7 @@ package com.yanzuoguang.mq.dao.impl;
import com.yanzuoguang.dao.DaoConst;
import com.yanzuoguang.dao.impl.BaseDaoImpl;
import com.yanzuoguang.dao.impl.SqlData;
import com.yanzuoguang.db.DbExecute;
import com.yanzuoguang.mq.dao.MessageDao;
import com.yanzuoguang.mq.vo.MessageVo;
import com.yanzuoguang.util.vo.MapRow;
......@@ -50,10 +51,10 @@ public class MessageDaoImpl extends BaseDaoImpl implements MessageDao {
}
@Override
protected void initExecute() {
List<MapRow> tables = this.getDb().query(MessageDaoImpl.class, "QUERY_TABLE_SQL", QUERY_TABLE_SQL);
protected void initExecute(DbExecute db) {
List<MapRow> tables = db.query(MessageDaoImpl.class, "QUERY_TABLE_SQL", QUERY_TABLE_SQL);
if (tables.isEmpty()) {
this.getDb().update(MessageDaoImpl.class, "CREATE_TABLE_SQL", CREATE_TABLE_SQL);
db.update(MessageDaoImpl.class, "CREATE_TABLE_SQL", CREATE_TABLE_SQL);
}
}
......
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