CalvinKirs commented on a change in pull request #5422:
URL: https://github.com/apache/dolphinscheduler/pull/5422#discussion_r628315720
##########
File path:
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java
##########
@@ -74,20 +72,18 @@
@PostMapping(value = "/create")
@ResponseStatus(HttpStatus.CREATED)
@ApiException(CREATE_ACCESS_TOKEN_ERROR)
- @AccessLogAnnotation(ignoreRequestArgs = "loginUser")
- public Result createToken(@ApiIgnore @RequestAttribute(value =
Constants.SESSION_USER) User loginUser,
- @RequestParam(value = "userId") int userId,
+ @AccessLogAnnotation()
+ public Result createToken(@RequestParam(value = "userId") int userId,
@RequestParam(value = "expireTime") String
expireTime,
@RequestParam(value = "token") String token) {
- Map<String, Object> result = accessTokenService.createToken(loginUser,
userId, expireTime, token);
+ Map<String, Object> result =
accessTokenService.createToken(AuthUtils.getLoginUser(), userId, expireTime,
token);
Review comment:
> and we do not need to pass user info to every service method. we can
remove all service method user info parameters, and get user info on need.
These should be two different things. If the service really needs it, the
Controller can display the declaration (not all Controllers need this
parameter), and then pass it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]