package com.czg.controller.admin;


import com.czg.order.entity.SysPrintData;
import com.czg.order.service.SysPrintDataService;
import com.czg.resp.CzgResult;
import com.mybatisflex.core.query.QueryWrapper;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 打印数据
 *
 * @author ww
 */
@RestController
@RequestMapping("/admin/printData")
public class SysPrintDataController {

    @Resource
    private SysPrintDataService sysPrintDataService;

    /**
     * 获取打印数据
     */
    @GetMapping
    public CzgResult<SysPrintData> getWareCount(@RequestParam Long shopId, @RequestParam Long dataId, @RequestParam String type) {
        return CzgResult.success(sysPrintDataService.getOne(new QueryWrapper()
                .eq(SysPrintData::getType, type)
                .eq(SysPrintData::getShopId, shopId)
                .eq(SysPrintData::getId, dataId)));
    }
}
