package com.cool.store.controller.webc;

import com.cool.store.request.OpenAcceptanceRequest;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.OpenAcceptanceInfoService;
import com.cool.store.vo.OpenAcceptanceInfoListVO;
import com.cool.store.vo.ShopAcceptanceVO;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author byd
 * @Date 2023/6/15 9:49
 * @Version 1.0
 */
@RestController
@RequestMapping("/mini/openAcceptanceInfo")
@Api(tags = "mini开业验收")
public class MiniOpenAcceptanceInfoController {

    @Resource
    OpenAcceptanceInfoService openAcceptanceInfoService;

    @GetMapping(path = "/openAcceptanceList")
    @ApiOperation("开业验收列表")
    public ResponseResult<PageInfo<OpenAcceptanceInfoListVO>> openAcceptanceList(OpenAcceptanceRequest openAcceptanceRequest) {
        return ResponseResult.success(openAcceptanceInfoService.openAcceptanceList(openAcceptanceRequest));
    }

    @GetMapping(path = "/acceptanceStageList")
    @ApiOperation("开业验收阶段结果列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "shopId", value = "店铺id", required = true)
    })
    public ResponseResult<ShopAcceptanceVO> acceptanceStageList(@RequestParam("shopId") Long shopId) {
        return ResponseResult.success(openAcceptanceInfoService.acceptanceStageList(shopId));
    }


}
