You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@streampark.apache.org by GitBox <gi...@apache.org> on 2022/10/21 17:13:49 UTC

[GitHub] [incubator-streampark] 1996fanrui opened a new pull request, #1883: [Feature] Reduce unnecessary database join

1996fanrui opened a new pull request, #1883:
URL: https://github.com/apache/incubator-streampark/pull/1883

   ## What changes were proposed in this pull request
   
   Issue Number: close #1882 
   
   Reduce unnecessary database join
   
   ## Brief change log
   
   Reduce unnecessary database join
   
   ## Verifying this change
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   ## Does this pull request potentially affect one of the following parts
    - Dependencies (does it add or upgrade a dependency): no
   


-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] 1996fanrui commented on a diff in pull request #1883: [Feature] Remove unnecessary findUserRole

Posted by GitBox <gi...@apache.org>.
1996fanrui commented on code in PR #1883:
URL: https://github.com/apache/incubator-streampark/pull/1883#discussion_r1002497379


##########
streampark-console/streampark-console-service/src/main/resources/mapper/system/RoleMapper.xml:
##########
@@ -32,8 +32,7 @@
         select r.*
         from t_role r
         left join t_member m on r.role_id = m.role_id
-        left join t_user u on u.user_id = m.user_id
-        where u.user_id = #{userId}
+        where m.user_id = #{userId}

Review Comment:
   @wolfboys  Thanks for your clarification, updated.



-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] wolfboys commented on a diff in pull request #1883: [Feature] Reduce unnecessary database join

Posted by GitBox <gi...@apache.org>.
wolfboys commented on code in PR #1883:
URL: https://github.com/apache/incubator-streampark/pull/1883#discussion_r1002295252


##########
streampark-console/streampark-console-service/src/main/resources/mapper/system/RoleMapper.xml:
##########
@@ -32,8 +32,7 @@
         select r.*
         from t_role r
         left join t_member m on r.role_id = m.role_id
-        left join t_user u on u.user_id = m.user_id
-        where u.user_id = #{userId}
+        where m.user_id = #{userId}

Review Comment:
   query condition `team_id` is missing, please check.



-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] wolfboys commented on a diff in pull request #1883: [Feature] Remove unnecessary findUserRole

Posted by GitBox <gi...@apache.org>.
wolfboys commented on code in PR #1883:
URL: https://github.com/apache/incubator-streampark/pull/1883#discussion_r1002497900


##########
streampark-console/streampark-console-service/src/main/resources/mapper/system/RoleMapper.xml:
##########
@@ -32,8 +32,7 @@
         select r.*
         from t_role r
         left join t_member m on r.role_id = m.role_id
-        left join t_user u on u.user_id = m.user_id
-        where u.user_id = #{userId}
+        where m.user_id = #{userId}

Review Comment:
   > @wolfboys Thanks for your clarification, updated.
   
   👌I'll review it later



-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] wolfboys commented on a diff in pull request #1883: [Feature] Reduce unnecessary database join

Posted by GitBox <gi...@apache.org>.
wolfboys commented on code in PR #1883:
URL: https://github.com/apache/incubator-streampark/pull/1883#discussion_r1002456748


##########
streampark-console/streampark-console-service/src/main/resources/mapper/system/RoleMapper.xml:
##########
@@ -32,8 +32,7 @@
         select r.*
         from t_role r
         left join t_member m on r.role_id = m.role_id
-        left join t_user u on u.user_id = m.user_id
-        where u.user_id = #{userId}
+        where m.user_id = #{userId}

Review Comment:
   > After check, I don't know why need to call `findUserRole`?
   > 
   > There are two places in the code where roles are used, but I don't know why?
   > 
   > 1. `ShiroRealm.doGetAuthorizationInfo` -> `simpleAuthorizationInfo.setRoles(roleSet)`
   > 2. `UserServiceImpl.generateFrontendUserInfo` -> `userInfo.put("roles", roles);`
   > 
   > Do you know why need roles here? As I understand, front-end just needs the `permissions` and `routers`.
   
   hi 1996fanrui:
   
   Currently, the `roles` is not actually used,  The front-end has a role-related instruction: `hasRole`, which is used for permission control, but it is not currently used.  Shouldn't use it in the future, so, The method and called references can be deleted. 



-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] 1996fanrui commented on a diff in pull request #1883: [Feature] Reduce unnecessary database join

Posted by GitBox <gi...@apache.org>.
1996fanrui commented on code in PR #1883:
URL: https://github.com/apache/incubator-streampark/pull/1883#discussion_r1002444475


##########
streampark-console/streampark-console-service/src/main/resources/mapper/system/RoleMapper.xml:
##########
@@ -32,8 +32,7 @@
         select r.*
         from t_role r
         left join t_member m on r.role_id = m.role_id
-        left join t_user u on u.user_id = m.user_id
-        where u.user_id = #{userId}
+        where m.user_id = #{userId}

Review Comment:
   After check, I don't know why need to call `findUserRole`?
   
   There are two places in the code where roles are used, but I don't know why?
   
   1. `ShiroRealm.doGetAuthorizationInfo` -> `simpleAuthorizationInfo.setRoles(roleSet)`
   2. `UserServiceImpl.generateFrontendUserInfo` -> `userInfo.put("roles", roles);` 
   
   Do you know why need roles here? As I understand, front-end just needs the `permissions` and `routers`.



-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] wolfboys merged pull request #1883: [Feature] Remove unnecessary findUserRole

Posted by GitBox <gi...@apache.org>.
wolfboys merged PR #1883:
URL: https://github.com/apache/incubator-streampark/pull/1883


-- 
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: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org