Exemplo n.º 1
0
 @GET
 @Path("/{autoId}")
 @Produces(MediaType.APPLICATION_JSON)
 public Response getMenu(@PathParam("autoId") Long autoId) {
   // TODO Auto-generated method stub
   return Response.ok().entity(service.getMenu(autoId)).build();
 }
Exemplo n.º 2
0
 @Path("/tree")
 @GET
 @Produces(MediaType.APPLICATION_JSON)
 public Response getAllMenu() {
   // TODO Auto-generated method stub
   return Response.ok().entity(service.getAllMenuTree()).build();
 }
Exemplo n.º 3
0
 @PUT
 @Path("/{autoId}")
 @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
 @Produces(MediaType.APPLICATION_JSON)
 public Response updateMenu(
     @PathParam("autoId") Long autoId,
     @FormParam("type") String type,
     @FormParam("name") String name,
     @FormParam("descpt") String descpt,
     @FormParam("path") String path,
     @FormParam("icon") String icon,
     @FormParam("order") Integer order,
     @FormParam("enable") Boolean enable,
     @FormParam("parentId") Long parentId,
     @FormParam("roleKey") String roleKey,
     @FormParam("assign") Boolean assign,
     @FormParam("isShow") Boolean isShow) {
   // TODO Auto-generated method stub
   AssertNull.assertNull(type, name, order, enable, parentId);
   if (type.equals("menu") || type.equals("sub")) {
     AssertNull.assertNull(roleKey);
   }
   String userSys = getUserSys();
   String username = getUsername();
   Menu menu =
       service.updateMenu(
           autoId, type, name, descpt, path, icon, order, enable, parentId, roleKey, assign,
           isShow, username, userSys);
   return Response.ok().entity(menu).build();
 }
Exemplo n.º 4
0
 @DELETE
 @Path("/{autoId}")
 @Produces(MediaType.APPLICATION_JSON)
 public Response deleteMenu(@PathParam("autoId") Long autoId) {
   // TODO Auto-generated method stub
   service.deleteMenu(autoId);
   return Response.ok().build();
 }
Exemplo n.º 5
0
 @GET
 @Produces(MediaType.APPLICATION_JSON)
 public Response getList(@QueryParam("parentId") Long parentId) {
   // TODO Auto-generated method stub
   return Response.ok().entity(service.getList(parentId)).build();
 }