Skip to content

Commit

Permalink
update api request context-path
Browse files Browse the repository at this point in the history
  • Loading branch information
Jzow committed Sep 10, 2023
1 parent c5e32fe commit 523fd39
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 32 deletions.
10 changes: 8 additions & 2 deletions api/src/main/java/com/wansensoft/api/LogController.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
import com.wansensoft.entities.user.User;
import com.wansensoft.service.log.LogService;
import com.wansensoft.utils.BaseResponseInfo;
import com.wansensoft.utils.Constants;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
Expand All @@ -24,13 +26,17 @@ public LogController(LogService logService) {
}

@GetMapping("/getAllList")
public BaseResponseInfo getAllList(HttpServletRequest request)throws Exception {
public BaseResponseInfo getAllList(@RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize,
@RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage,
@RequestParam(value = Constants.SEARCH, required = false) String search,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try {
Map<String, Object> data = new HashMap<>();
List<Log> dataList = logService.getLog();
if(dataList!=null) {
data.put("logList", dataList);
data.put("total", 10);
data.put("rows", dataList);
}
res.code = 200;
res.data = data;
Expand Down
29 changes: 0 additions & 29 deletions api/src/main/java/com/wansensoft/api/ResourceController.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,35 +68,6 @@ public String getList(@PathVariable("apiName") String apiName,
return ResponseJsonUtil.returnJson(objectMap, "查找不到数据", ErpInfo.OK.code);
}
}
// @GetMapping(value = "/{apiName}/list")
// @ApiOperation(value = "获取信息列表")
// public String getList(@PathVariable("apiName") String apiName,
// @RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize,
// @RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage,
// @RequestParam(value = Constants.SEARCH, required = false) String search,
// HttpServletRequest request)throws Exception {
// Map<String, String> parameterMap = ParamUtils.requestToMap(request);
// parameterMap.put(Constants.SEARCH, search);
// Map<String, Object> objectMap = new HashMap<String, Object>();
// if (pageSize != null && pageSize <= 0) {
// pageSize = 10;
// }
// String offset = ParamUtils.getPageOffset(currentPage, pageSize);
// if (StringUtil.isNotEmpty(offset)) {
// parameterMap.put(Constants.OFFSET, offset);
// }
// List<?> list = configResourceManager.select(apiName, parameterMap);
// if (list != null) {
// objectMap.put("total", configResourceManager.counts(apiName, parameterMap));
// objectMap.put("rows", list);
// System.err.println(ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, Integer.parseInt(ErpInfo.OK.code)));
// return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, Integer.parseInt(ErpInfo.OK.code));
// } else {
// objectMap.put("total", BusinessConstants.DEFAULT_LIST_NULL_NUMBER);
// objectMap.put("rows", new ArrayList<Object>());
// return ResponseJsonUtil.returnJson(objectMap, "查找不到数据", Integer.parseInt(ErpInfo.OK.code));
// }
// }

@PostMapping(value = "/{apiName}/add", produces = {"application/javascript", "application/json"})
@ApiOperation(value = "新增")
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
server:
port: 9999
servlet:
context-path: /wansenerp
context-path: /wansenerp-api
tomcat:
basedir: /opt/tmp/tomcat

Expand Down

0 comments on commit 523fd39

Please sign in to comment.