package com.miaxis.pc;

import com.miaxis.common.core.controller.BaseController;
import com.miaxis.common.core.domain.Response;
import com.miaxis.common.core.page.ResponsePageInfo;
import com.miaxis.newgzpt.domain.GzptSchPayConfig;
import com.miaxis.newgzpt.dto.GzptSchPayConfigDTO;
import com.miaxis.newgzpt.dto.GzptSchPayConfigUpDTO;
import com.miaxis.newgzpt.service.IGzptSchPayConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 【订单信息】Controller
 *
 * @author miaxis
 * @date 2022-06-07
 */
@RestController
@RequestMapping("/config/info")
@Api(tags={"【PC-驾校配置】"})
public class PcSchPayConfigController extends BaseController{


    @Autowired
    private IGzptSchPayConfigService schPayConfigService;


    /**
     * 查询订单信息列表
     * @return
     */
    @GetMapping("/list")
    @ApiOperation("查询驾校合作配置信息列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
            @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
    })
    public ResponsePageInfo<GzptSchPayConfig> list(@ModelAttribute GzptSchPayConfigDTO spDTO){
        startPage();
        List<GzptSchPayConfig> list = schPayConfigService.selectSchPayConfigList(spDTO);
        return toResponsePageInfo(list);
    }

    /**
     * （测试专用）清除学员激活状态与会员信息接口
     */
    @GetMapping("/upSchPayConfig")
    @ApiOperation("更新驾校合作配置")
    public Response upSchPayConfig(GzptSchPayConfigUpDTO spDTO) throws Exception {
        schPayConfigService.updateSchPayConfigByJxbh(spDTO);
        return Response.success();
    }









}
