zixi0825 commented on a change in pull request #2884:
URL: 
https://github.com/apache/incubator-dolphinscheduler/pull/2884#discussion_r444612172



##########
File path: 
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProjectController.java
##########
@@ -226,6 +227,23 @@ public Result queryAuthorizedProject(@ApiIgnore 
@RequestAttribute(value = Consta
         return returnDataList(result);
     }
 
+    /**
+     * query user created project
+     *
+     * @param loginUser login user
+     * @return projects which the user create
+     */
+    @ApiOperation(value = "queryProjectCreatedByUser", notes = 
"QUERY_USER_CREATED_PROJECT_NOTES")
+
+    @GetMapping(value = "/login-user-created-project")
+    @ResponseStatus(HttpStatus.OK)
+    @ApiException(QUERY_USER_CREATED_PROJECT_ERROR)
+    public Result queryProjectCreatedByUser(@ApiIgnore @RequestAttribute(value 
= Constants.SESSION_USER) User loginUser) {
+        logger.info("login user {}, query authorized project by user id: {}.", 
StringUtils.replaceNRTtoUnderline(loginUser.getUserName()), 
StringUtils.replaceNRTtoUnderline(String.valueOf(loginUser.getId())));
+        Map<String, Object> result = 
projectService.queryProjectCreatedByUser(loginUser, loginUser.getId());

Review comment:
       The purpose of this function design is to get the project created by the 
logged-in user, so I think there is no problem using userid
   
   ————————————————————————————————————————————————————
   
   这个函数设计的目的就是获取登录用户所创建的项目,所以我认为使用userid没有问题




----------------------------------------------------------------
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]


Reply via email to