Commit 0d8e8f67 authored by Maxym Borodenko's avatar Maxym Borodenko
Browse files

Minor improvement of generated OpenAPI documentation

parent ac0991b4
......@@ -65,7 +65,7 @@ public abstract class ActionController<T extends AbstractAction<T>, F extends Ac
}
@PostMapping(value = "/action/schedule", produces = { MediaType.APPLICATION_JSON_VALUE })
@Operation(operationId = "startActions", description = "Start entity actions", summary = "Start actions")
@Operation(operationId = "scheduleActions", description = "Start entity actions", summary = "Start actions")
public List<T> scheduleActions(@RequestBody @Valid final R request) {
return actionService.scheduleAction(request);
}
......
......@@ -136,7 +136,7 @@ public class AccessionController extends FilteredCRUDController<Accession, Acces
* @return the accession details
*/
@GetMapping(value = "/details/{id}", produces = { MediaType.APPLICATION_JSON_VALUE })
@Operation(operationId = "getDetails", description = "Retrieve accession details by ID", summary = "Details")
@Operation(operationId = "getAccessionDetails", description = "Retrieve accession details by ID", summary = "Details")
public AccessionService.AccessionDetails details(@PathVariable("id") final long id) {
return crudService.getAccessionDetails(crudService.get(id));
}
......
......@@ -55,7 +55,7 @@ public class AdminAlertsController extends ApiBaseController {
}
@DeleteMapping(value = "/{uuid}", produces = { MediaType.APPLICATION_JSON_VALUE })
@Operation(description = "Remove alert", summary = "Remove")
@Operation(operationId = "deleteAdminAlert", description = "Remove alert", summary = "Remove")
public TransientMessageService.TransientMessage delete(@PathVariable("uuid") final UUID alertUuid) {
return transientMessageService.removeAdminAlert(alertUuid);
}
......
......@@ -92,7 +92,7 @@ public class AppResourceController extends FilteredCRUDController<AppResource, A
}
@Override
@Operation(operationId = "create", description = "Create a record", summary = "Add")
@Operation(operationId = "createAppResource", description = "Create a record", summary = "Add")
public AppResource create(@RequestBody AppResource entity) {
if (entity.getSysLang() == null) {
entity.setSysLang(languageService.getLanguage(LocaleContextHolder.getLocale()));
......@@ -102,7 +102,7 @@ public class AppResourceController extends FilteredCRUDController<AppResource, A
}
@Override
@Operation(operationId = "update", description = "Update an existing record", summary = "Update")
@Operation(operationId = "updateAppResource", description = "Update an existing record", summary = "Update")
public AppResource update(@RequestBody AppResource entity) {
return super.update(entity);
}
......
......@@ -52,7 +52,7 @@ public class CodeValuesController extends ApiBaseController {
private LanguageService languageService;
@GetMapping(value = "/{id}", produces = { MediaType.APPLICATION_JSON_VALUE })
@Operation(description = "Get translated CodeValue by ID", summary = "Get CodeValue")
@Operation(operationId = "getTranslatedCodeValue", description = "Get translated CodeValue by ID", summary = "Get CodeValue")
public CodeValueService.TranslatedCodeValue getTranslated(@PathVariable("id") final long id) {
return cvService.getTranslated(id);
}
......@@ -70,7 +70,7 @@ public class CodeValuesController extends ApiBaseController {
* @return the updated record
*/
@PutMapping(value = "", produces = { MediaType.APPLICATION_JSON_VALUE })
@Operation(operationId = "update", description = "Update an existing CodeValue record", summary = "Update")
@Operation(operationId = "updateCodeValue", description = "Update an existing CodeValue record", summary = "Update")
public CodeValue update(@RequestBody final CodeValue input) {
return cvService.update(input);
}
......@@ -88,7 +88,7 @@ public class CodeValuesController extends ApiBaseController {
}
@GetMapping(value = "/{cvId}/langs", produces = { MediaType.APPLICATION_JSON_VALUE })
@Operation(description = "Get all CodeValueLang by ID", summary = "List of CodeValueLang")
@Operation(operationId = "listCodeValueLang", description = "Get all CodeValueLang by ID", summary = "List of CodeValueLang")
public List<CodeValueLang> getLangs(@PathVariable("cvId") final long codeValueId) {
return cvService.getLangs(codeValueId);
}
......
......@@ -113,7 +113,7 @@ public class CropController extends FilteredCRUDController<Crop, CropService, Cr
@PreAuthorize("hasAuthority('GROUP_ADMINS')")
@PostMapping(value = "/attach/{cropId}", produces = { MediaType.APPLICATION_JSON_VALUE })
@Operation(operationId = "uploadFile", description = "Attach crop file", summary = "Attach file")
@Operation(operationId = "uploadCropFile", description = "Attach crop file", summary = "Attach file")
public CropAttach uploadFile(@PathVariable(name = "cropId") final Long cropId, @RequestPart(name = "file") final MultipartFile file,
@RequestPart(name = "metadata") final CropAttachmentService.CropAttachmentRequest metadata) throws InvalidRepositoryPathException, InvalidRepositoryFileDataException, IOException {
......@@ -122,7 +122,7 @@ public class CropController extends FilteredCRUDController<Crop, CropService, Cr
@PreAuthorize("hasAuthority('GROUP_ADMINS')")
@DeleteMapping(value = "/attach/{cropId}/{attachmentId}", produces = { MediaType.APPLICATION_JSON_VALUE })
@Operation(operationId = "removeFile", description = "Remove attached file", summary = "Remove file")
@Operation(operationId = "removeCropAttach", description = "Remove attached file", summary = "Remove file")
public CropAttach removeFile(@PathVariable(name = "cropId") final Long cropId, @PathVariable(name = "attachmentId") final Long attachmentId) {
return cropAttachmentService.removeFile(crudService.get(cropId), attachmentId);
}
......
......@@ -218,7 +218,7 @@ public class CropTraitController extends ApiBaseController {
* @return the recorded record
*/
@PostMapping(value = "", produces = { MediaType.APPLICATION_JSON_VALUE })
@Operation(description = "Create a record of CropTrait and CropTraitLang", summary = "Add")
@Operation(operationId = "createTranslatedCropTrait", description = "Create a record of CropTrait and CropTraitLang", summary = "Add")
public CropTraitService.TranslatedCropTrait create(@RequestBody final CropTraitService.TranslatedCropTrait entity) {
return cropTraitService.create(entity);
}
......@@ -230,13 +230,13 @@ public class CropTraitController extends ApiBaseController {
* @return the updated record
*/
@PutMapping(value = "", produces = { MediaType.APPLICATION_JSON_VALUE })
@Operation(operationId = "update", description = "Update an existing record", summary = "Update")
@Operation(operationId = "updateCropTrait", description = "Update an existing record", summary = "Update")
public CropTrait update(@RequestBody final CropTrait entity) {
return cropTraitService.update(entity);
}
@PostMapping(value = "/attach/{cropTraitId}", produces = { MediaType.APPLICATION_JSON_VALUE })
@Operation(description = "Attach crop trait file", summary = "Attach file")
@Operation(operationId = "uploadCropTraitFile", description = "Attach crop trait file", summary = "Attach file")
public CropTraitAttach uploadFile(@PathVariable(name = "cropTraitId") final Long cropTraitId, @RequestPart(name = "file") final MultipartFile file,
@RequestPart(name = "metadata") final CropTraitAttachmentService.CropTraitAttachmentRequest metadata) throws InvalidRepositoryPathException, InvalidRepositoryFileDataException, IOException {
......@@ -244,13 +244,13 @@ public class CropTraitController extends ApiBaseController {
}
@DeleteMapping(value = "/attach/{cropTraitId}/{attachmentId}", produces = { MediaType.APPLICATION_JSON_VALUE })
@Operation(description = "Remove attached file", summary = "Remove file")
@Operation(operationId = "removeCropTraitFile", description = "Remove attached file", summary = "Remove file")
public CropTraitAttach removeFile(@PathVariable(name = "cropTraitId") final Long cropTraitId, @PathVariable(name = "attachmentId") final Long attachmentId) {
return cropTraitAttachmentService.removeFile(cropTraitService.get(cropTraitId), attachmentId);
}
@PostMapping(value = "/code/attach/{cropTraitCodeId}", produces = { MediaType.APPLICATION_JSON_VALUE })
@Operation(description = "Attach crop trait file", summary = "Attach file")
@Operation(operationId = "uploadCropTraitCodeFile", description = "Attach crop trait file", summary = "Attach file")
public CropTraitCodeAttach uploadTraitCodeFile(@PathVariable(name = "cropTraitCodeId") final Long cropTraitCodeId, @RequestPart(name = "file") final MultipartFile file,
@RequestPart(name = "metadata") final CropTraitCodeAttachmentService.CropTraitCodeAttachmentRequest metadata) throws InvalidRepositoryPathException, InvalidRepositoryFileDataException, IOException {
......@@ -258,7 +258,7 @@ public class CropTraitController extends ApiBaseController {
}
@DeleteMapping(value = "/code/attach/{cropTraitCodeId}/{attachmentId}", produces = { MediaType.APPLICATION_JSON_VALUE })
@Operation(description = "Remove attached file", summary = "Remove file")
@Operation(operationId = "removeCropTraitCodeFile", description = "Remove attached file", summary = "Remove file")
public CropTraitCodeAttach removeTraitCodeFile(@PathVariable(name = "cropTraitCodeId") final Long cropTraitCodeId, @PathVariable(name = "attachmentId") final Long attachmentId) {
return cropTraitCodeAttachmentService.removeFile(cropTraitService.getTraitCode(cropTraitCodeId), attachmentId);
}
......@@ -271,31 +271,6 @@ public class CropTraitController extends ApiBaseController {
public static class CropTraitAttachController extends CRUDController<CropTraitAttach, CropTraitAttachmentService> {
/** The Constant API_URL. */
public static final String API_URL = CropTraitController.API_URL + "/attach/meta";
@Override
@Operation(operationId = "createAccessionInvAttach", description = "Create CropTraitAttach", summary = "Create")
public CropTraitAttach create(@RequestBody CropTraitAttach entity) {
// Throws UnsupportedOperationException
return super.create(entity);
}
@Override
@Operation(operationId = "updateCropTraitAttach", description = "Update an existing record", summary = "Update")
public CropTraitAttach update(@RequestBody CropTraitAttach entity) {
return super.update(entity);
}
@Override
@Operation(operationId = "getCropTraitAttach", description = "Get record by ID", summary = "Get")
public CropTraitAttach get(@PathVariable long id) {
return super.get(id);
}
@Override
@Operation(operationId = "deleteCropTraitAttach", description = "Delete existing record by ID", summary = "Delete")
public CropTraitAttach remove(@PathVariable long id) {
return super.remove(id);
}
}
@RestController("cropTraitCodeAttachApi1")
......@@ -305,31 +280,6 @@ public class CropTraitController extends ApiBaseController {
public static class CropTraitCodeAttachController extends CRUDController<CropTraitCodeAttach, CropTraitCodeAttachmentService> {
/** The Constant API_URL. */
public static final String API_URL = CropTraitController.API_URL + "/code/attach/meta";
@Override
@Operation(operationId = "createAccessionInvAttach", description = "Create CropTraitCodeAttach", summary = "Create")
public CropTraitCodeAttach create(@RequestBody CropTraitCodeAttach entity) {
// Throws UnsupportedOperationException
return super.create(entity);
}
@Override
@Operation(operationId = "updateCropTraitAttach", description = "Update an existing record", summary = "Update")
public CropTraitCodeAttach update(@RequestBody CropTraitCodeAttach entity) {
return super.update(entity);
}
@Override
@Operation(operationId = "getCropTraitCodeAttach", description = "Get record by ID", summary = "Get")
public CropTraitCodeAttach get(@PathVariable long id) {
return super.get(id);
}
@Override
@Operation(operationId = "deleteCropTraitAttach", description = "Delete existing record by ID", summary = "Delete")
public CropTraitCodeAttach remove(@PathVariable long id) {
return super.remove(id);
}
}
}
......@@ -118,7 +118,7 @@ public class InventoryController extends FilteredCRUDController<Inventory, Inven
* @return the inventory details
*/
@GetMapping(value = "/details/{id}", produces = { MediaType.APPLICATION_JSON_VALUE })
@Operation(operationId = "getDetails", description = "Retrieve inventory details by ID", summary = "Details")
@Operation(operationId = "getInventoryDetails", description = "Retrieve inventory details by ID", summary = "Details")
public InventoryService.InventoryDetails details(@PathVariable("id") final long id) {
return crudService.getInventoryDetails(crudService.get(id));
}
......@@ -189,7 +189,7 @@ public class InventoryController extends FilteredCRUDController<Inventory, Inven
}
@PostMapping(value = "/attach/{inventoryId}", produces = { MediaType.APPLICATION_JSON_VALUE })
@Operation(operationId = "uploadFile", description = "Attach accession file", summary = "Attach file")
@Operation(operationId = "uploadAccessionFile", description = "Attach accession file", summary = "Attach file")
public AccessionInvAttach uploadFile(@PathVariable(name = "inventoryId") final Long inventoryId, @RequestPart(name = "file") final MultipartFile file,
@RequestPart(name = "metadata") final InventoryAttachmentService.InventoryAttachmentRequest metadata) throws InvalidRepositoryPathException, InvalidRepositoryFileDataException, IOException {
......@@ -197,7 +197,7 @@ public class InventoryController extends FilteredCRUDController<Inventory, Inven
}
@DeleteMapping(value = "/attach/{inventoryId}/{attachmentId}", produces = { MediaType.APPLICATION_JSON_VALUE })
@Operation(operationId = "removeFile", description = "Remove attached file", summary = "Remove file")
@Operation(operationId = "removeAccessionInvAttach", description = "Remove attached file", summary = "Remove file")
public AccessionInvAttach removeFile(@PathVariable(name = "inventoryId") final Long inventoryId, @PathVariable(name = "attachmentId") final Long attachmentId) {
return attachmentFileService.removeFile(crudService.get(inventoryId), attachmentId);
}
......
......@@ -106,7 +106,7 @@ public class InventoryGroupController extends FilteredCRUDController<AccessionIn
@PostMapping(value = "/{id}/add-inventory", produces = { MediaType.APPLICATION_JSON_VALUE })
@Operation(operationId = "addInventories", description = "Add inventories to the group")
public AccessionInvGroup addInventories(@PathVariable("id") final Long groupId, @RequestBody final List<Long> inventoryIds) {
public AccessionInvGroup addInventoriesToGroup(@PathVariable("id") final Long groupId, @RequestBody final List<Long> inventoryIds) {
List<Inventory> inventories = inventoryIds.stream().map(Inventory::new).collect(Collectors.toList());
return crudService.addMembers(crudService.get(groupId), inventories, null);
......
......@@ -64,19 +64,19 @@ public class InventoryViabilityRuleController extends FilteredCRUDController<Inv
}
@Override
@Operation(operationId = "create", description = "Create a record", summary = "Add")
@Operation(operationId = "createViabilityRule", description = "Create a record", summary = "Add")
public InventoryViabilityRule create(@RequestBody InventoryViabilityRule entity) {
return super.create(entity);
}
@Override
@Operation(operationId = "update", description = "Update an existing record", summary = "Update")
@Operation(operationId = "updateViabilityRule", description = "Update an existing record", summary = "Update")
public InventoryViabilityRule update(@RequestBody InventoryViabilityRule entity) {
return super.update(entity);
}
@PostMapping(value = "/{id}/species/list", produces = { MediaType.APPLICATION_JSON_VALUE })
public Page<InventoryViabilityRuleMap> listSpecies(@PathVariable("id") final Long ruleId, @Parameter(hidden = true) final Pagination page) {
public Page<InventoryViabilityRuleMap> listViabilityRuleMap(@PathVariable("id") final Long ruleId, @Parameter(hidden = true) final Pagination page) {
Pageable pageable = ArrayUtils.isEmpty(page.getS()) ? page.toPageRequest(MAX_PAGE_SIZE, defaultSpeciesSort()) : page.toPageRequest(MAX_PAGE_SIZE);
return crudService.listSpecies(crudService.get(ruleId), pageable);
}
......
......@@ -72,13 +72,13 @@ public class MaintenancePolicyController extends FilteredCRUDController<Inventor
}
@Override
@Operation(description = "Create a new inventory maintenance policy", summary = "Add maintenance policy")
@Operation(operationId = "createPolicy", description = "Create a new inventory maintenance policy", summary = "Add maintenance policy")
public InventoryMaintenancePolicy create(@RequestBody InventoryMaintenancePolicy entity) {
return super.create(entity);
}
@Override
@Operation(description = "Update an existing inventory maintenance policy", summary = "Update maintenance policy")
@Operation(operationId = "updatePolicy", description = "Update an existing inventory maintenance policy", summary = "Update maintenance policy")
public InventoryMaintenancePolicy update(@RequestBody InventoryMaintenancePolicy entity) {
return super.update(entity);
}
......
......@@ -54,18 +54,6 @@ public class NameGroupController extends FilteredCRUDController<NameGroup, NameG
return new OrderSpecifier[] { QNameGroup.nameGroup.id.asc() };
}
@Override
@Operation(operationId = "createAccessionInvName", description = "Create AccessionInvName", summary = "Create")
public NameGroup create(@RequestBody NameGroup entity) {
return super.create(entity);
}
@Override
@Operation(operationId = "update", description = "Update an existing record", summary = "Update")
public NameGroup update(@RequestBody NameGroup entity) {
return super.update(entity);
}
@Override
@Operation(operationId = "listNameGroups", description = "List NameGroups", summary = "List")
public FilteredPage<NameGroup, NameGroupFilter> list(@Parameter(hidden = true) final Pagination page, @RequestBody(required = false) final NameGroupFilter filter) throws SearchException, IOException {
......
......@@ -141,11 +141,11 @@ public class OrderRequestController extends FilteredCRUDController<OrderRequest,
}
@RestController("orderRequestItemsApi1")
@RequestMapping(OrderRequestItemsController.API_URL)
@RequestMapping(OrderRequestItemController.API_URL)
@PreAuthorize("isAuthenticated()")
@Tag(name = "OrderRequestItem")
@Validated
public static class OrderRequestItemsController extends CRUDController<OrderRequestItem, OrderRequestItemService> {
public static class OrderRequestItemController extends CRUDController<OrderRequestItem, OrderRequestItemService> {
/** The Constant API_URL. */
public static final String API_URL = OrderRequestController.API_URL + "/items";
......@@ -172,7 +172,7 @@ public class OrderRequestController extends FilteredCRUDController<OrderRequest,
* @return created items
*/
@PostMapping(value = "/{id}/add-inventory", produces = { MediaType.APPLICATION_JSON_VALUE })
@Operation(description = "Create and add items to order request", summary = "Add items")
@Operation(operationId = "addInventoriesToOrder", description = "Create and add items to order request", summary = "Add items")
public List<OrderRequestItem> addInventories(@PathVariable("id") final Long orderId, @RequestBody final List<OrderRequestedInventory> inventories) {
final OrderRequest orderRequest = orderRequestService.get(orderId);
return orderRequestService.addInventories(orderRequest, inventories);
......
......@@ -23,6 +23,7 @@ import java.util.stream.Collectors;
import com.fasterxml.jackson.annotation.JsonView;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.genesys.blocks.model.JsonViews;
import org.genesys.blocks.oauth.model.OAuthClient;
......@@ -185,6 +186,7 @@ public class PermissionController extends ApiBaseController {
*/
@GetMapping(value = "/permissions/{clazz}/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
@JsonView(JsonViews.Minimal.class)
@Operation(operationId = "loadObjectIdentityExtByClassAndId")
public CustomAclService.AclObjectIdentityExt permissions(@PathVariable(value = "clazz") final String className, @PathVariable("id") final long id) {
final AclObjectIdentity objectIdentity = aclService.getObjectIdentity(id, className);
if (objectIdentity == null) {
......@@ -201,6 +203,7 @@ public class PermissionController extends ApiBaseController {
*/
@GetMapping(value = "/permissions/{aclObjectIdentityId}", produces = MediaType.APPLICATION_JSON_VALUE)
@JsonView(JsonViews.Minimal.class)
@Operation(operationId = "loadObjectIdentityExtById")
public CustomAclService.AclObjectIdentityExt permissions(@PathVariable(value = "aclObjectIdentityId") final long id) {
final AclObjectIdentity objectIdentity = aclService.getObjectIdentity(id);
if (objectIdentity == null) {
......
......@@ -130,6 +130,7 @@ public class RepositoryController extends ApiBaseController {
* @throws NoSuchRepositoryFileException the no such repository file exception
* @throws IOException Signals that an I/O exception has occurred.
*/
@Operation(operationId = "downloadRepositoryFileByUUID")
@GetMapping(value = "/download/{fileUuid:\\w{8}\\-\\w{4}.+}")
public void downloadFile(@PathVariable("fileUuid") final UUID fileUuid, final HttpServletRequest request, final HttpServletResponse response) throws NoSuchRepositoryFileException, IOException {
final RepositoryFile repositoryFile = repositoryService.getFile(fileUuid);
......@@ -223,7 +224,7 @@ public class RepositoryController extends ApiBaseController {
* @throws InvalidRepositoryPathException the invalid repository path exception
*/
@GetMapping(value = "/folder/**", params = { "folders" })
@Operation(operationId = "getSubfolders", summary = "List sub-folders of folder path")
@Operation(operationId = "getFolderSubfolders", summary = "List sub-folders of folder path")
@JsonView(JsonViews.Protected.class)
public Page<RepositoryFolder> getFolderSubfolders(final HttpServletRequest request, final Pagination page) throws InvalidRepositoryPathException {
final String folderPath = ((String) request.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE)).substring((CONTROLLER_URL + "/folder").length());
......@@ -239,7 +240,7 @@ public class RepositoryController extends ApiBaseController {
* @throws InvalidRepositoryPathException the invalid repository path exception
*/
@GetMapping(value = "/folder/**", params = { "files" })
@Operation(operationId = "getSubfolders", summary = "List sub-folders of folder path")
@Operation(operationId = "getFolderFiles", summary = "List files of folder path")
@JsonView(JsonViews.Protected.class)
public Page<RepositoryFile> getFolderFiles(final HttpServletRequest request, final Pagination page) throws InvalidRepositoryPathException {
final String folderPath = ((String) request.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE)).substring((CONTROLLER_URL + "/folder").length());
......
......@@ -25,6 +25,7 @@ import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import io.swagger.v3.oas.annotations.Operation;
import org.genesys.blocks.security.SecurityContextUtil;
import org.genesys.filerepository.NoSuchRepositoryFileException;
import org.genesys.filerepository.model.RepositoryFile;
......@@ -184,6 +185,7 @@ public class RepositoryDownloadController {
/**
* Serve the bytes of the repository object
*/
@Operation(operationId = "downloadRepositoryFile")
@RequestMapping(value = RepositoryController.CONTROLLER_URL + "/download/d/**", method = RequestMethod.GET)
public void downloadFile(final HttpServletRequest request, final HttpServletResponse response) throws IOException {
final String fullpath = ((String) request.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE)).substring((RepositoryController.CONTROLLER_URL + "/download/d").length());
......@@ -212,7 +214,7 @@ public class RepositoryDownloadController {
* Return repository object metadata
*/
@RequestMapping(value = RepositoryController.CONTROLLER_URL + "/download/d/**", method = RequestMethod.GET, params = { "metadata" }, produces = MediaType.APPLICATION_JSON_VALUE)
public @ResponseBody RepositoryFile getMetadata(final HttpServletRequest request) throws IOException, NoSuchRepositoryFileException {
public RepositoryFile getMetadata(final HttpServletRequest request) throws IOException, NoSuchRepositoryFileException {
final String fullpath = (String) request.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE);
LOG.debug("Fullname: {}", fullpath);
......
......@@ -69,7 +69,7 @@ public class SysGroupManagementController extends FilteredCRUDController<SysGrou
}
@PostMapping(value = "/{id}/members", produces = { MediaType.APPLICATION_JSON_VALUE })
@Operation(operationId = "listMembers", description = "Fetch members of the group", summary = "List or filter group users")
@Operation(operationId = "listGroupMembers", description = "Fetch members of the group", summary = "List or filter group users")
@PageableAsQueryParam
public Page<SysUser> filterItems(@PathVariable("id") final Long groupId, @Parameter(hidden = true) Pagination page) throws SearchException {
final SysGroup sysInvGroup = crudService.get(groupId);
......@@ -111,11 +111,37 @@ public class SysGroupManagementController extends FilteredCRUDController<SysGrou
}
@Override
@Operation(operationId = "getSysGroup")
public SysGroup get(@PathVariable("id") long id) {
return super.get(id);
}
@Override
@Operation(operationId = "createSysGroup")
public SysGroup create(@RequestBody SysGroup entity) {
return super.create(entity);
}
@Override
@Operation(operationId = "updateSysGroup")
public SysGroup update(@RequestBody SysGroup entity) {
return super.update(entity);
}
@Override
@Operation(operationId = "removeSysGroup")
public SysGroup remove(@PathVariable(value = "id") long id) {
return super.remove(id);
}
@Override
@Operation(operationId = "listSysGroup")
public FilteredPage<SysGroup, SysGroupFilter> list( @Parameter(hidden = true) Pagination page, @RequestBody(required = false) SysGroupFilter filter) throws SearchException, IOException {
return super.list(page, filter);
}
@Override
@Operation(operationId = "filterSysGroup")
public FilteredPage<SysGroup, SysGroupFilter> filter(@RequestParam(name = "f", required = false) String filterCode, @Parameter(hidden = true) Pagination page, @RequestBody(required = false) SysGroupFilter filter) throws IOException, SearchException {
return super.filter(filterCode, page, filter);
}
......
......@@ -88,7 +88,7 @@ public class SysUserManagementController extends ApiBaseController {
* @return the user
*/
@PostMapping(value = "")
public SysUser create(@RequestParam(name = "username") final String username, @RequestParam(name = "pass") final String pass,
public SysUser createSysUser(@RequestParam(name = "username") final String username, @RequestParam(name = "pass") final String pass,
@RequestParam(name = "cooperatorId") final Long cooperatorId) throws PasswordPolicy.PasswordPolicyException {
SysUser source = new SysUser();
......@@ -105,7 +105,7 @@ public class SysUserManagementController extends ApiBaseController {
* @return the user
*/
@PutMapping(value = "")
public SysUser update(@RequestBody SysUser source) throws UserException {
public SysUser updateSysUser(@RequestBody SysUser source) throws UserException {
userService.update(source);
return getUser(source.getId());
}
......@@ -132,7 +132,7 @@ public class SysUserManagementController extends ApiBaseController {
* @throws UserException
*/
@PostMapping(value = "/{id}/password")
public boolean setPassword(@PathVariable("id") final Long id, @RequestParam(name = "pass") final String pass) throws UserException {
public boolean setSysUserPassword(@PathVariable("id") final Long id, @RequestParam(name = "pass") final String pass) throws UserException {
userService.setPassword(userService.loadSysUser(id), pass);
return true;
}
......
......@@ -34,9 +34,7 @@ import org.gringlobal.service.TaxonomySpeciesCRUDService;
import org.gringlobal.service.filter.TaxonomyFamilyFilter;
import org.gringlobal.service.filter.TaxonomyGenusFilter;
import org.gringlobal.service.filter.TaxonomySpeciesFilter;
import org.springframework.data.domain.Page;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
......@@ -75,30 +73,6 @@ public class TaxonomyController extends ApiBaseController {
return DEFAULT_SORT;
}
@Override
@Operation(operationId = "getSpecies")
public TaxonomySpecies get(long id) {
return super.get(id);
}
@Override
@Operation(operationId = "removeSpecies")
public TaxonomySpecies remove(long id) {
return super.remove(id);
}
@Override
@Operation(operationId = "createSpecies")
public TaxonomySpecies create(@RequestBody TaxonomySpecies entity) {
return super.create(entity);
}
@Override
@Operation(operationId = "updateSpecies")
public TaxonomySpecies update(@RequestBody TaxonomySpecies entity) {
return super.update(entity);
}
@Override
@Operation(operationId = "listSpecies")
public FilteredPage<TaxonomySpecies, TaxonomySpeciesFilter> list(@Parameter(hidden = true) final Pagination page, @RequestBody(required = false) TaxonomySpeciesFilter filter) throws SearchException, IOException {
......@@ -131,30 +105,6 @@ public class TaxonomyController extends ApiBaseController {
return DEFAULT_SORT;
}
@Override
@Operation(operationId = "getGenus")
public TaxonomyGenus get(long id) {
return super.get(id);
}
@Override
@Operation(operationId = "removeGenus")
public TaxonomyGenus remove(long id) {
return super.remove(id);
}
@Override
@Operation(operationId = "createGenus")
public TaxonomyGenus create(@RequestBody TaxonomyGenus entity) {
return super.create(entity);
}
@Override
@Operation(operationId = "updateGenus")
public TaxonomyGenus update(@RequestBody TaxonomyGenus entity) {
return super.update(entity);
}
@Override
@Operation(operationId = "listGenus")
public FilteredPage<TaxonomyGenus, TaxonomyGenusFilter> list(@Parameter(hidden = true) final Pagination page, @RequestBody(required = false) TaxonomyGenusFilter filter) throws SearchException, IOException {
......@@ -187,30 +137,6 @@ public class TaxonomyController extends ApiBaseController {
return DEFAULT_SORT;
}
@Override
@Operation(operationId = "getFamily")
public TaxonomyFamily get(@PathVariable("id") long id) {