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

import java.util.Arrays;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;

import lombok.extern.slf4j.Slf4j;

import org.jeecg.modules.shop.order.entity.PartnerOrder;
import org.jeecg.modules.shop.order.entity.query.queryList;
import org.jeecg.modules.shop.order.entity.vo.PartnerOrderVO;
import org.jeecg.modules.shop.order.service.IPartnerOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;

 /**
 * @Description: 合作伙伴订单
 * @Author: jeecg-boot
 * @Date:   2025-07-16
 * @Version: V1.0
 */
@Api(tags="合作伙伴订单")
@RestController
@RequestMapping("/partner/partnerOrder")
@Slf4j
public class PartnerOrderController extends JeecgController<PartnerOrder, IPartnerOrderService> {
	@Autowired
	private IPartnerOrderService partnerOrderService;
	
	/**
	 * 分页列表查询
	 *
	 * @param
	 * @param pageNo
	 * @param pageSize
	 * @param req
	 * @return
	 */
	//@AutoLog(value = "合作伙伴订单-分页列表查询")
	@ApiOperation(value="合作伙伴订单-分页列表查询", notes="合作伙伴订单-分页列表查询")
	@GetMapping(value = "/list")
	public Result<IPage<PartnerOrderVO>> queryPageList(queryList query,
													   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
													   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
													   HttpServletRequest req) {
		IPage<PartnerOrderVO> pageList = partnerOrderService.queryPageList(query,pageNo, pageSize);
		return Result.OK(pageList);
	}
	

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



}
