zoukankan      html  css  js  c++  java
  • springboot的注解

    1@RestController和@RestMapping是springMVC的注解,不是springboot的注解

    2@RestController=@Controller+@ResponseBody  ,ResponseBody是返回json类型的数据

    3@SpringBootApplication=@Configuration+@EnableAutoConfiguration+@ComponentScan

    4@GetMapping=@RequestMapping(Method=RequestMethod.GET)

    5@PostMapping=@RequestMapping(Method=RequestMethod.POST)

    6@PutMapping=@RequestMapping(Method=RequestMethod.PUT)

    7@DelsteMapping=@RequestMapping(Method=RequestMethod.DELETE)

    8jackson的处理和关闭

    指定字段不返回:@JsonIgore

    指定日期样式 @JsonFormat(pattern="yyyy-MM-dd hh:mm:ss",locale="zh",timezone="GMT+8")

    空字段不返回 @JsonInclude(Include.NON_NULL)

    指定别名:@JsonProperty

    可以通过ctrl+鼠标左键去查看对应的注解是怎么实现的,也可以自定义注解

  • 相关阅读:
    Emacs 使用YASnippet
    odbc备忘
    Emacs 矩形编辑
    ftp by libcurl
    emacsshell
    Emacs cnblogs 代码着色
    Emacs下的Man
    #include ""还是<>
    三种*
    应对Maze勒索攻击的最佳实践分享
  • 原文地址:https://www.cnblogs.com/zhushilai/p/13493457.html
Copyright © 2011-2022 走看看