-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/stevensblueprint/orservice …
…into feature/pipeline
- Loading branch information
Showing
80 changed files
with
3,011 additions
and
858 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
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
54 changes: 54 additions & 0 deletions
54
src/main/java/com/sarapis/orservice/controller/AccessibilityController.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,54 @@ | ||
package com.sarapis.orservice.controller; | ||
|
||
import com.sarapis.orservice.dto.AccessibilityDTO; | ||
import com.sarapis.orservice.service.AccessibilityService; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
@RestController | ||
@RequestMapping("/api/accessibilities") | ||
public class AccessibilityController { | ||
private final AccessibilityService accessibilityService; | ||
|
||
@Autowired | ||
public AccessibilityController(AccessibilityService accessibilityService) { | ||
this.accessibilityService = accessibilityService; | ||
} | ||
|
||
@GetMapping | ||
public ResponseEntity<List<AccessibilityDTO>> getAllAccessibilities() { | ||
List<AccessibilityDTO> accessibilityDTOs = this.accessibilityService.getAllAccessibilities(); | ||
return ResponseEntity.ok(accessibilityDTOs); | ||
} | ||
|
||
@GetMapping("/{id}") | ||
public ResponseEntity<AccessibilityDTO> getAccessibilityById(@PathVariable String id) { | ||
AccessibilityDTO accessibility = this.accessibilityService.getAccessibilityById(id); | ||
return ResponseEntity.ok(accessibility); | ||
} | ||
|
||
@PostMapping | ||
public ResponseEntity<AccessibilityDTO> createAccessibility(@RequestBody AccessibilityDTO accessibilityDTO) { | ||
if (accessibilityDTO.getId() == null) { | ||
accessibilityDTO.setId(UUID.randomUUID().toString()); | ||
} | ||
AccessibilityDTO createdAccessibility = this.accessibilityService.createAccessibility(accessibilityDTO); | ||
return ResponseEntity.ok(createdAccessibility); | ||
} | ||
|
||
@PutMapping("/{id}") | ||
public ResponseEntity<AccessibilityDTO> updateAccessibility(@PathVariable String id, @RequestBody AccessibilityDTO accessibilityDTO) { | ||
AccessibilityDTO updatedAccessibility = this.accessibilityService.updateAccessibility(id, accessibilityDTO); | ||
return ResponseEntity.ok(updatedAccessibility); | ||
} | ||
|
||
@DeleteMapping("/{id}") | ||
public ResponseEntity<Void> deleteAccessibility(@PathVariable String id) { | ||
this.accessibilityService.deleteAccessibility(id); | ||
return ResponseEntity.noContent().build(); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
src/main/java/com/sarapis/orservice/controller/AddressController.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,50 @@ | ||
package com.sarapis.orservice.controller; | ||
|
||
import com.sarapis.orservice.dto.AddressDTO; | ||
import com.sarapis.orservice.service.AddressService; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import java.util.List; | ||
|
||
@RestController | ||
@RequestMapping("/api/addresses") | ||
public class AddressController { | ||
public final AddressService addressService; | ||
|
||
@Autowired | ||
public AddressController(AddressService addressService) { | ||
this.addressService = addressService; | ||
} | ||
|
||
@GetMapping | ||
public ResponseEntity<List<AddressDTO>> getAllAddresses() { | ||
List<AddressDTO> addressDTOs = this.addressService.getAllAddresses(); | ||
return ResponseEntity.ok(addressDTOs); | ||
} | ||
|
||
@GetMapping("/{id}") | ||
public ResponseEntity<AddressDTO> getAddressById(@PathVariable String id) { | ||
AddressDTO queried = this.addressService.getAddressById(id); | ||
return ResponseEntity.ok(queried); | ||
} | ||
|
||
@PostMapping | ||
public ResponseEntity<AddressDTO> createAddress(@RequestBody AddressDTO addressDTO) { | ||
AddressDTO createdAddress = this.addressService.createAddress(addressDTO); | ||
return ResponseEntity.ok(createdAddress); | ||
} | ||
|
||
@PutMapping("/{id}") | ||
public ResponseEntity<AddressDTO> updateAddress(@PathVariable String id, @RequestBody AddressDTO addressDTO) { | ||
AddressDTO updateAddress = this.addressService.updateAddress(id, addressDTO); | ||
return ResponseEntity.ok(updateAddress); | ||
} | ||
|
||
@DeleteMapping("/{id}") | ||
public ResponseEntity<Void> deleteAddress(@PathVariable String id) { | ||
this.addressService.deleteAddress(id); | ||
return ResponseEntity.noContent().build(); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
src/main/java/com/sarapis/orservice/controller/AttributeController.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,50 @@ | ||
package com.sarapis.orservice.controller; | ||
|
||
import com.sarapis.orservice.dto.AttributeDTO; | ||
import com.sarapis.orservice.service.AttributeService; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import java.util.List; | ||
|
||
@RestController | ||
@RequestMapping("/api/attributes") | ||
public class AttributeController { | ||
private final AttributeService attributeService; | ||
|
||
@Autowired | ||
public AttributeController(AttributeService attributeService) { | ||
this.attributeService = attributeService; | ||
} | ||
|
||
@GetMapping | ||
public ResponseEntity<List<AttributeDTO>> getAllAttributes() { | ||
List<AttributeDTO> attributeDTOs = this.attributeService.getAllAttributes(); | ||
return ResponseEntity.ok(attributeDTOs); | ||
} | ||
|
||
@GetMapping("/{id}") | ||
public ResponseEntity<AttributeDTO> getAttributeById(@PathVariable String id) { | ||
AttributeDTO queried = this.attributeService.getAttributeById(id); | ||
return ResponseEntity.ok(queried); | ||
} | ||
|
||
@PostMapping | ||
public ResponseEntity<AttributeDTO> createAttribute(@RequestBody AttributeDTO attributeDTO) { | ||
AttributeDTO createdAttribute = this.attributeService.createAttribute(attributeDTO); | ||
return ResponseEntity.ok(createdAttribute); | ||
} | ||
|
||
@PutMapping("/{id}") | ||
public ResponseEntity<AttributeDTO> updateAttribute(@PathVariable String id, @RequestBody AttributeDTO attributeDTO) { | ||
AttributeDTO updatedAttribute = this.attributeService.updateAttribute(id, attributeDTO); | ||
return ResponseEntity.ok(updatedAttribute); | ||
} | ||
|
||
@DeleteMapping("/{id}") | ||
public ResponseEntity<Void> deleteAttribute(@PathVariable String id) { | ||
this.attributeService.deleteAttribute(id); | ||
return ResponseEntity.noContent().build(); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/com/sarapis/orservice/controller/ExportController.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,30 @@ | ||
package com.sarapis.orservice.controller; | ||
|
||
import com.sarapis.orservice.service.OrganizationService; | ||
import java.io.ByteArrayInputStream; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.core.io.InputStreamResource; | ||
import org.springframework.core.io.Resource; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequestMapping("/api/export") | ||
public class ExportController { | ||
private final OrganizationService organizationService; | ||
|
||
@Autowired | ||
public ExportController(OrganizationService organizationService) { | ||
this.organizationService = organizationService; | ||
} | ||
|
||
@RequestMapping("/csv") | ||
public ResponseEntity<Resource> exportCSV() { | ||
String filename = "organizations.csv"; | ||
InputStreamResource organizationCSV = new InputStreamResource(organizationService.loadCSV()); | ||
return ResponseEntity.ok() | ||
.body(organizationCSV); | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/com/sarapis/orservice/controller/ImportController.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,28 @@ | ||
package com.sarapis.orservice.controller; | ||
|
||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequestMapping("/api/import") | ||
public class ImportController { | ||
@GetMapping("/csv") | ||
public void exportCSV() { | ||
} | ||
|
||
@PostMapping("/csv") | ||
public void importCSV() { | ||
} | ||
|
||
@GetMapping("/pdf") | ||
public void exportPDF() { | ||
|
||
} | ||
|
||
@PostMapping("/pdf") | ||
public void importPDF() { | ||
|
||
} | ||
} |
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.