Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @RestController
- @RequestMapping({"/person"})
- @Metadata(
- mv = {1, 1, 2},
- bv = {1, 0, 1},
- k = 1,
- d1 = {"\u00000\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0010!\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010 \n\u0002\b\u0005\b\u0003\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u0012\u0010\u0005\u001a\u00020\u00062\b\b\u0001\u0010\u0007\u001a\u00020\bH\u0007J,\u0010\t\u001a&\u0012\f\u0012\n \f*\u0004\u0018\u00010\u000b0\u000b \f*\u0012\u0012\f\u0012\n \f*\u0004\u0018\u00010\u000b0\u000b\u0018\u00010\r0\nH\u0007J\b\u0010\u000e\u001a\u00020\u0001H\u0007J\u001a\u0010\u000f\u001a\n \f*\u0004\u0018\u00010\u000b0\u000b2\b\b\u0001\u0010\u0007\u001a\u00020\bH\u0007J\u001a\u0010\u0010\u001a\n \f*\u0004\u0018\u00010\u000b0\u000b2\b\b\u0001\u0010\u0011\u001a\u00020\u000bH\u0007R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0012"},
- d2 = {"Ldemo/controllers/PersonController;", "", "personRepository", "Ldemo/repository/PersonRepository;", "(Ldemo/repository/PersonRepository;)V", "delete", "", "id", "", "findAll", "", "Ldemo/model/Person;", "kotlin.jvm.PlatformType", "", "findAll2", "findOne", "save", "person", "kotlin-spring_main"}
- )
- final class PersonController {
- private final PersonRepository personRepository;
- @GetMapping({"/{id}"})
- public final Person findOne(@PathVariable long id) {
- return (Person)this.personRepository.findOne(Long.valueOf(id));
- }
- @GetMapping
- public final List findAll() {
- return this.personRepository.findAll();
- }
- @GetMapping({"/customFindAll"})
- @NotNull
- public final Object findAll2() {
- return new Object() {
- private final List persons;
- public final List getPersons() {
- return this.persons;
- }
- {
- this.persons = PersonController.this.personRepository.findAll();
- }
- };
- }
- @PostMapping
- public final Person save(@RequestBody @NotNull Person person) {
- Intrinsics.checkParameterIsNotNull(person, "person");
- return (Person)this.personRepository.save(person);
- }
- @DeleteMapping({"/{id}"})
- public final void delete(@PathVariable long id) {
- this.personRepository.delete(Long.valueOf(id));
- }
- public PersonController(@NotNull PersonRepository personRepository) {
- Intrinsics.checkParameterIsNotNull(personRepository, "personRepository");
- super();
- this.personRepository = personRepository;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement