移除smart-doc,计划替换为yapi
This commit is contained in:
1 parent
2f0b21c3fa
commit
9d7bf97823
8 files changed
+78
-29
No files matched your search
@@ -16,8 +16,6 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.crane.common;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 通用数据接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/data")
|
||||
public class DataController {
|
||||
|
||||
/**
|
||||
* 查询数据接口
|
||||
* @param table 表名
|
||||
* @param filters 查询过滤条件(JSON字符串)
|
||||
* @return 查询结果
|
||||
*/
|
||||
@GetMapping("/load")
|
||||
public Map<String, Object> loadData(
|
||||
@RequestParam String table,
|
||||
@RequestParam(required = false) String filters
|
||||
) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("code", 0);
|
||||
result.put("data", "模拟查询结果");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据接口
|
||||
* @param table 表名
|
||||
* @param data 要保存的数据(键值对)
|
||||
* @return 保存结果
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
public Map<String, Object> saveData(
|
||||
@RequestParam String table,
|
||||
@RequestBody Map<String, Object> data
|
||||
) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("code", 0);
|
||||
result.put("msg", "保存成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
public void test(){
|
||||
System.out.println("test");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user