|
@@ -1,14 +1,12 @@
|
|
|
package com.boman.web.core.controller;
|
|
|
|
|
|
+import com.boman.common.redis.RedisKey;
|
|
|
import com.boman.domain.dto.AjaxResult;
|
|
|
import com.boman.domain.GenTable;
|
|
|
import com.boman.web.core.service.TableServiceCmdService;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-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.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -17,27 +15,23 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
* @date 2021年03月22日 09:19
|
|
|
**/
|
|
|
@RestController
|
|
|
-@RequestMapping("/p/cs/table")
|
|
|
+@RequestMapping("/p/cs/table/")
|
|
|
public class TableController {
|
|
|
|
|
|
@Autowired
|
|
|
- private TableServiceCmdService tableServiceCmdService;
|
|
|
+ private TableServiceCmdService cmdService;
|
|
|
|
|
|
/**
|
|
|
* 功能描述: 根据表名获取表信息、表字段和表字段对应的字典值
|
|
|
- * {
|
|
|
- * "table": "sys_config",
|
|
|
- * }
|
|
|
*
|
|
|
- *
|
|
|
- * @param condition condition
|
|
|
+ * @param tableName tableName
|
|
|
* @return com.boman.domain.dto.AjaxResult
|
|
|
*/
|
|
|
-// @ApiOperation(value = "根据表名获取表单所有信息")
|
|
|
-// @PostMapping("/getByTableName")
|
|
|
-// public AjaxResult getByTableName(@RequestBody BaseTableSaveDTO condition) {
|
|
|
-// return tableServiceCmdService.getByTableName(condition);
|
|
|
-// }
|
|
|
+ @ApiOperation(value = "根据表名获取表单所有信息")
|
|
|
+ @GetMapping("/getByTableName/{tableName}")
|
|
|
+ public AjaxResult getByTableName(@PathVariable("tableName") String tableName) {
|
|
|
+ return AjaxResult.success(cmdService.getTableFromRedisByTableName(RedisKey.TABLE_INFO, tableName));
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 功能描述: 根据表名获取表信息、表字段和表字段对应的字典值
|
|
@@ -51,7 +45,7 @@ public class TableController {
|
|
|
@ApiOperation(value = "根据表名获取表单所有信息, 没有过滤")
|
|
|
@PostMapping("/listAllColumnsByTableId")
|
|
|
public AjaxResult listAllColumnsByTableId(@RequestBody GenTable table) {
|
|
|
- return tableServiceCmdService.listAllColumnsByTableId(table);
|
|
|
+ return cmdService.listAllColumnsByTableId(table);
|
|
|
}
|
|
|
|
|
|
|