赞
踩
package cn.tedu;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class RunApp {
public static void main(String[] args) {
SpringApplication.run(RunApp.class);
}
}
package cn.tedu.pojo; public class Student { private String name; private String subject; private Integer id; private Double score; private Double height; public Student(String name, String subject, Integer id, Double score, Double height) { this.name = name; this.subject = subject; this.id = id; this.score = score; this.height = height; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSubject() { return subject; } public void setSubject(String subject) { this.subject = subject; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Double getScore() { return score; } public void setScore(Double score) { this.score = score; } public Double getHeight() { return height; } public void setHeight(Double height) { this.height = height; } @Override public String toString() { return "Student{" + "name='" + name + '\'' + ", subject='" + subject + '\'' + ", id=" + id + ", score=" + score + ", height=" + height + '}'; } }
package cn.tedu.controller;
import cn.tedu.pojo.Student;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("st")
@CrossOrigin
public class StuController {
@RequestMapping("get")
public Student get(){
Student s =new Student("Melt","Killer-Queen",
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。