io.robe.admin.resources.MenuResource Maven / Gradle / Ivy
The newest version!
package io.robe.admin.resources;
import com.google.common.base.Optional;
import io.dropwizard.hibernate.UnitOfWork;
import io.dropwizard.jersey.PATCH;
import io.dropwizard.jersey.caching.CacheControl;
import io.robe.admin.dto.MenuItem;
import io.robe.admin.hibernate.dao.*;
import io.robe.admin.hibernate.entity.*;
import io.robe.auth.Credentials;
import io.robe.auth.RobeAuth;
import io.robe.common.service.RobeService;
import io.robe.common.service.search.SearchParam;
import io.robe.common.service.search.model.SearchModel;
import io.robe.common.utils.FieldReflection;
import org.hibernate.FlushMode;
import javax.inject.Inject;
import javax.validation.Valid;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.*;
import static org.hibernate.CacheMode.GET;
@Path("menus")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public class MenuResource {
@Inject
private MenuDao menuDao;
@Inject
private RoleDao roleDao;
@Inject
private PermissionDao permissionDao;
@Inject
private RoleGroupDao roleGroupDao;
@Inject
private UserDao userDao;
/**
* Returns all {@link Menu}s as a collection.
*
* @param credentials injected by {@link RobeAuth} annotation for authentication.
* @return all {@link Menu}s as a collection with.
*/
@RobeService(group = "Menu", description = "Returns all Menu's as a collection.")
@GET
@UnitOfWork(readOnly = true, cacheMode = GET, flushMode = FlushMode.MANUAL)
public List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy