Skip to content

Instantly share code, notes, and snippets.

@prashanth-sams
Last active July 3, 2021 12:38
Show Gist options
  • Save prashanth-sams/2f2ae331eb8a5ed8b587fe0f58111de0 to your computer and use it in GitHub Desktop.
Save prashanth-sams/2f2ae331eb8a5ed8b587fe0f58111de0 to your computer and use it in GitHub Desktop.
Controller
package com.wmock.info.controllers;
import com.wmock.info.models.ChapterInfoModel;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping(value = "/api/chapter", produces = "application/json")
public class ChapterInfoController {
@RequestMapping(method = RequestMethod.GET, value = "/{chapterId}")
public ChapterInfoModel getChapterInfo(@PathVariable("chapterId") String chapterId) {
return new ChapterInfoModel(chapterId, "Chapter name");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment