Browse Source

Remove unused parameter in function genTaskCodeList (#6395)

2.0.7-release
Jiajie Zhong 3 years ago committed by GitHub
parent
commit
3e8fe68128
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java
  2. 4
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskDefinitionService.java
  3. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
  4. 5
      dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskDefinitionServiceImplTest.java

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskDefinitionController.java

@ -307,7 +307,7 @@ public class TaskDefinitionController extends BaseController {
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result genTaskCodeList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam("genNum") Integer genNum) {
Map<String, Object> result = taskDefinitionService.genTaskCodeList(loginUser, genNum);
Map<String, Object> result = taskDefinitionService.genTaskCodeList(genNum);
return returnDataList(result);
}
}

4
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/TaskDefinitionService.java

@ -151,11 +151,9 @@ public interface TaskDefinitionService {
/**
* gen task code list
*
* @param loginUser login user
* @param genNum gen num
* @return task code list
*/
Map<String, Object> genTaskCodeList(User loginUser,
Integer genNum);
Map<String, Object> genTaskCodeList(Integer genNum);
}

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java

@ -411,7 +411,7 @@ public class TaskDefinitionServiceImpl extends BaseServiceImpl implements TaskDe
}
@Override
public Map<String, Object> genTaskCodeList(User loginUser, Integer genNum) {
public Map<String, Object> genTaskCodeList(Integer genNum) {
Map<String, Object> result = new HashMap<>();
if (genNum == null || genNum < 1 || genNum > 100) {
logger.error("the genNum must be great than 1 and less than 100");

5
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/TaskDefinitionServiceImplTest.java

@ -270,10 +270,7 @@ public class TaskDefinitionServiceImplTest {
@Test
public void genTaskCodeList() {
User loginUser = new User();
loginUser.setId(-1);
loginUser.setUserType(UserType.GENERAL_USER);
Map<String, Object> genTaskCodeList = taskDefinitionService.genTaskCodeList(loginUser, 10);
Map<String, Object> genTaskCodeList = taskDefinitionService.genTaskCodeList(10);
Assert.assertEquals(Status.SUCCESS, genTaskCodeList.get(Constants.STATUS));
}
}
Loading…
Cancel
Save