package com.zfire.mall.manager.zfire.test;

import cn.hutool.core.lang.TypeReference;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

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

public class TestController {


//    @ZfireList
//    @PostMapping("/list")
//    @ApiOperation("管理列表")
//    public ResponseHelper<IPage<BaseManageBean>> list(
//            @RequestBody ZfireParamBean zfireParamBean
//    ) throws RemoteServiceException {
//        ZfireParamBean zfireParam = FieldUtils.supplyParam(zfireParamBean);
//        IPage<BaseManageBean> stockBeanIPage = baseManageLogic.manageList(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam);
//        return ResponseHelper.success(stockBeanIPage, new TypeReference<BaseManageBean>() {});
//    }


//    public IPage<BaseManageBean> manageList(Page page, ZfireParamBean zfireParam) {
//        return baseManageMapper.manageList(page, zfireParam);
//    }

/*    IPage<BaseManageBean> manageList(IPage page, @Param("ex") ZfireParamBean zfireParam);   */

/*    select * FROM parts_base_manage ${ex.query} AND del = 0 ${ex.orderBy}*/


//    @PostMapping("/list/export")
//    @ApiOperation("管理列表导出")
//    public void listExport(
//            @RequestBody ZfireParamBean zfireParamBean,
//            HttpServletRequest request,
//            HttpServletResponse response
//    ) throws Exception {
//        //1.组装查询条件
//        ZfireParamBean zfireParam = FieldUtils.supplyParam(zfireParamBean);
//        //2.查询要导出的内容
//        IPage<BaseManageBean> stockBeanIPage = baseManageLogic.manageList(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam);
//        //3.导出
//        FieldUtils.exportData(stockBeanIPage.getRecords(),zfireParam.getExportFields(),request,response);
//    }

}
