|
|
|
@ -27,6 +27,7 @@ import org.apache.dolphinscheduler.api.service.ResourcesService;
|
|
|
|
|
import org.apache.dolphinscheduler.api.service.UdfFuncService; |
|
|
|
|
import org.apache.dolphinscheduler.api.utils.Result; |
|
|
|
|
import org.apache.dolphinscheduler.common.Constants; |
|
|
|
|
import org.apache.dolphinscheduler.common.enums.ProgramType; |
|
|
|
|
import org.apache.dolphinscheduler.common.enums.ResourceType; |
|
|
|
|
import org.apache.dolphinscheduler.common.enums.UdfType; |
|
|
|
|
import org.apache.dolphinscheduler.common.utils.ParameterUtils; |
|
|
|
@ -275,7 +276,7 @@ public class ResourcesController extends BaseController {
|
|
|
|
|
* @param type resource type |
|
|
|
|
* @return resource list |
|
|
|
|
*/ |
|
|
|
|
@ApiOperation(value = "queryResourceJarList", notes = "QUERY_RESOURCE_LIST_NOTES") |
|
|
|
|
@ApiOperation(value = "queryResourceByProgramType", notes = "QUERY_RESOURCE_LIST_NOTES") |
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType = "ResourceType") |
|
|
|
|
}) |
|
|
|
@ -283,10 +284,14 @@ public class ResourcesController extends BaseController {
|
|
|
|
|
@ResponseStatus(HttpStatus.OK) |
|
|
|
|
@ApiException(QUERY_RESOURCES_LIST_ERROR) |
|
|
|
|
public Result queryResourceJarList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, |
|
|
|
|
@RequestParam(value = "type") ResourceType type |
|
|
|
|
@RequestParam(value = "type") ResourceType type, |
|
|
|
|
@RequestParam(value = "programType",required = false) ProgramType programType |
|
|
|
|
) { |
|
|
|
|
logger.info("query resource list, login user:{}, resource type:{}", loginUser.getUserName(), type.toString()); |
|
|
|
|
Map<String, Object> result = resourceService.queryResourceJarList(loginUser, type); |
|
|
|
|
String programTypeName = programType == null ? "" : programType.name(); |
|
|
|
|
String userName = loginUser.getUserName(); |
|
|
|
|
userName = userName.replaceAll("[\n|\r|\t]", "_"); |
|
|
|
|
logger.info("query resource list, login user:{}, resource type:{}, program type:{}", userName,programTypeName); |
|
|
|
|
Map<String, Object> result = resourceService.queryResourceByProgramType(loginUser, type,programType); |
|
|
|
|
return returnDataList(result); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|