본문으로 바로가기

요청방식 세분화

category Backend/Spring 2017. 8. 23. 14:28
    반응형

    1. 조회는 Get

    2. 변경은 Post


    @RestController

    @RequestMapping("/scout/posting")

    public class PostingController {

    Logger log = Logger.getLogger(this.getClass());


    @Autowired

    private PostingService postingService;


    @RequestMapping(value = { """/" }, method = RequestMethod.GET)

    public PostView post(@RequestParam("teamId"int teamId) {

    return postingService.getPostView(teamId);

    }


    @RequestMapping(value = "/bid/{postPlayerId}", method = RequestMethod.POST)

    public void bid(@PathVariable("postPlayerId"int postPlayerId@RequestParam("teamId"int teamId,

    @RequestParam("ap"int ap) {

    }


    @RequestMapping("/get/{postPlayerId}")

    public void get(@PathVariable("postPlayerId"int postPlayerId@RequestParam("teamId"int teamId) {


    }

    }


    반응형