未验证 提交 aa8301ad 编写于 作者: J Junjie Ma 提交者: GitHub

[Feature][JsonSplit-api] modify API to Restful-04 (#6110)

* modify Resource
modify UiPlugin
modify WorkerGroup

* merge

* solve bug
Co-authored-by: NJunjie Ma <manmxhn@163.com>
上级 e3235098
...@@ -64,8 +64,11 @@ import org.springframework.core.io.Resource; ...@@ -64,8 +64,11 @@ import org.springframework.core.io.Resource;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestAttribute; import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
...@@ -112,7 +115,7 @@ public class ResourcesController extends BaseController { ...@@ -112,7 +115,7 @@ public class ResourcesController extends BaseController {
@ApiImplicitParam(name = "pid", value = "RESOURCE_PID", required = true, dataType = "Int", example = "10"), @ApiImplicitParam(name = "pid", value = "RESOURCE_PID", required = true, dataType = "Int", example = "10"),
@ApiImplicitParam(name = "currentDir", value = "RESOURCE_CURRENTDIR", required = true, dataType = "String") @ApiImplicitParam(name = "currentDir", value = "RESOURCE_CURRENTDIR", required = true, dataType = "String")
}) })
@PostMapping(value = "/directory/create") @PostMapping(value = "/directory")
@ApiException(CREATE_RESOURCE_ERROR) @ApiException(CREATE_RESOURCE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result createDirectory(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, public Result createDirectory(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
...@@ -138,7 +141,7 @@ public class ResourcesController extends BaseController { ...@@ -138,7 +141,7 @@ public class ResourcesController extends BaseController {
@ApiImplicitParam(name = "pid", value = "RESOURCE_PID", required = true, dataType = "Int", example = "10"), @ApiImplicitParam(name = "pid", value = "RESOURCE_PID", required = true, dataType = "Int", example = "10"),
@ApiImplicitParam(name = "currentDir", value = "RESOURCE_CURRENTDIR", required = true, dataType = "String") @ApiImplicitParam(name = "currentDir", value = "RESOURCE_CURRENTDIR", required = true, dataType = "String")
}) })
@PostMapping(value = "/create") @PostMapping()
@ApiException(CREATE_RESOURCE_ERROR) @ApiException(CREATE_RESOURCE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result createResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, public Result createResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
...@@ -170,11 +173,11 @@ public class ResourcesController extends BaseController { ...@@ -170,11 +173,11 @@ public class ResourcesController extends BaseController {
@ApiImplicitParam(name = "description", value = "RESOURCE_DESC", dataType = "String"), @ApiImplicitParam(name = "description", value = "RESOURCE_DESC", dataType = "String"),
@ApiImplicitParam(name = "file", value = "RESOURCE_FILE", required = true, dataType = "MultipartFile") @ApiImplicitParam(name = "file", value = "RESOURCE_FILE", required = true, dataType = "MultipartFile")
}) })
@PostMapping(value = "/update") @PutMapping(value = "/{id}")
@ApiException(UPDATE_RESOURCE_ERROR) @ApiException(UPDATE_RESOURCE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result updateResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, public Result updateResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "id") int resourceId, @PathVariable(value = "id") int resourceId,
@RequestParam(value = "type") ResourceType type, @RequestParam(value = "type") ResourceType type,
@RequestParam(value = "name") String alias, @RequestParam(value = "name") String alias,
@RequestParam(value = "description", required = false) String description, @RequestParam(value = "description", required = false) String description,
...@@ -222,7 +225,7 @@ public class ResourcesController extends BaseController { ...@@ -222,7 +225,7 @@ public class ResourcesController extends BaseController {
@ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataType = "Int", example = "1"), @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataType = "Int", example = "1"),
@ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataType = "Int", example = "20") @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataType = "Int", example = "20")
}) })
@GetMapping(value = "/list-paging") @GetMapping()
@ResponseStatus(HttpStatus.OK) @ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_RESOURCES_LIST_PAGING) @ApiException(QUERY_RESOURCES_LIST_PAGING)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
...@@ -255,12 +258,12 @@ public class ResourcesController extends BaseController { ...@@ -255,12 +258,12 @@ public class ResourcesController extends BaseController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100") @ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100")
}) })
@GetMapping(value = "/delete") @DeleteMapping(value = "/{id}")
@ResponseStatus(HttpStatus.OK) @ResponseStatus(HttpStatus.OK)
@ApiException(DELETE_RESOURCE_ERROR) @ApiException(DELETE_RESOURCE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result deleteResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, public Result deleteResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "id") int resourceId @PathVariable(value = "id") int resourceId
) throws Exception { ) throws Exception {
return resourceService.delete(loginUser, resourceId); return resourceService.delete(loginUser, resourceId);
} }
...@@ -291,7 +294,7 @@ public class ResourcesController extends BaseController { ...@@ -291,7 +294,7 @@ public class ResourcesController extends BaseController {
} }
/** /**
* query resources jar list * query resources by type
* *
* @param loginUser login user * @param loginUser login user
* @param type resource type * @param type resource type
...@@ -301,7 +304,7 @@ public class ResourcesController extends BaseController { ...@@ -301,7 +304,7 @@ public class ResourcesController extends BaseController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType = "ResourceType") @ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType = "ResourceType")
}) })
@GetMapping(value = "/list/jar") @GetMapping(value = "/query-by-type")
@ResponseStatus(HttpStatus.OK) @ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_RESOURCES_LIST_ERROR) @ApiException(QUERY_RESOURCES_LIST_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
...@@ -328,13 +331,13 @@ public class ResourcesController extends BaseController { ...@@ -328,13 +331,13 @@ public class ResourcesController extends BaseController {
@ApiImplicitParam(name = "fullName", value = "RESOURCE_FULL_NAME", required = true, dataType = "String"), @ApiImplicitParam(name = "fullName", value = "RESOURCE_FULL_NAME", required = true, dataType = "String"),
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = false, dataType = "Int", example = "10") @ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = false, dataType = "Int", example = "10")
}) })
@GetMapping(value = "/queryResource") @GetMapping(value = "/{id}")
@ResponseStatus(HttpStatus.OK) @ResponseStatus(HttpStatus.OK)
@ApiException(RESOURCE_NOT_EXIST) @ApiException(RESOURCE_NOT_EXIST)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result queryResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, public Result queryResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "fullName", required = false) String fullName, @RequestParam(value = "fullName", required = false) String fullName,
@RequestParam(value = "id", required = false) Integer id, @PathVariable(value = "id", required = false) Integer id,
@RequestParam(value = "type") ResourceType type @RequestParam(value = "type") ResourceType type
) { ) {
...@@ -356,11 +359,11 @@ public class ResourcesController extends BaseController { ...@@ -356,11 +359,11 @@ public class ResourcesController extends BaseController {
@ApiImplicitParam(name = "skipLineNum", value = "SKIP_LINE_NUM", required = true, dataType = "Int", example = "100"), @ApiImplicitParam(name = "skipLineNum", value = "SKIP_LINE_NUM", required = true, dataType = "Int", example = "100"),
@ApiImplicitParam(name = "limit", value = "LIMIT", required = true, dataType = "Int", example = "100") @ApiImplicitParam(name = "limit", value = "LIMIT", required = true, dataType = "Int", example = "100")
}) })
@GetMapping(value = "/view") @GetMapping(value = "/{id}/view")
@ApiException(VIEW_RESOURCE_FILE_ON_LINE_ERROR) @ApiException(VIEW_RESOURCE_FILE_ON_LINE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result viewResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, public Result viewResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "id") int resourceId, @PathVariable(value = "id") int resourceId,
@RequestParam(value = "skipLineNum") int skipLineNum, @RequestParam(value = "skipLineNum") int skipLineNum,
@RequestParam(value = "limit") int limit @RequestParam(value = "limit") int limit
) { ) {
...@@ -414,11 +417,11 @@ public class ResourcesController extends BaseController { ...@@ -414,11 +417,11 @@ public class ResourcesController extends BaseController {
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100"), @ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100"),
@ApiImplicitParam(name = "content", value = "CONTENT", required = true, dataType = "String") @ApiImplicitParam(name = "content", value = "CONTENT", required = true, dataType = "String")
}) })
@PostMapping(value = "/update-content") @PutMapping(value = "/{id}/update-content")
@ApiException(EDIT_RESOURCE_FILE_ON_LINE_ERROR) @ApiException(EDIT_RESOURCE_FILE_ON_LINE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result updateResourceContent(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, public Result updateResourceContent(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "id") int resourceId, @PathVariable(value = "id") int resourceId,
@RequestParam(value = "content") String content @RequestParam(value = "content") String content
) { ) {
if (StringUtils.isEmpty(content)) { if (StringUtils.isEmpty(content)) {
...@@ -439,12 +442,12 @@ public class ResourcesController extends BaseController { ...@@ -439,12 +442,12 @@ public class ResourcesController extends BaseController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100") @ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100")
}) })
@GetMapping(value = "/download") @GetMapping(value = "/{id}/download")
@ResponseBody @ResponseBody
@ApiException(DOWNLOAD_RESOURCE_FILE_ERROR) @ApiException(DOWNLOAD_RESOURCE_FILE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public ResponseEntity downloadResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, public ResponseEntity downloadResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "id") int resourceId) throws Exception { @PathVariable(value = "id") int resourceId) throws Exception {
Resource file = resourceService.downloadResource(resourceId); Resource file = resourceService.downloadResource(resourceId);
if (file == null) { if (file == null) {
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(Status.RESOURCE_NOT_EXIST.getMsg()); return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(Status.RESOURCE_NOT_EXIST.getMsg());
...@@ -480,7 +483,7 @@ public class ResourcesController extends BaseController { ...@@ -480,7 +483,7 @@ public class ResourcesController extends BaseController {
@ApiImplicitParam(name = "resourceId", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100") @ApiImplicitParam(name = "resourceId", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100")
}) })
@PostMapping(value = "/udf-func/create") @PostMapping(value = "/{resourceId}/udf-func")
@ResponseStatus(HttpStatus.CREATED) @ResponseStatus(HttpStatus.CREATED)
@ApiException(CREATE_UDF_FUNCTION_ERROR) @ApiException(CREATE_UDF_FUNCTION_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
...@@ -491,7 +494,7 @@ public class ResourcesController extends BaseController { ...@@ -491,7 +494,7 @@ public class ResourcesController extends BaseController {
@RequestParam(value = "argTypes", required = false) String argTypes, @RequestParam(value = "argTypes", required = false) String argTypes,
@RequestParam(value = "database", required = false) String database, @RequestParam(value = "database", required = false) String database,
@RequestParam(value = "description", required = false) String description, @RequestParam(value = "description", required = false) String description,
@RequestParam(value = "resourceId") int resourceId) { @PathVariable(value = "resourceId") int resourceId) {
return udfFuncService.createUdfFunction(loginUser, funcName, className, argTypes, database, description, type, resourceId); return udfFuncService.createUdfFunction(loginUser, funcName, className, argTypes, database, description, type, resourceId);
} }
...@@ -507,12 +510,12 @@ public class ResourcesController extends BaseController { ...@@ -507,12 +510,12 @@ public class ResourcesController extends BaseController {
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100") @ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100")
}) })
@GetMapping(value = "/udf-func/update-ui") @GetMapping(value = "/{id}/udf-func")
@ResponseStatus(HttpStatus.OK) @ResponseStatus(HttpStatus.OK)
@ApiException(VIEW_UDF_FUNCTION_ERROR) @ApiException(VIEW_UDF_FUNCTION_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result viewUIUdfFunction(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, public Result viewUIUdfFunction(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam("id") int id) { @PathVariable("id") int id) {
Map<String, Object> map = udfFuncService.queryUdfFuncDetail(id); Map<String, Object> map = udfFuncService.queryUdfFuncDetail(id);
return returnDataList(map); return returnDataList(map);
} }
...@@ -543,18 +546,18 @@ public class ResourcesController extends BaseController { ...@@ -543,18 +546,18 @@ public class ResourcesController extends BaseController {
@ApiImplicitParam(name = "resourceId", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100") @ApiImplicitParam(name = "resourceId", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100")
}) })
@PostMapping(value = "/udf-func/update") @PutMapping(value = "/{resourceId}/udf-func/{id}")
@ApiException(UPDATE_UDF_FUNCTION_ERROR) @ApiException(UPDATE_UDF_FUNCTION_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result updateUdfFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, public Result updateUdfFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "id") int udfFuncId, @PathVariable(value = "id") int udfFuncId,
@RequestParam(value = "type") UdfType type, @RequestParam(value = "type") UdfType type,
@RequestParam(value = "funcName") String funcName, @RequestParam(value = "funcName") String funcName,
@RequestParam(value = "className") String className, @RequestParam(value = "className") String className,
@RequestParam(value = "argTypes", required = false) String argTypes, @RequestParam(value = "argTypes", required = false) String argTypes,
@RequestParam(value = "database", required = false) String database, @RequestParam(value = "database", required = false) String database,
@RequestParam(value = "description", required = false) String description, @RequestParam(value = "description", required = false) String description,
@RequestParam(value = "resourceId") int resourceId) { @PathVariable(value = "resourceId") int resourceId) {
Map<String, Object> result = udfFuncService.updateUdfFunc(udfFuncId, funcName, className, argTypes, database, description, type, resourceId); Map<String, Object> result = udfFuncService.updateUdfFunc(udfFuncId, funcName, className, argTypes, database, description, type, resourceId);
return returnDataList(result); return returnDataList(result);
} }
...@@ -574,7 +577,7 @@ public class ResourcesController extends BaseController { ...@@ -574,7 +577,7 @@ public class ResourcesController extends BaseController {
@ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataType = "Int", example = "1"), @ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataType = "Int", example = "1"),
@ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataType = "Int", example = "20") @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataType = "Int", example = "20")
}) })
@GetMapping(value = "/udf-func/list-paging") @GetMapping(value = "/udf-func")
@ResponseStatus(HttpStatus.OK) @ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_UDF_FUNCTION_LIST_PAGING_ERROR) @ApiException(QUERY_UDF_FUNCTION_LIST_PAGING_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
...@@ -645,14 +648,14 @@ public class ResourcesController extends BaseController { ...@@ -645,14 +648,14 @@ public class ResourcesController extends BaseController {
*/ */
@ApiOperation(value = "deleteUdfFunc", notes = "DELETE_UDF_FUNCTION_NOTES") @ApiOperation(value = "deleteUdfFunc", notes = "DELETE_UDF_FUNCTION_NOTES")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100") @ApiImplicitParam(name = "id", value = "UDF_FUNC_ID", required = true, dataType = "Int", example = "100")
}) })
@GetMapping(value = "/udf-func/delete") @DeleteMapping(value = "/udf-func/{id}")
@ResponseStatus(HttpStatus.OK) @ResponseStatus(HttpStatus.OK)
@ApiException(DELETE_UDF_FUNCTION_ERROR) @ApiException(DELETE_UDF_FUNCTION_ERROR)
@AccessLogAnnotation @AccessLogAnnotation
public Result deleteUdfFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, public Result deleteUdfFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "id") int udfFuncId @PathVariable(value = "id") int udfFuncId
) { ) {
return udfFuncService.delete(udfFuncId); return udfFuncService.delete(udfFuncId);
} }
...@@ -690,7 +693,7 @@ public class ResourcesController extends BaseController { ...@@ -690,7 +693,7 @@ public class ResourcesController extends BaseController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataType = "Int", example = "100") @ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataType = "Int", example = "100")
}) })
@GetMapping(value = "/authorize-resource-tree") @GetMapping(value = "/authed-resource-tree")
@ResponseStatus(HttpStatus.CREATED) @ResponseStatus(HttpStatus.CREATED)
@ApiException(AUTHORIZE_RESOURCE_TREE) @ApiException(AUTHORIZE_RESOURCE_TREE)
@AccessLogAnnotation @AccessLogAnnotation
......
...@@ -31,6 +31,8 @@ import java.util.Map; ...@@ -31,6 +31,8 @@ import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestAttribute; import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -62,7 +64,7 @@ public class UiPluginController extends BaseController { ...@@ -62,7 +64,7 @@ public class UiPluginController extends BaseController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "pluginType", value = "pluginType", required = true, dataType = "PluginType"), @ApiImplicitParam(name = "pluginType", value = "pluginType", required = true, dataType = "PluginType"),
}) })
@PostMapping(value = "/queryUiPluginsByType") @GetMapping(value = "/query-by-type")
@ResponseStatus(HttpStatus.CREATED) @ResponseStatus(HttpStatus.CREATED)
@ApiException(QUERY_PLUGINS_ERROR) @ApiException(QUERY_PLUGINS_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
...@@ -75,14 +77,14 @@ public class UiPluginController extends BaseController { ...@@ -75,14 +77,14 @@ public class UiPluginController extends BaseController {
@ApiOperation(value = "queryUiPluginDetailById", notes = "QUERY_UI_PLUGIN_DETAIL_BY_ID") @ApiOperation(value = "queryUiPluginDetailById", notes = "QUERY_UI_PLUGIN_DETAIL_BY_ID")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "pluginId", value = "PLUGIN_ID", required = true, dataType = "Int", example = "100"), @ApiImplicitParam(name = "id", value = "PLUGIN_ID", required = true, dataType = "Int", example = "100"),
}) })
@PostMapping(value = "/queryUiPluginDetailById") @GetMapping(value = "/{id}")
@ResponseStatus(HttpStatus.CREATED) @ResponseStatus(HttpStatus.CREATED)
@ApiException(QUERY_PLUGINS_ERROR) @ApiException(QUERY_PLUGINS_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result queryUiPluginDetailById(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, public Result queryUiPluginDetailById(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam("pluginId") Integer pluginId) { @PathVariable("id") Integer pluginId) {
Map<String, Object> result = uiPluginService.queryUiPluginDetailById(pluginId); Map<String, Object> result = uiPluginService.queryUiPluginDetailById(pluginId);
return returnDataList(result); return returnDataList(result);
......
...@@ -34,7 +34,9 @@ import java.util.Map; ...@@ -34,7 +34,9 @@ import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestAttribute; import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -53,7 +55,7 @@ import springfox.documentation.annotations.ApiIgnore; ...@@ -53,7 +55,7 @@ import springfox.documentation.annotations.ApiIgnore;
*/ */
@Api(tags = "WORKER_GROUP_TAG") @Api(tags = "WORKER_GROUP_TAG")
@RestController @RestController
@RequestMapping("/worker-group") @RequestMapping("/worker-groups")
public class WorkerGroupController extends BaseController { public class WorkerGroupController extends BaseController {
@Autowired @Autowired
...@@ -74,7 +76,7 @@ public class WorkerGroupController extends BaseController { ...@@ -74,7 +76,7 @@ public class WorkerGroupController extends BaseController {
@ApiImplicitParam(name = "name", value = "WORKER_GROUP_NAME", required = true, dataType = "String"), @ApiImplicitParam(name = "name", value = "WORKER_GROUP_NAME", required = true, dataType = "String"),
@ApiImplicitParam(name = "addrList", value = "WORKER_ADDR_LIST", required = true, dataType = "String") @ApiImplicitParam(name = "addrList", value = "WORKER_ADDR_LIST", required = true, dataType = "String")
}) })
@PostMapping(value = "/save") @PostMapping()
@ResponseStatus(HttpStatus.OK) @ResponseStatus(HttpStatus.OK)
@ApiException(SAVE_ERROR) @ApiException(SAVE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
...@@ -102,7 +104,7 @@ public class WorkerGroupController extends BaseController { ...@@ -102,7 +104,7 @@ public class WorkerGroupController extends BaseController {
@ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataType = "Int", example = "20"), @ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataType = "Int", example = "20"),
@ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataType = "String") @ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataType = "String")
}) })
@GetMapping(value = "/list-paging") @GetMapping()
@ResponseStatus(HttpStatus.OK) @ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_WORKER_GROUP_FAIL) @ApiException(QUERY_WORKER_GROUP_FAIL)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
...@@ -128,7 +130,7 @@ public class WorkerGroupController extends BaseController { ...@@ -128,7 +130,7 @@ public class WorkerGroupController extends BaseController {
* @return all worker group list * @return all worker group list
*/ */
@ApiOperation(value = "queryAllWorkerGroups", notes = "QUERY_WORKER_GROUP_LIST_NOTES") @ApiOperation(value = "queryAllWorkerGroups", notes = "QUERY_WORKER_GROUP_LIST_NOTES")
@GetMapping(value = "/all-groups") @GetMapping(value = "/all")
@ResponseStatus(HttpStatus.OK) @ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_WORKER_GROUP_FAIL) @ApiException(QUERY_WORKER_GROUP_FAIL)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
...@@ -148,12 +150,12 @@ public class WorkerGroupController extends BaseController { ...@@ -148,12 +150,12 @@ public class WorkerGroupController extends BaseController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "WORKER_GROUP_ID", required = true, dataType = "Int", example = "10"), @ApiImplicitParam(name = "id", value = "WORKER_GROUP_ID", required = true, dataType = "Int", example = "10"),
}) })
@PostMapping(value = "/delete-by-id") @DeleteMapping(value = "/{id}")
@ResponseStatus(HttpStatus.OK) @ResponseStatus(HttpStatus.OK)
@ApiException(DELETE_WORKER_GROUP_FAIL) @ApiException(DELETE_WORKER_GROUP_FAIL)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser") @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result deleteById(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, public Result deleteById(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam("id") Integer id @PathVariable("id") Integer id
) { ) {
Map<String, Object> result = workerGroupService.deleteWorkerGroupById(loginUser, id); Map<String, Object> result = workerGroupService.deleteWorkerGroupById(loginUser, id);
return returnDataList(result); return returnDataList(result);
......
...@@ -446,7 +446,7 @@ export default { ...@@ -446,7 +446,7 @@ export default {
resolve() resolve()
return return
} }
io.get('resources/list/jar', { io.get('resources/query-by-type', {
type: 'FILE' type: 'FILE'
}, res => { }, res => {
state.resourcesListJar = res.data state.resourcesListJar = res.data
...@@ -823,7 +823,7 @@ export default { ...@@ -823,7 +823,7 @@ export default {
}, },
getResourceId ({ state }, payload) { getResourceId ({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
io.get('resources/queryResource', payload, res => { io.get(`resources/${payload.id}`, payload, res => {
resolve(res.data) resolve(res.data)
}).catch(e => { }).catch(e => {
reject(e) reject(e)
...@@ -832,7 +832,7 @@ export default { ...@@ -832,7 +832,7 @@ export default {
}, },
genTaskCodeList ({ state }, payload) { genTaskCodeList ({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
io.get(`projects/${state.projectCode}/task/gen-task-code-list`, payload, res => { io.get(`projects/${state.projectCode}/task/gen-task-codes`, payload, res => {
resolve(res.data) resolve(res.data)
}).catch(e => { }).catch(e => {
reject(e) reject(e)
......
...@@ -23,7 +23,7 @@ export default { ...@@ -23,7 +23,7 @@ export default {
*/ */
getResourcesListP ({ state }, payload) { getResourcesListP ({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
io.get('resources/list-paging', payload, res => { io.get('resources', payload, res => {
resolve(res.data) resolve(res.data)
}).catch(e => { }).catch(e => {
reject(e) reject(e)
...@@ -32,7 +32,7 @@ export default { ...@@ -32,7 +32,7 @@ export default {
}, },
getResourceId ({ state }, payload) { getResourceId ({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
io.get('resources/queryResource', payload, res => { io.get(`resources/${payload.id}`, payload, res => {
resolve(res.data) resolve(res.data)
}).catch(e => { }).catch(e => {
reject(e) reject(e)
...@@ -53,7 +53,7 @@ export default { ...@@ -53,7 +53,7 @@ export default {
*/ */
deleteResource ({ state }, payload) { deleteResource ({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
io.get('resources/delete', payload, res => { io.delete(`resources/${payload.id}`, payload, res => {
resolve(res) resolve(res)
}).catch(e => { }).catch(e => {
reject(e) reject(e)
...@@ -77,7 +77,7 @@ export default { ...@@ -77,7 +77,7 @@ export default {
*/ */
getViewResources ({ state }, payload) { getViewResources ({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
io.get('resources/view', payload, res => { io.get(`resources/${payload.id}/view`, payload, res => {
resolve(res) resolve(res)
}).catch(e => { }).catch(e => {
reject(e) reject(e)
...@@ -89,7 +89,7 @@ export default { ...@@ -89,7 +89,7 @@ export default {
*/ */
createUdfFunc ({ state }, payload) { createUdfFunc ({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
io.post('resources/udf-func/create', payload, res => { io.post(`resources/${payload.resourceId}/udf-func`, payload, res => {
resolve(res) resolve(res)
}).catch(e => { }).catch(e => {
reject(e) reject(e)
...@@ -101,7 +101,7 @@ export default { ...@@ -101,7 +101,7 @@ export default {
*/ */
updateUdfFunc ({ state }, payload) { updateUdfFunc ({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
io.post('resources/udf-func/update', payload, res => { io.put(`resources/${payload.resourceId}/udf-func/${payload.id}`, payload, res => {
resolve(res) resolve(res)
}).catch(e => { }).catch(e => {
reject(e) reject(e)
...@@ -126,7 +126,7 @@ export default { ...@@ -126,7 +126,7 @@ export default {
*/ */
deleteUdf ({ state }, payload) { deleteUdf ({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
io.get('resources/udf-func/delete', payload, res => { io.delete(`resources/udf-func/${payload.id}`, payload, res => {
resolve(res) resolve(res)
}).catch(e => { }).catch(e => {
reject(e) reject(e)
...@@ -138,7 +138,7 @@ export default { ...@@ -138,7 +138,7 @@ export default {
*/ */
getUdfFuncListP ({ state }, payload) { getUdfFuncListP ({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
io.get('resources/udf-func/list-paging', payload, res => { io.get('resources/udf-func', payload, res => {
resolve(res.data) resolve(res.data)
}).catch(e => { }).catch(e => {
reject(e) reject(e)
...@@ -150,7 +150,7 @@ export default { ...@@ -150,7 +150,7 @@ export default {
*/ */
updateContent ({ state }, payload) { updateContent ({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
io.post('resources/update-content', payload, res => { io.post(`resources/${payload.id}/update-content`, payload, res => {
resolve(res) resolve(res)
}).catch(e => { }).catch(e => {
reject(e) reject(e)
...@@ -174,7 +174,7 @@ export default { ...@@ -174,7 +174,7 @@ export default {
*/ */
createResourceFolder ({ state }, payload) { createResourceFolder ({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
io.post('resources/directory/create', payload, res => { io.post('resources/directory', payload, res => {
resolve(res) resolve(res)
}).catch(e => { }).catch(e => {
reject(e) reject(e)
...@@ -186,7 +186,7 @@ export default { ...@@ -186,7 +186,7 @@ export default {
*/ */
resourceRename ({ state }, payload) { resourceRename ({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
io.post('resources/update', payload, res => { io.put(`resources/${payload.id}`, payload, res => {
resolve(res) resolve(res)
}).catch(e => { }).catch(e => {
reject(e) reject(e)
......
...@@ -374,7 +374,7 @@ export default { ...@@ -374,7 +374,7 @@ export default {
*/ */
getPlugins ({ state }, payload) { getPlugins ({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
io.post('ui-plugins/queryUiPluginsByType', payload, res => { io.get('ui-plugins/query-by-type', payload, res => {
resolve(res.data) resolve(res.data)
}).catch(e => { }).catch(e => {
reject(e) reject(e)
...@@ -386,7 +386,7 @@ export default { ...@@ -386,7 +386,7 @@ export default {
*/ */
getUiPluginById ({ state }, payload) { getUiPluginById ({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
io.post('ui-plugins/queryUiPluginDetailById', payload, res => { io.get(`ui-plugins/${payload.pluginId}`, payload, res => {
resolve(res.data) resolve(res.data)
}).catch(e => { }).catch(e => {
reject(e) reject(e)
...@@ -566,7 +566,7 @@ export default { ...@@ -566,7 +566,7 @@ export default {
*/ */
getWorkerGroups ({ state }, payload) { getWorkerGroups ({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
io.get('worker-group/list-paging', payload, res => { io.get('worker-groups', payload, res => {
resolve(res.data) resolve(res.data)
}).catch(e => { }).catch(e => {
reject(e) reject(e)
...@@ -578,7 +578,7 @@ export default { ...@@ -578,7 +578,7 @@ export default {
*/ */
getWorkerGroupsAll ({ state }, payload) { getWorkerGroupsAll ({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
io.get('worker-group/all-groups', payload, res => { io.get('worker-groups/all', payload, res => {
let list = res.data let list = res.data
if (list.length > 0) { if (list.length > 0) {
list = list.map(item => { list = list.map(item => {
...@@ -615,7 +615,7 @@ export default { ...@@ -615,7 +615,7 @@ export default {
}, },
saveWorkerGroups ({ state }, payload) { saveWorkerGroups ({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
io.post('worker-group/save', payload, res => { io.post('worker-groups', payload, res => {
resolve(res) resolve(res)
}).catch(e => { }).catch(e => {
reject(e) reject(e)
...@@ -624,7 +624,7 @@ export default { ...@@ -624,7 +624,7 @@ export default {
}, },
deleteWorkerGroups ({ state }, payload) { deleteWorkerGroups ({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
io.post('worker-group/delete-by-id', payload, res => { io.delete(`worker-groups/${payload.id}`, payload, res => {
resolve(res) resolve(res)
}).catch(e => { }).catch(e => {
reject(e) reject(e)
...@@ -633,7 +633,7 @@ export default { ...@@ -633,7 +633,7 @@ export default {
}, },
getWorkerAddresses ({ state }, payload) { getWorkerAddresses ({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
io.get('worker-group/worker-address-list', payload, res => { io.get('worker-groups/worker-address-list', payload, res => {
resolve(res) resolve(res)
}).catch(e => { }).catch(e => {
reject(e) reject(e)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册