mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-12-03 12:48:46 +08:00
[Feature][JsonSplit-api] modify API to Restful-04 (#6110)
* modify Resource modify UiPlugin modify WorkerGroup * merge * solve bug Co-authored-by: Junjie Ma <manmxhn@163.com>
This commit is contained in:
parent
e3235098d6
commit
aa8301ad36
@ -64,8 +64,11 @@ import org.springframework.core.io.Resource;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
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.PathVariable;
|
||||
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.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@ -112,7 +115,7 @@ public class ResourcesController extends BaseController {
|
||||
@ApiImplicitParam(name = "pid", value = "RESOURCE_PID", required = true, dataType = "Int", example = "10"),
|
||||
@ApiImplicitParam(name = "currentDir", value = "RESOURCE_CURRENTDIR", required = true, dataType = "String")
|
||||
})
|
||||
@PostMapping(value = "/directory/create")
|
||||
@PostMapping(value = "/directory")
|
||||
@ApiException(CREATE_RESOURCE_ERROR)
|
||||
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
|
||||
public Result createDirectory(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
|
||||
@ -138,7 +141,7 @@ public class ResourcesController extends BaseController {
|
||||
@ApiImplicitParam(name = "pid", value = "RESOURCE_PID", required = true, dataType = "Int", example = "10"),
|
||||
@ApiImplicitParam(name = "currentDir", value = "RESOURCE_CURRENTDIR", required = true, dataType = "String")
|
||||
})
|
||||
@PostMapping(value = "/create")
|
||||
@PostMapping()
|
||||
@ApiException(CREATE_RESOURCE_ERROR)
|
||||
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
|
||||
public Result createResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
|
||||
@ -170,11 +173,11 @@ public class ResourcesController extends BaseController {
|
||||
@ApiImplicitParam(name = "description", value = "RESOURCE_DESC", dataType = "String"),
|
||||
@ApiImplicitParam(name = "file", value = "RESOURCE_FILE", required = true, dataType = "MultipartFile")
|
||||
})
|
||||
@PostMapping(value = "/update")
|
||||
@PutMapping(value = "/{id}")
|
||||
@ApiException(UPDATE_RESOURCE_ERROR)
|
||||
@AccessLogAnnotation(ignoreRequestArgs = "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 = "name") String alias,
|
||||
@RequestParam(value = "description", required = false) String description,
|
||||
@ -222,7 +225,7 @@ public class ResourcesController extends BaseController {
|
||||
@ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataType = "Int", example = "1"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataType = "Int", example = "20")
|
||||
})
|
||||
@GetMapping(value = "/list-paging")
|
||||
@GetMapping()
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
@ApiException(QUERY_RESOURCES_LIST_PAGING)
|
||||
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
|
||||
@ -255,12 +258,12 @@ public class ResourcesController extends BaseController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100")
|
||||
})
|
||||
@GetMapping(value = "/delete")
|
||||
@DeleteMapping(value = "/{id}")
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
@ApiException(DELETE_RESOURCE_ERROR)
|
||||
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
|
||||
public Result deleteResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
|
||||
@RequestParam(value = "id") int resourceId
|
||||
@PathVariable(value = "id") int resourceId
|
||||
) throws Exception {
|
||||
return resourceService.delete(loginUser, resourceId);
|
||||
}
|
||||
@ -291,7 +294,7 @@ public class ResourcesController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* query resources jar list
|
||||
* query resources by type
|
||||
*
|
||||
* @param loginUser login user
|
||||
* @param type resource type
|
||||
@ -301,7 +304,7 @@ public class ResourcesController extends BaseController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType = "ResourceType")
|
||||
})
|
||||
@GetMapping(value = "/list/jar")
|
||||
@GetMapping(value = "/query-by-type")
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
@ApiException(QUERY_RESOURCES_LIST_ERROR)
|
||||
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
|
||||
@ -328,13 +331,13 @@ public class ResourcesController extends BaseController {
|
||||
@ApiImplicitParam(name = "fullName", value = "RESOURCE_FULL_NAME", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = false, dataType = "Int", example = "10")
|
||||
})
|
||||
@GetMapping(value = "/queryResource")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
@ApiException(RESOURCE_NOT_EXIST)
|
||||
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
|
||||
public Result queryResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
|
||||
@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
|
||||
) {
|
||||
|
||||
@ -356,11 +359,11 @@ public class ResourcesController extends BaseController {
|
||||
@ApiImplicitParam(name = "skipLineNum", value = "SKIP_LINE_NUM", 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)
|
||||
@AccessLogAnnotation(ignoreRequestArgs = "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 = "limit") int limit
|
||||
) {
|
||||
@ -414,11 +417,11 @@ public class ResourcesController extends BaseController {
|
||||
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100"),
|
||||
@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)
|
||||
@AccessLogAnnotation(ignoreRequestArgs = "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
|
||||
) {
|
||||
if (StringUtils.isEmpty(content)) {
|
||||
@ -439,12 +442,12 @@ public class ResourcesController extends BaseController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100")
|
||||
})
|
||||
@GetMapping(value = "/download")
|
||||
@GetMapping(value = "/{id}/download")
|
||||
@ResponseBody
|
||||
@ApiException(DOWNLOAD_RESOURCE_FILE_ERROR)
|
||||
@AccessLogAnnotation(ignoreRequestArgs = "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);
|
||||
if (file == null) {
|
||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(Status.RESOURCE_NOT_EXIST.getMsg());
|
||||
@ -480,7 +483,7 @@ public class ResourcesController extends BaseController {
|
||||
@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)
|
||||
@ApiException(CREATE_UDF_FUNCTION_ERROR)
|
||||
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
|
||||
@ -491,7 +494,7 @@ public class ResourcesController extends BaseController {
|
||||
@RequestParam(value = "argTypes", required = false) String argTypes,
|
||||
@RequestParam(value = "database", required = false) String database,
|
||||
@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);
|
||||
}
|
||||
|
||||
@ -507,12 +510,12 @@ public class ResourcesController extends BaseController {
|
||||
@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)
|
||||
@ApiException(VIEW_UDF_FUNCTION_ERROR)
|
||||
@AccessLogAnnotation(ignoreRequestArgs = "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);
|
||||
return returnDataList(map);
|
||||
}
|
||||
@ -543,18 +546,18 @@ public class ResourcesController extends BaseController {
|
||||
@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)
|
||||
@AccessLogAnnotation(ignoreRequestArgs = "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 = "funcName") String funcName,
|
||||
@RequestParam(value = "className") String className,
|
||||
@RequestParam(value = "argTypes", required = false) String argTypes,
|
||||
@RequestParam(value = "database", required = false) String database,
|
||||
@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);
|
||||
return returnDataList(result);
|
||||
}
|
||||
@ -574,7 +577,7 @@ public class ResourcesController extends BaseController {
|
||||
@ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataType = "Int", example = "1"),
|
||||
@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)
|
||||
@ApiException(QUERY_UDF_FUNCTION_LIST_PAGING_ERROR)
|
||||
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
|
||||
@ -645,14 +648,14 @@ public class ResourcesController extends BaseController {
|
||||
*/
|
||||
@ApiOperation(value = "deleteUdfFunc", notes = "DELETE_UDF_FUNCTION_NOTES")
|
||||
@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)
|
||||
@ApiException(DELETE_UDF_FUNCTION_ERROR)
|
||||
@AccessLogAnnotation
|
||||
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);
|
||||
}
|
||||
@ -690,7 +693,7 @@ public class ResourcesController extends BaseController {
|
||||
@ApiImplicitParams({
|
||||
@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)
|
||||
@ApiException(AUTHORIZE_RESOURCE_TREE)
|
||||
@AccessLogAnnotation
|
||||
|
@ -31,6 +31,8 @@ import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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.RequestAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@ -62,7 +64,7 @@ public class UiPluginController extends BaseController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "pluginType", value = "pluginType", required = true, dataType = "PluginType"),
|
||||
})
|
||||
@PostMapping(value = "/queryUiPluginsByType")
|
||||
@GetMapping(value = "/query-by-type")
|
||||
@ResponseStatus(HttpStatus.CREATED)
|
||||
@ApiException(QUERY_PLUGINS_ERROR)
|
||||
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
|
||||
@ -75,14 +77,14 @@ public class UiPluginController extends BaseController {
|
||||
|
||||
@ApiOperation(value = "queryUiPluginDetailById", notes = "QUERY_UI_PLUGIN_DETAIL_BY_ID")
|
||||
@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)
|
||||
@ApiException(QUERY_PLUGINS_ERROR)
|
||||
@AccessLogAnnotation(ignoreRequestArgs = "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);
|
||||
return returnDataList(result);
|
||||
|
@ -34,7 +34,9 @@ import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@ -53,7 +55,7 @@ import springfox.documentation.annotations.ApiIgnore;
|
||||
*/
|
||||
@Api(tags = "WORKER_GROUP_TAG")
|
||||
@RestController
|
||||
@RequestMapping("/worker-group")
|
||||
@RequestMapping("/worker-groups")
|
||||
public class WorkerGroupController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
@ -74,7 +76,7 @@ public class WorkerGroupController extends BaseController {
|
||||
@ApiImplicitParam(name = "name", value = "WORKER_GROUP_NAME", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "addrList", value = "WORKER_ADDR_LIST", required = true, dataType = "String")
|
||||
})
|
||||
@PostMapping(value = "/save")
|
||||
@PostMapping()
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
@ApiException(SAVE_ERROR)
|
||||
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
|
||||
@ -102,7 +104,7 @@ public class WorkerGroupController extends BaseController {
|
||||
@ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataType = "Int", example = "20"),
|
||||
@ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataType = "String")
|
||||
})
|
||||
@GetMapping(value = "/list-paging")
|
||||
@GetMapping()
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
@ApiException(QUERY_WORKER_GROUP_FAIL)
|
||||
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
|
||||
@ -128,7 +130,7 @@ public class WorkerGroupController extends BaseController {
|
||||
* @return all worker group list
|
||||
*/
|
||||
@ApiOperation(value = "queryAllWorkerGroups", notes = "QUERY_WORKER_GROUP_LIST_NOTES")
|
||||
@GetMapping(value = "/all-groups")
|
||||
@GetMapping(value = "/all")
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
@ApiException(QUERY_WORKER_GROUP_FAIL)
|
||||
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
|
||||
@ -148,12 +150,12 @@ public class WorkerGroupController extends BaseController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "WORKER_GROUP_ID", required = true, dataType = "Int", example = "10"),
|
||||
})
|
||||
@PostMapping(value = "/delete-by-id")
|
||||
@DeleteMapping(value = "/{id}")
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
@ApiException(DELETE_WORKER_GROUP_FAIL)
|
||||
@AccessLogAnnotation(ignoreRequestArgs = "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);
|
||||
return returnDataList(result);
|
||||
|
@ -446,7 +446,7 @@ export default {
|
||||
resolve()
|
||||
return
|
||||
}
|
||||
io.get('resources/list/jar', {
|
||||
io.get('resources/query-by-type', {
|
||||
type: 'FILE'
|
||||
}, res => {
|
||||
state.resourcesListJar = res.data
|
||||
@ -823,7 +823,7 @@ export default {
|
||||
},
|
||||
getResourceId ({ state }, payload) {
|
||||
return new Promise((resolve, reject) => {
|
||||
io.get('resources/queryResource', payload, res => {
|
||||
io.get(`resources/${payload.id}`, payload, res => {
|
||||
resolve(res.data)
|
||||
}).catch(e => {
|
||||
reject(e)
|
||||
@ -832,7 +832,7 @@ export default {
|
||||
},
|
||||
genTaskCodeList ({ state }, payload) {
|
||||
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)
|
||||
}).catch(e => {
|
||||
reject(e)
|
||||
|
@ -23,7 +23,7 @@ export default {
|
||||
*/
|
||||
getResourcesListP ({ state }, payload) {
|
||||
return new Promise((resolve, reject) => {
|
||||
io.get('resources/list-paging', payload, res => {
|
||||
io.get('resources', payload, res => {
|
||||
resolve(res.data)
|
||||
}).catch(e => {
|
||||
reject(e)
|
||||
@ -32,7 +32,7 @@ export default {
|
||||
},
|
||||
getResourceId ({ state }, payload) {
|
||||
return new Promise((resolve, reject) => {
|
||||
io.get('resources/queryResource', payload, res => {
|
||||
io.get(`resources/${payload.id}`, payload, res => {
|
||||
resolve(res.data)
|
||||
}).catch(e => {
|
||||
reject(e)
|
||||
@ -53,7 +53,7 @@ export default {
|
||||
*/
|
||||
deleteResource ({ state }, payload) {
|
||||
return new Promise((resolve, reject) => {
|
||||
io.get('resources/delete', payload, res => {
|
||||
io.delete(`resources/${payload.id}`, payload, res => {
|
||||
resolve(res)
|
||||
}).catch(e => {
|
||||
reject(e)
|
||||
@ -77,7 +77,7 @@ export default {
|
||||
*/
|
||||
getViewResources ({ state }, payload) {
|
||||
return new Promise((resolve, reject) => {
|
||||
io.get('resources/view', payload, res => {
|
||||
io.get(`resources/${payload.id}/view`, payload, res => {
|
||||
resolve(res)
|
||||
}).catch(e => {
|
||||
reject(e)
|
||||
@ -89,7 +89,7 @@ export default {
|
||||
*/
|
||||
createUdfFunc ({ state }, payload) {
|
||||
return new Promise((resolve, reject) => {
|
||||
io.post('resources/udf-func/create', payload, res => {
|
||||
io.post(`resources/${payload.resourceId}/udf-func`, payload, res => {
|
||||
resolve(res)
|
||||
}).catch(e => {
|
||||
reject(e)
|
||||
@ -101,7 +101,7 @@ export default {
|
||||
*/
|
||||
updateUdfFunc ({ state }, payload) {
|
||||
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)
|
||||
}).catch(e => {
|
||||
reject(e)
|
||||
@ -126,7 +126,7 @@ export default {
|
||||
*/
|
||||
deleteUdf ({ state }, payload) {
|
||||
return new Promise((resolve, reject) => {
|
||||
io.get('resources/udf-func/delete', payload, res => {
|
||||
io.delete(`resources/udf-func/${payload.id}`, payload, res => {
|
||||
resolve(res)
|
||||
}).catch(e => {
|
||||
reject(e)
|
||||
@ -138,7 +138,7 @@ export default {
|
||||
*/
|
||||
getUdfFuncListP ({ state }, payload) {
|
||||
return new Promise((resolve, reject) => {
|
||||
io.get('resources/udf-func/list-paging', payload, res => {
|
||||
io.get('resources/udf-func', payload, res => {
|
||||
resolve(res.data)
|
||||
}).catch(e => {
|
||||
reject(e)
|
||||
@ -150,7 +150,7 @@ export default {
|
||||
*/
|
||||
updateContent ({ state }, payload) {
|
||||
return new Promise((resolve, reject) => {
|
||||
io.post('resources/update-content', payload, res => {
|
||||
io.post(`resources/${payload.id}/update-content`, payload, res => {
|
||||
resolve(res)
|
||||
}).catch(e => {
|
||||
reject(e)
|
||||
@ -174,7 +174,7 @@ export default {
|
||||
*/
|
||||
createResourceFolder ({ state }, payload) {
|
||||
return new Promise((resolve, reject) => {
|
||||
io.post('resources/directory/create', payload, res => {
|
||||
io.post('resources/directory', payload, res => {
|
||||
resolve(res)
|
||||
}).catch(e => {
|
||||
reject(e)
|
||||
@ -186,7 +186,7 @@ export default {
|
||||
*/
|
||||
resourceRename ({ state }, payload) {
|
||||
return new Promise((resolve, reject) => {
|
||||
io.post('resources/update', payload, res => {
|
||||
io.put(`resources/${payload.id}`, payload, res => {
|
||||
resolve(res)
|
||||
}).catch(e => {
|
||||
reject(e)
|
||||
|
@ -374,7 +374,7 @@ export default {
|
||||
*/
|
||||
getPlugins ({ state }, payload) {
|
||||
return new Promise((resolve, reject) => {
|
||||
io.post('ui-plugins/queryUiPluginsByType', payload, res => {
|
||||
io.get('ui-plugins/query-by-type', payload, res => {
|
||||
resolve(res.data)
|
||||
}).catch(e => {
|
||||
reject(e)
|
||||
@ -386,7 +386,7 @@ export default {
|
||||
*/
|
||||
getUiPluginById ({ state }, payload) {
|
||||
return new Promise((resolve, reject) => {
|
||||
io.post('ui-plugins/queryUiPluginDetailById', payload, res => {
|
||||
io.get(`ui-plugins/${payload.pluginId}`, payload, res => {
|
||||
resolve(res.data)
|
||||
}).catch(e => {
|
||||
reject(e)
|
||||
@ -566,7 +566,7 @@ export default {
|
||||
*/
|
||||
getWorkerGroups ({ state }, payload) {
|
||||
return new Promise((resolve, reject) => {
|
||||
io.get('worker-group/list-paging', payload, res => {
|
||||
io.get('worker-groups', payload, res => {
|
||||
resolve(res.data)
|
||||
}).catch(e => {
|
||||
reject(e)
|
||||
@ -578,7 +578,7 @@ export default {
|
||||
*/
|
||||
getWorkerGroupsAll ({ state }, payload) {
|
||||
return new Promise((resolve, reject) => {
|
||||
io.get('worker-group/all-groups', payload, res => {
|
||||
io.get('worker-groups/all', payload, res => {
|
||||
let list = res.data
|
||||
if (list.length > 0) {
|
||||
list = list.map(item => {
|
||||
@ -615,7 +615,7 @@ export default {
|
||||
},
|
||||
saveWorkerGroups ({ state }, payload) {
|
||||
return new Promise((resolve, reject) => {
|
||||
io.post('worker-group/save', payload, res => {
|
||||
io.post('worker-groups', payload, res => {
|
||||
resolve(res)
|
||||
}).catch(e => {
|
||||
reject(e)
|
||||
@ -624,7 +624,7 @@ export default {
|
||||
},
|
||||
deleteWorkerGroups ({ state }, payload) {
|
||||
return new Promise((resolve, reject) => {
|
||||
io.post('worker-group/delete-by-id', payload, res => {
|
||||
io.delete(`worker-groups/${payload.id}`, payload, res => {
|
||||
resolve(res)
|
||||
}).catch(e => {
|
||||
reject(e)
|
||||
@ -633,7 +633,7 @@ export default {
|
||||
},
|
||||
getWorkerAddresses ({ state }, payload) {
|
||||
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)
|
||||
}).catch(e => {
|
||||
reject(e)
|
||||
|
Loading…
Reference in New Issue
Block a user