package com.jwipc.sys.controller.pc;

import com.jwipc.page.PageView;
import com.jwipc.security.LoginUtil;
import com.jwipc.sys.logic.ProductLogic;
import com.jwipc.sys.model.query.DealtInfoQuery;
import com.jwipc.sys.model.query.ProductQuery;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static com.jwipc.sys.constant.ModuleConst.MODULE_ROOT;

/**
 * @author shenyang.ou
 * @date 2024/2/3 22:50
 * @desc 物料
 */
@RestController
@RequestMapping(MODULE_ROOT + "/product/rest")
@RequiredArgsConstructor
public class ProductRestController {
    private final ProductLogic productLogic;
    /**
     * 列表
     *
     * @param query
     * @return
     */
    @RequestMapping("/list")
    public PageView list(ProductQuery query) {
        query.setUserId(LoginUtil.getUserId());
        return productLogic.findByPage(query);
    }
}
