This file contains hidden or 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
package za.co.dubedivine.groceryapp.model | |
import javax.persistence.Entity | |
import javax.persistence.GeneratedValue | |
import javax.persistence.GenerationType | |
import javax.persistence.Id | |
@Entity | |
data class GroceryItem(var name: String, var isAvailable: Boolean) { |
This file contains hidden or 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
[ | |
{ | |
"name": "Beans", | |
"id": 1, | |
"available": true | |
}, | |
{ | |
"name": "Eggs", | |
"id": 2, | |
"available": false |
This file contains hidden or 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
package za.co.dubedivine.groceryapp.controller | |
import org.springframework.web.bind.annotation.* | |
@RestController | |
@RequestMapping("groceries") | |
class GroceriesController(private val groceryRepository: GroceryItemRepository) { | |
} |
This file contains hidden or 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
package za.co.dubedivine.groceryapp.controller | |
import org.springframework.http.HttpStatus | |
import org.springframework.http.ResponseEntity | |
import org.springframework.web.bind.annotation.* | |
import za.co.dubedivine.groceryapp.model.GroceryItem | |
import za.co.dubedivine.groceryapp.model.responseModel.StatusResponseEntity | |
import za.co.dubedivine.groceryapp.repository.GroceryItemRepository | |
@RestController |
NewerOlder