/***/
@RequestMapping("/listByRoleId")
public CommonResult<List<MenuVo.ListByRoleIdVo>> listByRoleId(@Valid MenuParam.ListByRoleIdParam param){
return menuService.listByRoleId(param);
}
@Data
public static class ListByRoleIdParam {
@NotNull(message = "")
private Integer roleId;
}
@Data
public static class ListByRoleIdVo {
private Integer menuId;
private String name; //
private Integer pid; //id
}
I now use the above form to write code in my project. The parameters of each method are defined as a class. The return value of the method is also defined as a class.
the main reason for writing this is to use valid for parameter verification, and encapsulating the parameters into an object is also convenient to use reflection to call the method.
this will lead to a lot of classes with such parameters and return values in the project.
I would like to ask that this writing gives more points about the definition of the class. what else is wrong with it? Will it affect performance?