ruanwenjun commented on code in PR #15181:
URL:
https://github.com/apache/dolphinscheduler/pull/15181#discussion_r1398309631
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/AccessTokenController.java:
##########
@@ -154,10 +155,10 @@ public Result queryAccessTokenList(@Parameter(hidden =
true) @RequestAttribute(v
@GetMapping(value = "/user/{userId}")
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_ACCESSTOKEN_BY_USER_ERROR)
- public Result queryAccessTokenByUser(@Parameter(hidden = true)
@RequestAttribute(value = Constants.SESSION_USER) User loginUser,
- @PathVariable("userId") Integer
userId) {
- Map<String, Object> result =
this.accessTokenService.queryAccessTokenByUser(loginUser, userId);
- return this.returnDataList(result);
+ public Result<List<AccessToken>> queryAccessTokenByUser(@Parameter(hidden
= true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
+
@PathVariable("userId") Integer userId) {
+ List<AccessToken> accessTokens =
accessTokenService.queryAccessTokenByUser(loginUser, userId);
+ return Result.success(accessTokens);
Review Comment:
We have `ApiExceptionHandler` to transform the ServiceException to standard
Result.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]