Skip to content
Snippets Groups Projects

feat: two types for comments and adapted permission service

Merged Alicia.DeDiosFuente requested to merge adf-250-comments-for-validator-only into master
All threads resolved!
Files
52
package ch.unige.aou.controller.admin;
import java.util.List;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import ch.unige.solidify.rest.ActionName;
import ch.unige.solidify.security.UserPermissions;
import ch.unige.solidify.controller.ResourceController;
import ch.unige.solidify.security.RootPermissions;
import ch.unige.aou.controller.AdminController;
import ch.unige.aou.model.rest.UnigePersonDTO;
import ch.unige.aou.model.publication.Contributor;
import ch.unige.aou.rest.UrlPath;
import ch.unige.aou.service.rest.UnigePersonSearch;
@UserPermissions
@RootPermissions
@RestController
@ConditionalOnBean(AdminController.class)
@RequestMapping(UrlPath.ADMIN_CONTRIBUTORS)
public class ContributorsController {
UnigePersonSearch unigePersonSearch;
public ContributorsController(UnigePersonSearch unigePersonSearch) {
this.unigePersonSearch = unigePersonSearch;
}
public class ContributorsController extends ResourceController<Contributor> {
@GetMapping(ActionName.SEARCH)
public HttpEntity<List<UnigePersonDTO>> search(
@RequestParam(value = "firstname", required = false) String firstname,
@RequestParam(value = "lastname") String lastname) {
List<UnigePersonDTO> people = this.unigePersonSearch.search(firstname, lastname);
return new ResponseEntity<>(people, HttpStatus.OK);
}
}
Loading