Created
December 24, 2021 16:21
-
-
Save voidcoefficient/9d4dc7b02b30b6c377374ac7d4977fe2 to your computer and use it in GitHub Desktop.
Slinky Examples
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
@Entity | |
@Table(name = "todos") | |
data class Todo( | |
@Id | |
@GeneratedValue(strategy = GenerationType.AUTO) | |
override var id: Long?, | |
var name: String?, | |
var description: String?, | |
var completed: Boolean? | |
) : IGenericEntity<Long> |
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
@Service | |
class TodoBusiness(repository: TodoRepository) : GenericBusiness<Todo, Long>(repository) |
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
@RestController | |
@RequestMapping("/api/v1/todos") | |
class TodoController(business: TodoBusiness) : GenericController<Todo, Long>(business) |
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
@Repository | |
class TodoRepository(entityManager: EntityManager) | |
: GenericRepository<Todo, Long>(Todo::class.java, entityManager) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment