package org.jeecg.modules.shop.user.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.config.shiro.IgnoreAuth;
import org.jeecg.modules.shop.commission.entity.vo.CommissionCountVO;
import org.jeecg.modules.shop.commission.entity.vo.PartnerCommissionVO;
import org.jeecg.modules.shop.user.entity.PartnerUser;
import org.jeecg.modules.shop.user.entity.dto.UserInfoDTO;
import org.jeecg.modules.shop.user.entity.dto.UserLoginDTO;
import org.jeecg.modules.shop.user.entity.vo.DataCountVO;
import org.jeecg.modules.shop.user.entity.vo.PageListCostomerVO;
import org.jeecg.modules.shop.user.entity.vo.UserInfoVO;
import org.jeecg.modules.shop.user.entity.vo.UserLoginVO;
import org.jeecg.modules.shop.user.service.IPartnerUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;

/**
* @Description: partner_user
* @Author: jeecg-boot
* @Date:   2025-07-09
* @Version: V1.0
*/
@Api(tags="合作伙伴-合作伙伴工作台接口")
@RestController
@RequestMapping("/partner/userCenter")
@Slf4j
public class PartnerUserCenterController extends JeecgController<PartnerUser, IPartnerUserService> {
   @Autowired
   private IPartnerUserService partnerUserService;

    @ApiOperation(value="用户工作台-工作台六个数拒", notes="用户工作台-工作台六个数拒")
    @GetMapping(value = "/count")
    public Result<DataCountVO> dataCount(@RequestParam(name = "year", required = true) String year) {
        DataCountVO count = partnerUserService.dataCount(year);
        return Result.OK(count);
    }
    @ApiOperation(value="用户工作台-客户列表", notes="用户工作台-客户列表")
    @GetMapping(value = "/customerList")
    public Result<IPage<PageListCostomerVO>> customerList(@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
                                                          @RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
        IPage<PageListCostomerVO> pageList = partnerUserService.customerList(pageNo, pageSize);
        return Result.OK(pageList);
    }

    @ApiOperation(value="用户工作台-订单列表", notes="用户工作台-订单列表")
    @GetMapping(value = "/orderList")
    public Result<IPage<PageListCostomerVO>> orderList(@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
                                                          @RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
        IPage<PageListCostomerVO> pageList = partnerUserService.orderList(pageNo, pageSize);
        return Result.OK(pageList);
    }

}
