systems.dennis.shared.mongo.controller.ParentalController Maven / Gradle / Ivy
The newest version!
package systems.dennis.shared.mongo.controller;
import org.springframework.data.domain.Page;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import systems.dennis.shared.annotations.security.Secured;
import systems.dennis.shared.annotations.security.WithRole;
import systems.dennis.shared.controller.items.AbstractParentalController;
import systems.dennis.shared.form.CountResponse;
import systems.dennis.shared.mongo.form.DefaultForm;
import systems.dennis.shared.mongo.service.StringIdEntity;
import java.util.Map;
@Secured
public interface ParentalController extends AbstractParentalController {
@GetMapping("/tree/count/parent/{id}")
@ResponseBody
@WithRole
@Override
default ResponseEntity countByParent(@PathVariable("id") String id) {
return AbstractParentalController.super.countByParent(id);
}
@GetMapping("/tree/parent/{id}")
@ResponseBody
@WithRole
@Override
default ResponseEntity>> findByParent(@PathVariable ("id") String id,
@RequestParam(value = "limit", required = false) Integer limit,
@RequestParam(value = "page", required = false) Integer page) {
return AbstractParentalController.super.findByParent(id, limit, page);
}
@GetMapping("/tree/root")
@ResponseBody
@WithRole
@Override
default ResponseEntity>> findRootElements(@RequestParam(value = "limit", required = false) Integer limit,
@RequestParam(value = "page", required = false) Integer page) {
return AbstractParentalController.super.findRootElements(limit, page);
}
}