Commit a70962da authored by yanzg's avatar yanzg

接口文档的支持

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