1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- package com.cdf.controller.back;
- import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
- import com.cdf.common.PageInfo;
- import com.cdf.common.ResultData;
- import com.cdf.entity.Brand;
- import com.cdf.request.BaseRequest;
- import com.cdf.service.IBrandService;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- /**
- * <p>
- * 前端控制器
- * </p>
- *
- * @author
- * @since 2023-12-06
- */
- @RestController
- @RequestMapping("/back/brand")
- public class BrandController {
- @Autowired
- IBrandService brandService;
- @PostMapping("/list")
- public ResultData list(@RequestBody BaseRequest param){
- Page<Brand> page = brandService.page(new Page<>(param.getPageNum(), param.getPageSize()));
- return ResultData.ok(PageInfo.PageInfo(page));
- }
- @GetMapping("updateBrandInfo")
- public ResultData updateBrandInfo() throws Exception {
- new Runnable() {
- @Override
- public void run() {
- try {
- brandService.updateBrandInfo();
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- }.run();
- return ResultData.ok();
- }
- }
|