Springboot的第一个起步练习

模块内代码

1.HelloController

package com.springboot.quickstart.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
@RequestMapping(value ="/hello" ,method = RequestMethod.GET)
public String getHello(){
return "Hello,Spring boot";
}

}

2.QuickstartApplication

package com.springboot.quickstart;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
//启动主类
@SpringBootApplication
public class QuickstartApplication {

public static void main(String[] args) {
    SpringApplication.run ( QuickstartApplication.class, args );
}

}

你可能感兴趣的:(Springboot的第一个起步练习)