package co.yixiang.yshop.module.distributor.controller.app.distributorproduct;

import co.yixiang.yshop.framework.common.pojo.CommonResult;
import co.yixiang.yshop.framework.common.pojo.PageResult;
import co.yixiang.yshop.framework.security.core.annotations.PreAuthenticated;
import co.yixiang.yshop.module.distributor.controller.app.distributor.vo.AppDistributorOrderPageReqVO;
import co.yixiang.yshop.module.distributor.controller.app.distributorproduct.vo.AppDistributorProductRespVO;
import co.yixiang.yshop.module.distributor.controller.app.distributoruser.vo.AppDistributorUserCountRespVO;
import co.yixiang.yshop.module.distributor.controller.app.distributoruser.vo.AppDistributorUserPageReqVO;
import co.yixiang.yshop.module.distributor.dal.dataobject.distributororder.DistributorOrderDO;
import co.yixiang.yshop.module.distributor.dal.dataobject.distributoruser.DistributorUserDO;
import co.yixiang.yshop.module.distributor.service.distributor.DistributorFacade;
import co.yixiang.yshop.module.distributor.service.distributororder.DistributorOrderService;
import co.yixiang.yshop.module.product.api.product.dto.ProductPageReqVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
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;

import javax.annotation.Resource;

import static co.yixiang.yshop.framework.common.pojo.CommonResult.success;

@Slf4j
@RestController
@Tag(name = "APP - 分销商商品模块")
@RequestMapping("/app/distributor/product")
public class AppDistributorProductController {

    @Resource
    private DistributorFacade distributorFacade;

    // 获取可分销商品列表
    @PreAuthenticated
    @GetMapping("/page")
    @Operation(summary = "分销订单分页")
    public CommonResult<PageResult<AppDistributorProductRespVO>> getProductPage(ProductPageReqVO reqVO) {
        return success(distributorFacade.getProductPage(reqVO));
    }

}
