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") @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result genTaskCodeList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser, public Result genTaskCodeList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam("genNum") Integer genNum) { @RequestParam("genNum") Integer genNum) {
Map<String, Object> result = taskDefinitionService.genTaskCodeList(loginUser, genNum); Map<String, Object> result = taskDefinitionService.genTaskCodeList(genNum);
return returnDataList(result); 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 * gen task code list
* *
* @param loginUser login user
* @param genNum gen num * @param genNum gen num
* @return task code list * @return task code list
*/ */
Map<String, Object> genTaskCodeList(User loginUser, Map<String, Object> genTaskCodeList(Integer genNum);
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 @Override
public Map<String, Object> genTaskCodeList(User loginUser, Integer genNum) { public Map<String, Object> genTaskCodeList(Integer genNum) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
if (genNum == null || genNum < 1 || genNum > 100) { if (genNum == null || genNum < 1 || genNum > 100) {
logger.error("the genNum must be great than 1 and less than 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 @Test
public void genTaskCodeList() { public void genTaskCodeList() {
User loginUser = new User(); Map<String, Object> genTaskCodeList = taskDefinitionService.genTaskCodeList(10);
loginUser.setId(-1);
loginUser.setUserType(UserType.GENERAL_USER);
Map<String, Object> genTaskCodeList = taskDefinitionService.genTaskCodeList(loginUser, 10);
Assert.assertEquals(Status.SUCCESS, genTaskCodeList.get(Constants.STATUS)); Assert.assertEquals(Status.SUCCESS, genTaskCodeList.get(Constants.STATUS));
} }
} }
Loading…
Cancel
Save