BrandController.java 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package com.cdf.controller.back;
  2. import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  3. import com.cdf.common.PageInfo;
  4. import com.cdf.common.ResultData;
  5. import com.cdf.entity.Brand;
  6. import com.cdf.request.BaseRequest;
  7. import com.cdf.service.IBrandService;
  8. import org.springframework.beans.factory.annotation.Autowired;
  9. import org.springframework.web.bind.annotation.*;
  10. /**
  11. * <p>
  12. * 前端控制器
  13. * </p>
  14. *
  15. * @author
  16. * @since 2023-12-06
  17. */
  18. @RestController
  19. @RequestMapping("/back/brand")
  20. public class BrandController {
  21. @Autowired
  22. IBrandService brandService;
  23. @PostMapping("/list")
  24. public ResultData list(@RequestBody BaseRequest param){
  25. Page<Brand> page = brandService.page(new Page<>(param.getPageNum(), param.getPageSize()));
  26. return ResultData.ok(PageInfo.PageInfo(page));
  27. }
  28. @GetMapping("updateBrandInfo")
  29. public ResultData updateBrandInfo() throws Exception {
  30. new Runnable() {
  31. @Override
  32. public void run() {
  33. try {
  34. brandService.updateBrandInfo();
  35. } catch (Exception e) {
  36. throw new RuntimeException(e);
  37. }
  38. }
  39. }.run();
  40. return ResultData.ok();
  41. }
  42. }