BrandController.java 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. package com.cdf.controller.back;
  2. import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  3. import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  4. import com.cdf.common.PageInfo;
  5. import com.cdf.common.ResultData;
  6. import com.cdf.entity.Brand;
  7. import com.cdf.entity.HotOutline;
  8. import com.cdf.request.BaseRequest;
  9. import com.cdf.request.BrandApiParam;
  10. import com.cdf.service.IBrandService;
  11. import com.cdf.service.impl.ExcelService;
  12. import org.springframework.beans.factory.annotation.Autowired;
  13. import org.springframework.web.bind.annotation.*;
  14. import javax.servlet.http.HttpServletRequest;
  15. import javax.servlet.http.HttpServletResponse;
  16. /**
  17. * <p>
  18. * 前端控制器
  19. * </p>
  20. *
  21. * @author
  22. * @since 2023-12-06
  23. */
  24. @RestController
  25. @RequestMapping("/back/brand")
  26. public class BrandController {
  27. @Autowired
  28. IBrandService brandService;
  29. @Autowired
  30. ExcelService excelService;
  31. @PostMapping("/list")
  32. public ResultData list(@RequestBody BrandApiParam param){
  33. return ResultData.ok(brandService.pageList(param));
  34. }
  35. @GetMapping("updateBrandInfo")
  36. public ResultData updateBrandInfo() throws Exception {
  37. new Runnable() {
  38. @Override
  39. public void run() {
  40. try {
  41. brandService.updateBrandInfo();
  42. } catch (Exception e) {
  43. throw new RuntimeException(e);
  44. }
  45. }
  46. }.run();
  47. return ResultData.ok();
  48. }
  49. @GetMapping("/downBrandExcel")
  50. public void downBrandExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
  51. excelService.downBrandExcel(request,response);
  52. }
  53. }