1、@RestController:注解Controller,则Controller中的方法无法返回jsp页面,或者html,配置的视图解析器 InternalResourceViewResolver不起作用,返回的内容就是Return 里的内容。

 

eg:public Map<String,Object> test(){
        taskSendService.sendWxbWeibo();
        Map<String,Object> map = new HashMap<String, Object>();
        map.put("status", "success");
        return map;

    }

 

2、@autowired注解:spring可以自动帮你把bean里面引用的对象的setter/getter方法省略,它会自动帮你set/get

3、@RequestMapping 来映射请求,也就是通过它来指定控制器可以处理哪些URL请求

4、@Scheduled注解为定时任务

5、@GetMapping 用于将HTTP GET请求映射到特定处理程序方法的注释。

 

相关文章:

  • 2022-12-23
  • 2021-06-07
  • 2021-05-19
  • 2021-05-25
  • 2021-10-08
  • 2021-12-01
  • 2022-01-18
  • 2021-12-15
猜你喜欢
  • 2021-05-27
  • 2021-12-26
  • 2021-09-24
  • 2021-06-30
  • 2021-08-11
  • 2022-12-23
相关资源
相似解决方案