|
@@ -7,10 +7,12 @@ import com.boman.common.core.utils.SecurityUtils;
|
|
import com.boman.common.core.utils.StringUtils;
|
|
import com.boman.common.core.utils.StringUtils;
|
|
import com.boman.common.core.utils.obj.ObjectUtils;
|
|
import com.boman.common.core.utils.obj.ObjectUtils;
|
|
import com.boman.common.log.enums.BusinessType;
|
|
import com.boman.common.log.enums.BusinessType;
|
|
-import com.boman.domain.constant.FormDataConstant;
|
|
|
|
|
|
+import com.boman.common.redis.RedisKey;
|
|
|
|
+import com.boman.common.redis.service.RedisService;
|
|
import com.boman.domain.GenTable;
|
|
import com.boman.domain.GenTable;
|
|
import com.boman.domain.GenTableColumn;
|
|
import com.boman.domain.GenTableColumn;
|
|
import com.boman.domain.TableSql;
|
|
import com.boman.domain.TableSql;
|
|
|
|
+import com.boman.domain.constant.FormDataConstant;
|
|
import com.boman.gen.mapper.GenTableColumnMapper;
|
|
import com.boman.gen.mapper.GenTableColumnMapper;
|
|
import com.boman.gen.mapper.GenTableMapper;
|
|
import com.boman.gen.mapper.GenTableMapper;
|
|
import com.boman.gen.mapper.TableSqlMapper;
|
|
import com.boman.gen.mapper.TableSqlMapper;
|
|
@@ -20,12 +22,10 @@ import org.springframework.scheduling.annotation.Async;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.web.client.RestTemplate;
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
-import javax.annotation.Resource;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.Collections;
|
|
import java.util.Collections;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 业务字段 服务层实现
|
|
* 业务字段 服务层实现
|
|
@@ -40,6 +40,8 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService {
|
|
private GenTableMapper genTableMapper;
|
|
private GenTableMapper genTableMapper;
|
|
@Autowired
|
|
@Autowired
|
|
private TableSqlMapper tableSqlMapper;
|
|
private TableSqlMapper tableSqlMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private RedisService redisService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -322,4 +324,24 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService {
|
|
}
|
|
}
|
|
return UserConstants.UNIQUE;
|
|
return UserConstants.UNIQUE;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 功能描述: 根据表名查询改表所有的字段信息
|
|
|
|
+ *
|
|
|
|
+ * @param tableName tableName
|
|
|
|
+ * @return java.util.List<com.boman.domain.GenTableColumn>
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public List<GenTableColumn> listColumnsByTableName(String tableName) {
|
|
|
|
+ GenTable genTable = redisService.getCacheObject(RedisKey.TABLE_INFO + tableName);
|
|
|
|
+ if (genTable == null) {
|
|
|
|
+ genTable = genTableMapper.selectGenTableByName(tableName);
|
|
|
|
+ if (genTable == null) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return listByTableIdList(Collections.singletonList(genTable.getId()));
|
|
|
|
+ }
|
|
}
|
|
}
|