25 lines
803 B
Java
25 lines
803 B
Java
package com.example.prapro2spring.controller;
|
|
|
|
import com.example.prapro2spring.dto.AllPeopleValues;
|
|
import com.example.prapro2spring.service.PersonValueService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
@RestController
|
|
@RequestMapping("/api/main")
|
|
public class PeopleValuesController {
|
|
|
|
@Autowired
|
|
private PersonValueService PersonValueService;
|
|
|
|
|
|
@GetMapping("/")
|
|
public AllPeopleValues getAllPeopleValues(@RequestParam(value = "startIndex", defaultValue = "0") Integer startIndex) {
|
|
return PersonValueService.getAllPersonValues(startIndex);
|
|
}
|
|
|
|
@GetMapping("/{id}")
|
|
public Integer getPersonValuesById(@PathVariable Integer id){
|
|
return PersonValueService.getPersonValuesById(id);
|
|
}
|
|
} |