spring boot 注解

@Api(value = "谢谢谢谢", tags = "惺惺惜惺惺")
@RestController
@RequestMapping(UrlConstant.TIKTOK + "store/live")
@RequiredArgsConstructor
public class StoreLiveController {

  private final StoreLiveService storeLiveService;
  private final TiktokRequest2Service tiktokRequest2Service;
  private final StoreService storeService;
  private final TiktokRequestService tiktokRequestService;

  @ApiOperation(value = "谢谢谢谢谢谢", tags = "v3.9.5")
  @PostMapping(value = "/list", produces = MediaType.APPLICATION_JSON_VALUE)
  //    @PermissionAccess(value = Permission.STORE_INFO_GOODS_LIST, cls =
  // DefaultPermissionMethod.class)
  public JsonMessage<ApiPagination<EsStoreLiveData, StoreRelationListVo>> getStoreLiveList(
      @RequestBody @Valid ApiPagination<EsStoreLiveData, StoreRelationListVo> pagination)
      throws IOException {
    List<EsStoreLiveData> list = storeLiveService.getStoreLiveList(pagination);
    return new JsonMessage<>(200, "", pagination);
  }

 

1.@RequiredArgsConstructor  替代 @Autowired注解 但是类必须用final 修饰

2.@RestController 是@controller和@ResponseBody 的结合

3.@Api: 用在请求的类上,表示对类的说明

  • tags="说明该类的作用,可以在前台界面上看到的注解"
  • value="该参数无意义,在UI界面上看不到,不需要配置

4.

posted @ 2022-05-12 15:53  今晚再打老虎  阅读(59)  评论(0)    收藏  举报