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


import javax.servlet.http.HttpServletRequest;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;


import org.jeecg.modules.shop.commission.entity.PartnerCommission;
import org.jeecg.modules.shop.commission.entity.vo.CommissionCountVO;
import org.jeecg.modules.shop.commission.entity.vo.PartnerCommissionVO;
import org.jeecg.modules.shop.commission.service.IPartnerCommissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;


 /**
 * @Description: 合作伙伴佣金
 * @Author: jeecg-boot
 * @Date:   2025-07-15
 * @Version: V1.0
 */
@Api(tags="合作伙伴佣金")
@RestController
@RequestMapping("/partner/partnerCommission")
@Slf4j
public class PartnerCommissionController extends JeecgController<PartnerCommission, IPartnerCommissionService> {
	@Autowired
	private IPartnerCommissionService partnerCommissionService;
	
	/**
	 * 分页列表查询
	 *
	 * @param
	 * @param pageNo
	 * @param pageSize
	 * @param
	 * @return
	 */
	//@AutoLog(value = "合作伙伴佣金-分页列表查询")
	@ApiOperation(value="合作伙伴佣金-分页列表查询", notes="合作伙伴佣金-分页列表查询")
	@GetMapping(value = "/list")
	public Result<IPage<PartnerCommissionVO>> queryPageList(@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
															@RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
		IPage<PartnerCommissionVO> pageList = partnerCommissionService.pagList(pageNo, pageSize);
		return Result.OK(pageList);
	}

	 @ApiOperation(value="合作伙伴佣金-佣金统计", notes="合作伙伴佣金-佣金统计")
	 @GetMapping(value = "/count")
	 public Result<CommissionCountVO> moneyCount() {
		 CommissionCountVO count = partnerCommissionService.moneyCount();
		 return Result.OK(count);
	 }

	/**
	 * 通过id查询
	 *
	 * @param id
	 * @return
	 */
	//@AutoLog(value = "合作伙伴佣金-通过id查询")
	@ApiOperation(value="合作伙伴佣金-通过id查询", notes="合作伙伴佣金-通过id查询")
	@GetMapping(value = "/queryById")
	public Result<PartnerCommission> queryById(@RequestParam(name="id",required=true) String id) {
		PartnerCommission partnerCommission = partnerCommissionService.getById(id);
		if(partnerCommission==null) {
			return Result.error("未找到对应数据");
		}
		return Result.OK(partnerCommission);
	}



}
