1. 程式人生 > 其它 >spring boot 註解

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.