Commit 3e34d066 authored by Maxym Borodenko's avatar Maxym Borodenko Committed by Matija Obreza

Code refactoring

parent a3652d88
/*
* Copyright 2020 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gringlobal.api.v1.impl;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.gringlobal.api.v1.CRUDController;
import org.gringlobal.model.AccessionInvName;
import org.gringlobal.service.AccessionInvNameService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* The AccessionInvNameController class.
*
* @author Maxym Borodenko
*/
@RestController("accessionInvNameApi1")
@RequestMapping(AccessionInvNameController.API_URL)
@PreAuthorize("isAuthenticated()")
@Tag(name = "Accession")
public class AccessionInvNameController extends CRUDController<AccessionInvName, AccessionInvNameService> {
/** The Constant API_URL. */
public static final String API_URL = AccessionController.API_URL + "/name";
@Override
@Operation(operationId = "createAccessionInvName", description = "Create AccessionInvName", summary = "Create")
public AccessionInvName create(@RequestBody AccessionInvName entity) {
return super.create(entity);
}
@Override
@Operation(operationId = "update", description = "Update an existing record", summary = "Update")
public AccessionInvName update(@RequestBody AccessionInvName entity) {
return super.update(entity);
}
}
/*
* Copyright 2020 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gringlobal.api.v1.impl;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.gringlobal.api.v1.CRUDController;
import org.gringlobal.model.AccessionIpr;
import org.gringlobal.service.AccessionIprService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* The AccessionIprController class.
*
* @author Maxym Borodenko
*/
@RestController("accessionIprApi1")
@RequestMapping(AccessionIprController.API_URL)
@PreAuthorize("isAuthenticated()")
@Tag(name = "Accession")
public class AccessionIprController extends CRUDController<AccessionIpr, AccessionIprService> {
/** The Constant API_URL. */
public static final String API_URL = AccessionController.API_URL + "/ipr";
@Override
@Operation(operationId = "createAccessionIpr", description = "Create AccessionIpr", summary = "Create")
public AccessionIpr create(@RequestBody AccessionIpr entity) {
return super.create(entity);
}
@Override
@Operation(operationId = "update", description = "Update an existing record", summary = "Update")
public AccessionIpr update(@RequestBody AccessionIpr entity) {
return super.update(entity);
}
}
/*
* Copyright 2020 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gringlobal.api.v1.impl;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.gringlobal.api.v1.CRUDController;
import org.gringlobal.model.AccessionPedigree;
import org.gringlobal.service.AccessionPedigreeService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* The AccessionPedigreeController class.
*
* @author Maxym Borodenko
*/
@RestController("accessionPedigreeApi1")
@RequestMapping(AccessionPedigreeController.API_URL)
@PreAuthorize("isAuthenticated()")
@Tag(name = "Accession")
public class AccessionPedigreeController extends CRUDController<AccessionPedigree, AccessionPedigreeService> {
/** The Constant API_URL. */
public static final String API_URL = AccessionController.API_URL + "/pedigree";
@Override
@Operation(operationId = "createAccessionPedigree", description = "Create AccessionPedigree", summary = "Create")
public AccessionPedigree create(@RequestBody AccessionPedigree entity) {
return super.create(entity);
}
@Override
@Operation(operationId = "updateAccessionPedigree", description = "Update an existing record", summary = "Update")
public AccessionPedigree update(@RequestBody AccessionPedigree entity) {
return super.update(entity);
}
}
/*
* Copyright 2020 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gringlobal.api.v1.impl;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.gringlobal.api.v1.CRUDController;
import org.gringlobal.model.AccessionQuarantine;
import org.gringlobal.service.AccessionQuarantineService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* The AccessionQuarantineController class.
*
* @author Maxym Borodenko
*/
@RestController("accessionQuarantineApi1")
@RequestMapping(AccessionQuarantineController.API_URL)
@PreAuthorize("isAuthenticated()")
@Tag(name = "Accession")
public class AccessionQuarantineController extends CRUDController<AccessionQuarantine, AccessionQuarantineService> {
/** The Constant API_URL. */
public static final String API_URL = AccessionController.API_URL + "/quarantine";
@Override
@Operation(operationId = "createAccessionQuarantine", description = "Create AccessionQuarantine", summary = "Create")
public AccessionQuarantine create(@RequestBody AccessionQuarantine entity) {
return super.create(entity);
}
@Override
@Operation(operationId = "updateAccessionQuarantine", description = "Update an existing record", summary = "Update")
public AccessionQuarantine update(@RequestBody AccessionQuarantine entity) {
return super.update(entity);
}
}
/*
* Copyright 2020 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gringlobal.api.v1.impl;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.gringlobal.api.v1.ApiBaseController;
import org.gringlobal.api.v1.CRUDController;
import org.gringlobal.model.AccessionInvName;
import org.gringlobal.model.AccessionIpr;
import org.gringlobal.model.AccessionPedigree;
import org.gringlobal.model.AccessionQuarantine;
import org.gringlobal.model.AccessionSource;
import org.gringlobal.model.Citation;
import org.gringlobal.service.AccessionInvNameService;
import org.gringlobal.service.AccessionIprService;
import org.gringlobal.service.AccessionPedigreeService;
import org.gringlobal.service.AccessionQuarantineService;
import org.gringlobal.service.AccessionSourceService;
import org.gringlobal.service.CitationService;
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.RestController;
@RestController("accessionRelatedApi1")
@RequestMapping(AccessionRelatedController.API_URL)
@PreAuthorize("isAuthenticated()")
@Tag(name = "Accession")
public class AccessionRelatedController extends ApiBaseController {
/** The Constant API_URL. */
public static final String API_URL = AccessionController.API_URL;
@RestController("accessionInvNameApi1")
@RequestMapping(AccessionInvNameController.API_URL)
@PreAuthorize("isAuthenticated()")
@Tag(name = "Accession")
public class AccessionInvNameController extends CRUDController<AccessionInvName, AccessionInvNameService> {
/** The Constant API_URL. */
public static final String API_URL = AccessionRelatedController.API_URL + "/name";
@Override
@Operation(operationId = "createAccessionInvName", description = "Create AccessionInvName", summary = "Create")
public AccessionInvName create(@RequestBody AccessionInvName entity) {
return super.create(entity);
}
@Override
@Operation(operationId = "updateAccessionInvName", description = "Update an existing record", summary = "Update")
public AccessionInvName update(@RequestBody AccessionInvName entity) {
return super.update(entity);
}
@Override
@Operation(operationId = "getAccessionInvName", description = "Get record by ID", summary = "Get")
public AccessionInvName get(@PathVariable long id) {
return super.get(id);
}
@Override
@Operation(operationId = "deleteAccessionInvName", description = "Delete existing record by ID", summary = "Delete")
public AccessionInvName remove(@PathVariable long id) {
return super.remove(id);
}
}
@RestController("accessionIprApi1")
@RequestMapping(AccessionIprController.API_URL)
@PreAuthorize("isAuthenticated()")
@Tag(name = "Accession")
public class AccessionIprController extends CRUDController<AccessionIpr, AccessionIprService> {
/** The Constant API_URL. */
public static final String API_URL = AccessionRelatedController.API_URL + "/ipr";
@Override
@Operation(operationId = "createAccessionIpr", description = "Create AccessionIpr", summary = "Create")
public AccessionIpr create(@RequestBody AccessionIpr entity) {
return super.create(entity);
}
@Override
@Operation(operationId = "updateAccessionIpr", description = "Update an existing record", summary = "Update")
public AccessionIpr update(@RequestBody AccessionIpr entity) {
return super.update(entity);
}
@Override
@Operation(operationId = "getAccessionIpr", description = "Get record by ID", summary = "Get")
public AccessionIpr get(@PathVariable long id) {
return super.get(id);
}
@Override
@Operation(operationId = "deleteAccessionIpr", description = "Delete existing record by ID", summary = "Delete")
public AccessionIpr remove(@PathVariable long id) {
return super.remove(id);
}
}
@RestController("accessionPedigreeApi1")
@RequestMapping(AccessionPedigreeController.API_URL)
@PreAuthorize("isAuthenticated()")
@Tag(name = "Accession")
public class AccessionPedigreeController extends CRUDController<AccessionPedigree, AccessionPedigreeService> {
/** The Constant API_URL. */
public static final String API_URL = AccessionRelatedController.API_URL + "/pedigree";
@Override
@Operation(operationId = "createAccessionPedigree", description = "Create AccessionPedigree", summary = "Create")
public AccessionPedigree create(@RequestBody AccessionPedigree entity) {
return super.create(entity);
}
@Override
@Operation(operationId = "updateAccessionPedigree", description = "Update an existing record", summary = "Update")
public AccessionPedigree update(@RequestBody AccessionPedigree entity) {
return super.update(entity);
}
@Override
@Operation(operationId = "getAccessionPedigree", description = "Get record by ID", summary = "Get")
public AccessionPedigree get(@PathVariable long id) {
return super.get(id);
}
@Override
@Operation(operationId = "deleteAccessionPedigree", description = "Delete existing record by ID", summary = "Delete")
public AccessionPedigree remove(@PathVariable long id) {
return super.remove(id);
}
}
@RestController("accessionSourceApi1")
@RequestMapping(AccessionSourceController.API_URL)
@PreAuthorize("isAuthenticated()")
@Tag(name = "Accession")
public class AccessionSourceController extends CRUDController<AccessionSource, AccessionSourceService> {
/** The Constant API_URL. */
public static final String API_URL = AccessionRelatedController.API_URL + "/source";
@Override
@Operation(operationId = "createAccessionSource", description = "Create AccessionSource", summary = "Create")
public AccessionSource create(@RequestBody AccessionSource entity) {
return super.create(entity);
}
@Override
@Operation(operationId = "updateAccessionSource", description = "Update an existing record", summary = "Update")
public AccessionSource update(@RequestBody AccessionSource entity) {
return super.update(entity);
}
@Override
@Operation(operationId = "getAccessionSource", description = "Get record by ID", summary = "Get")
public AccessionSource get(@PathVariable long id) {
return super.get(id);
}
@Override
@Operation(operationId = "deleteAccessionSource", description = "Delete existing record by ID", summary = "Delete")
public AccessionSource remove(@PathVariable long id) {
return super.remove(id);
}
}
@RestController("accessionQuarantineApi1")
@RequestMapping(AccessionQuarantineController.API_URL)
@PreAuthorize("isAuthenticated()")
@Tag(name = "Accession")
public class AccessionQuarantineController extends CRUDController<AccessionQuarantine, AccessionQuarantineService> {
/** The Constant API_URL. */
public static final String API_URL = AccessionRelatedController.API_URL + "/quarantine";
@Override
@Operation(operationId = "createAccessionQuarantine", description = "Create AccessionQuarantine", summary = "Create")
public AccessionQuarantine create(@RequestBody AccessionQuarantine entity) {
return super.create(entity);
}
@Override
@Operation(operationId = "updateAccessionQuarantine", description = "Update an existing record", summary = "Update")
public AccessionQuarantine update(@RequestBody AccessionQuarantine entity) {
return super.update(entity);
}
@Override
@Operation(operationId = "getAccessionQuarantine", description = "Get record by ID", summary = "Get")
public AccessionQuarantine get(@PathVariable long id) {
return super.get(id);
}
@Override
@Operation(operationId = "deleteAccessionQuarantine", description = "Delete existing record by ID", summary = "Delete")
public AccessionQuarantine remove(@PathVariable long id) {
return super.remove(id);
}
}
@RestController("citationApi1")
@RequestMapping(CitationController.API_URL)
@PreAuthorize("isAuthenticated()")
@Tag(name = "Accession")
public class CitationController extends CRUDController<Citation, CitationService> {
/** The Constant API_URL. */
public static final String API_URL = AccessionRelatedController.API_URL + "/citation";
@Override
@Operation(operationId = "createCitation", description = "Create Citation", summary = "Create")
public Citation create(@RequestBody Citation entity) {
return super.create(entity);
}
@Override
@Operation(operationId = "updateCitation", description = "Update an existing record", summary = "Update")
public Citation update(@RequestBody Citation entity) {
return super.update(entity);
}
@Override
@Operation(operationId = "getCitation", description = "Get record by ID", summary = "Get")
public Citation get(@PathVariable long id) {
return super.get(id);
}
@Override
@Operation(operationId = "deleteCitation", description = "Delete existing record by ID", summary = "Delete")
public Citation remove(@PathVariable long id) {
return super.remove(id);
}
}
}
/*
* Copyright 2020 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gringlobal.api.v1.impl;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.gringlobal.api.v1.CRUDController;
import org.gringlobal.model.AccessionSource;
import org.gringlobal.service.AccessionSourceService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* The AccessionSourceController class.
*
* @author Maxym Borodenko
*/
@RestController("accessionSourceApi1")
@RequestMapping(AccessionSourceController.API_URL)
@PreAuthorize("isAuthenticated()")
@Tag(name = "Accession")
public class AccessionSourceController extends CRUDController<AccessionSource, AccessionSourceService> {
/** The Constant API_URL. */
public static final String API_URL = AccessionController.API_URL + "/source";
@Override
@Operation(operationId = "createAccessionSource", description = "Create AccessionSource", summary = "Create")
public AccessionSource create(@RequestBody AccessionSource entity) {
return super.create(entity);
}
@Override
@Operation(operationId = "update", description = "Update an existing record", summary = "Update")
public AccessionSource update(@RequestBody AccessionSource entity) {
return super.update(entity);
}
}
/*
* Copyright 2020 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gringlobal.api.v1.impl;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.gringlobal.api.v1.CRUDController;
import org.gringlobal.model.Citation;
import org.gringlobal.service.CitationService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* The CitationController class.
*
* @author Maxym Borodenko
*/
@RestController("citationApi1")
@RequestMapping(CitationController.API_URL)
@PreAuthorize("isAuthenticated()")
@Tag(name = "Accession")
public class CitationController extends CRUDController<Citation, CitationService> {
/** The Constant API_URL. */
public static final String API_URL = AccessionController.API_URL + "/citation";
@Override
@Operation(operationId = "createCitation", description = "Create Citation", summary = "Create")
public Citation create(@RequestBody Citation entity) {
return super.create(entity);
}
@Override
@Operation(operationId = "updateCitation", description = "Update an existing record", summary = "Update")
public Citation update(@RequestBody Citation entity) {
return super.update(entity);
}
}
......@@ -20,7 +20,6 @@ import com.querydsl.core.types.OrderSpecifier;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.gringlobal.api.v1.ApiBaseController;