Skip to content

Instantly share code, notes, and snippets.

@singh1114
Last active October 13, 2019 08:20
Show Gist options
  • Save singh1114/30a01779d59b1f40e03a9da5e8dbf777 to your computer and use it in GitHub Desktop.
Save singh1114/30a01779d59b1f40e03a9da5e8dbf777 to your computer and use it in GitHub Desktop.
package io.singh1114.springboottut.standard;
public class Standard {
private String standard;
private String section;
private String classTeacher;
public Standard(String standard, String section, String classTeacher) {
super();
this.standard = standard;
this.section = section;
this.classTeacher = classTeacher;
}
public String getStandard() {
return standard;
}
public void setStandard(String standard) {
this.standard = standard;
}
public String getSection() {
return section;
}
public void setSection(String section) {
this.section = section;
}
public String getClassTeacher() {
return classTeacher;
}
public void setClassTeacher(String classTeacher) {
this.classTeacher = classTeacher;
}
}
package io.singh1114.springboottut.standard;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.List;
@RestController
public class StandardController {
@RequestMapping("/standards")
public List<Standard> getAllStandards() {
return Arrays.asList(
new Standard("1", "A", "Mr. Tom"),
new Standard("2", "A", "Mr. Charlie"),
new Standard("3", "A", "Mr. Potter"),
new Standard("3", "B", "Mr. Read")
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment