wolfboys commented on PR #3481:
URL: 
https://github.com/apache/incubator-streampark/pull/3481#issuecomment-1890415421

   hi @zzzk1 
   Thanks very much for your hard work and contribution, In the controller 
layer, we cannot change the previous form of using beans to receive parameters 
to the current form. e.g:
   
   ```
    @Operation(summary = "Force stop application")
     @PermissionAction(id = "#app.id", type = PermissionType.APP)
     @PostMapping("forcedStop")
     @RequiresPermissions("app:cancel")
     public RestResponse forcedStop(Application app) {
       applicationService.forcedStop(app);
       return RestResponse.success();
     }
   
   ```
   
   ```
     @Operation(summary = "Delete member")
     @PermissionAction(id = "#member.teamId", type = PermissionType.TEAM)
     @DeleteMapping("delete")
     @RequiresPermissions("member:delete")
     public RestResponse delete(Member member) {
       this.memberService.deleteMember(member);
       return RestResponse.success();
     }
   
   ```
   
   PermissionAction is an annotation used to verify user permissions, This 
annotation, in conjunction with 
[StreamParkAspect](https://github.com/apache/incubator-streampark/blob/0f1f74ec96f1e2f8ee344fe02109623a66ee4ccd/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/aspect/ConsoleAspect.java#L105),
 obtains the required parameters, such as appid and teamid, before the 
execution of the controller method, and performs logical judgment and 
interception in the aspect.
   
   Therefore, the controller layer still needs to use beans to receive 
parameters from the frontend and cannot be change like this PR, But when the 
controller layer calls a method in the service layer, we can pass specific 
parameters(e.g: Long id) instead of a bean. I think this part can be improved. 
I'd love to hear your further thoughts on this. 😊
   
   
   
   


-- 
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-unsubscr...@streampark.apache.org

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

Reply via email to