|
@@ -10,14 +10,11 @@ import org.jeecg.modules.activiti.entity.TbTableInfo;
|
|
|
import org.jeecg.modules.activiti.service.ITbTableInfoService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/tbTableInfo")
|
|
@@ -73,4 +70,46 @@ public class TbTableInfoController {
|
|
|
tableInfo.setJsonContent(obj);
|
|
|
return Result.ok(tableInfo);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Author chenchuang
|
|
|
+ * @Description //TODO 获取表名和表注释
|
|
|
+ * @Date 2021/7/1 13:44
|
|
|
+ * @Param []
|
|
|
+ * @return org.jeecg.common.api.vo.Result<java.util.List<java.util.Map<java.lang.String,java.lang.Object>>>
|
|
|
+ */
|
|
|
+ @GetMapping("/getTableList")
|
|
|
+ public Result<List<Map<String,Object>>> getTableList(){
|
|
|
+ Result<List<Map<String,Object>>> result=new Result<>();
|
|
|
+ try {
|
|
|
+ List<Map<String,Object>> list=tbTableInfoService.getTableList();
|
|
|
+ result.success("操作成功");
|
|
|
+ result.setResult(list);
|
|
|
+ } catch (Exception e) {
|
|
|
+ result.error500("操作失败");
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Author chenchuang
|
|
|
+ * @Description //TODO 根据表明获取字段名称以及字段说明
|
|
|
+ * @Date 2021/7/1 15:22
|
|
|
+ * @Param [tableName]
|
|
|
+ * @return org.jeecg.common.api.vo.Result<java.util.List<java.util.Map<java.lang.String,java.lang.Object>>>
|
|
|
+ */
|
|
|
+ @GetMapping("getTableColumnList")
|
|
|
+ public Result<List<Map<String,Object>>> getTableColumnList(String tableName){
|
|
|
+ Result<List<Map<String,Object>>> result=new Result<>();
|
|
|
+ try {
|
|
|
+ List<Map<String,Object>> list=tbTableInfoService.getTableColumnList(tableName);
|
|
|
+ result.success("操作成功");
|
|
|
+ result.setResult(list);
|
|
|
+ } catch (Exception e) {
|
|
|
+ result.error500("操作失败");
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|