springblade 新增api

阅读数:5 评论数:0

跳转到新版页面

分类

python/Java

正文

@RestController
@RequestMapping("api")
public class DemoController {

   @Autowired
   private BlogService service;

}

@RestController
@RequestMapping("api")
@AllArgsConstructor
public class DemoController {

   private BlogService service;

}

 

通过lombok的@AllArgsContructor,可以省去@Autowired注解的使用