package com.cool.store.controller;

import com.cool.store.exception.ApiException;
import com.cool.store.request.CreateQualifyVerifyReq;
import com.cool.store.request.FinishInterviewReq;
import com.cool.store.request.QualificationCallbackReq;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.FlowService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * @Author: young.yu
 * @Date: 2023-06-14  13:47
 * @Description: 流程相关
 */
@Api(tags = "流程相关接口")
@RestController
@RequestMapping({"/flow"})
public class FlowController {

    @Autowired
    private FlowService flowService;
    @PostMapping("/qualifyVerify/create")
    @ApiOperation("发起加盟商资质审核")
    public ResponseResult createQualifyVerify(@RequestBody CreateQualifyVerifyReq request) throws ApiException, IOException {
        flowService.createQualifyVerify(request);
        return ResponseResult.success();
    }

    @PostMapping("/qualificationReview/callback")
    @ApiOperation("加盟商资质审核流程信息回调接口")
    public ResponseResult qualificationCallback(@RequestBody QualificationCallbackReq request) throws ApiException {
        flowService.qualificationCallback(request);
        return ResponseResult.success();
    }

}
