package com.webapp.controller;
import com.my.webapp.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
*/
@RestController
@RequestMapping("/user")
public class LoginController extends BaseController {
@Autowired
private LoginService loginService;
@RequestMapping(value = "/login/{name}", method = RequestMethod.GET)
public String login(@PathVariable("name") String name) {
System.out.println(name);
return "welcome to spring boot world!";
}
@RequestMapping(value = "/loginWithService/{name}", method = RequestMethod.GET)
public String loginWithService(@PathVariable("name") String name) {
System.out.println(name);
return loginService.login();
}
}
评论10
最新资源