-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1936 from TAMULib/55-submission_type_filter-to_up…
…stream Add custom filter for submission type by list.
- Loading branch information
Showing
22 changed files
with
419 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/main/java/org/tdl/vireo/controller/FieldValueController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package org.tdl.vireo.controller; | ||
|
||
import static edu.tamu.weaver.response.ApiStatus.SUCCESS; | ||
|
||
import edu.tamu.weaver.response.ApiResponse; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.security.access.prepost.PreAuthorize; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import org.tdl.vireo.model.FieldPredicate; | ||
import org.tdl.vireo.model.repo.FieldPredicateRepo; | ||
import org.tdl.vireo.model.repo.FieldValueRepo; | ||
|
||
/** | ||
* Controller in which to manage controlled vocabulary. | ||
* | ||
*/ | ||
@RestController | ||
@RequestMapping("/settings/field-values") | ||
public class FieldValueController { | ||
|
||
@Autowired | ||
private FieldValueRepo fieldValueRepo; | ||
|
||
/** | ||
* Endpoint to request a field predicate by value. | ||
* | ||
* @param value The Field Predicate value (not the Field Value). | ||
* | ||
* @return ApiResponse with all matching field values. | ||
*/ | ||
@GetMapping("/predicate/{value}") | ||
@PreAuthorize("hasRole('STUDENT')") | ||
public ApiResponse getFieldValuesByPredicateValue(@PathVariable String value) { | ||
return new ApiResponse(SUCCESS, fieldValueRepo.getAllValuesByFieldPredicateValue("submission_type")); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
package org.tdl.vireo.model.repo; | ||
|
||
import edu.tamu.weaver.data.model.repo.WeaverRepo; | ||
import org.tdl.vireo.model.FieldValue; | ||
import org.tdl.vireo.model.repo.custom.FieldValueRepoCustom; | ||
|
||
import edu.tamu.weaver.data.model.repo.WeaverRepo; | ||
|
||
public interface FieldValueRepo extends WeaverRepo<FieldValue>, FieldValueRepoCustom { | ||
|
||
} |
3 changes: 3 additions & 0 deletions
3
src/main/java/org/tdl/vireo/model/repo/custom/FieldValueRepoCustom.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
package org.tdl.vireo.model.repo.custom; | ||
|
||
import java.util.List; | ||
import org.tdl.vireo.model.FieldPredicate; | ||
import org.tdl.vireo.model.FieldValue; | ||
|
||
public interface FieldValueRepoCustom { | ||
|
||
public FieldValue create(FieldPredicate fieldPredicate); | ||
|
||
public List<String> getAllValuesByFieldPredicateValue(String fieldPredicateValue); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.