AlbumFeignClient.java 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package com.atguigu.tingshu.album;
  2. import com.atguigu.tingshu.album.impl.AlbumDegradeFeignClient;
  3. import com.atguigu.tingshu.common.result.Result;
  4. import com.atguigu.tingshu.model.album.AlbumInfo;
  5. import com.atguigu.tingshu.model.album.BaseCategory1;
  6. import com.atguigu.tingshu.model.album.BaseCategory3;
  7. import com.atguigu.tingshu.model.album.BaseCategoryView;
  8. import com.atguigu.tingshu.vo.album.AlbumStatVo;
  9. import org.springframework.cloud.openfeign.FeignClient;
  10. import org.springframework.web.bind.annotation.GetMapping;
  11. import org.springframework.web.bind.annotation.PathVariable;
  12. import java.util.List;
  13. /**
  14. * <p>
  15. * 专辑模块远程调用Feign接口
  16. * </p>
  17. *
  18. * @author atguigu
  19. */
  20. @FeignClient(value = "service-album",path = "api/album",fallback = AlbumDegradeFeignClient.class)
  21. public interface AlbumFeignClient {
  22. /**
  23. * 查询所有一级分类列表
  24. *
  25. * @return
  26. */
  27. @GetMapping("/category/findAllCategory1")
  28. public Result<List<BaseCategory1>> getAllCategory1();
  29. @GetMapping("/albumInfo/getAlbumInfo/{id}")
  30. public Result<AlbumInfo> getAlbumInfo(@PathVariable("id") Long id);
  31. /**
  32. * 根据三级分类ID查询分类信息
  33. * @param category3Id
  34. * @return
  35. */
  36. @GetMapping("/category/getCategoryView/{category3Id}")
  37. public Result<BaseCategoryView> getCategoryView(@PathVariable("category3Id") Long category3Id);
  38. @GetMapping("/category/findTopBaseCategory3/{category1Id}")
  39. public Result<List<BaseCategory3>> findTopBaseCategory3(@PathVariable("category1Id") Long category1Id);
  40. /**
  41. * 根据专辑ID查询专辑统计信息
  42. * @param albumId
  43. * @return
  44. */
  45. @GetMapping("/albumInfo/getAlbumStatVo/{albumId}")
  46. public Result<AlbumStatVo> getAlbumStatVo(@PathVariable("albumId") Long albumId);
  47. }