package com.qianwen.mdc.controller.workshop; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.qianwen.mdc.common.OpResult; import com.qianwen.mdc.dto.workshop.WorkshopFullDTO; import com.qianwen.mdc.dto.workshop.WorkshopQueryDTO; import com.qianwen.mdc.service.sysaccount.AccountTokenService; import com.qianwen.mdc.service.workshop.WorkshopService; /** * 车间查询控制器 */ @RestController @CrossOrigin @RequestMapping(value = "/workshop") public class WorkshopQueryController { @Autowired private AccountTokenService accountTokenService; @Autowired private WorkshopService workshopService; public static final Logger logger = LoggerFactory.getLogger(WorkshopQueryController.class); @PostMapping(value = "/pageQuery") public OpResult> pageQuery(@RequestBody WorkshopQueryDTO dto) { try { return OpResult.success(workshopService.pageQuery(dto)); }catch(Exception e) { logger.error("车间分页查询异常",e); return OpResult.fail(e.getMessage()); } } }