package com.example.springboottest; import org.apache.catalina.User; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.web.bind.annotation.*; import pojo.user; import java.lang.reflect.Array; import java.time.LocalDateTime; import java.util.Arrays; import java.util.List; @RestController public class hellocontroller { @RequestMapping("/hello") public String hello(){ System.out.println("hello wwc"); return "hellowwc"; } @RequestMapping("/wzy") public String wzy(String name,Integer age){ System.out.println(name+":"+age); return "ok"; } @RequestMapping("/wzypojo") public String wzypojo(user user){ System.out.println(user); return "ok"; } @RequestMapping("/su") public String su(@RequestParam List<String> hobby){ System.out.println(hobby); return "ok"; } @RequestMapping("/data") public String data(@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime time){ System.out.println(time); return "ok"; } @RequestMapping("/js") public String jsp(@RequestBody user user){ System.out.println(user); return "ok"; } @RequestMapping("/ro/{id}") public String jss(@PathVariable Integer id){ System.out.println(id); return "ok"; } }
标签:10.3,return,请求,System,import,out,public,String From: https://www.cnblogs.com/zeyangshuaige/p/17741681.html