Commit aa1ba98b authored by yanzg's avatar yanzg

接口文档的支持

parent 5508c826
package com.yanzuoguang.util.vo;
/**
* 初始化Dao数据
* @author 颜佐光
*/
public interface InitRemoveDao {
/**
* 初始化数据,去掉空值
*/
void initRemove();
}
...@@ -6,10 +6,7 @@ import com.yanzuoguang.util.base.ObjectHelper; ...@@ -6,10 +6,7 @@ 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;
import com.yanzuoguang.util.helper.StringHelper; import com.yanzuoguang.util.helper.StringHelper;
import com.yanzuoguang.util.vo.InitDao; import com.yanzuoguang.util.vo.*;
import com.yanzuoguang.util.vo.MapRow;
import com.yanzuoguang.util.vo.PageSizeData;
import com.yanzuoguang.util.vo.PageSizeReqVo;
import java.lang.reflect.Array; import java.lang.reflect.Array;
import java.util.*; import java.util.*;
...@@ -321,17 +318,22 @@ public abstract class BaseDaoImpl extends BaseDaoSql implements BaseDao { ...@@ -321,17 +318,22 @@ public abstract class BaseDaoImpl extends BaseDaoSql implements BaseDao {
* @param model 需要检测的数据 * @param model 需要检测的数据
*/ */
protected void check(int operatorType, String keyString, Object model) { protected void check(int operatorType, String keyString, Object model) {
if (model instanceof InitDao) {
InitDao to = (InitDao) model;
to.init();
}
if (operatorType == DaoConst.OPERATOR_TYPE_CREATE || operatorType == DaoConst.OPERATOR_TYPE_UPDATE) { if (operatorType == DaoConst.OPERATOR_TYPE_CREATE || operatorType == DaoConst.OPERATOR_TYPE_UPDATE) {
if (model instanceof InitDao) {
InitDao to = (InitDao) model;
to.init();
}
List<SqlData> sqlArray = this.table.getSqlType(DaoConst.SQL_TYPE_EXISTS); List<SqlData> sqlArray = this.table.getSqlType(DaoConst.SQL_TYPE_EXISTS);
if (sqlArray != null) { if (sqlArray != null) {
for (SqlData sql : sqlArray) { for (SqlData sql : sqlArray) {
this.checkExist(sql.getName(), model, String.format("%s已经存在", sql.getName())); this.checkExist(sql.getName(), model, String.format("%s已经存在", sql.getName()));
} }
} }
} else if (operatorType == DaoConst.OPERATOR_TYPE_REMOVE) {
if (model instanceof InitRemoveDao) {
InitRemoveDao to = (InitRemoveDao) model;
to.initRemove();
}
} }
} }
......
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