package com.yida.data.school.smart.controller;

import cn.hutool.json.JSONUtil;
import com.beust.jcommander.internal.Maps;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.smart.ConstructionPayNotifyDTO;
import com.yida.data.school.smart.service.EduGuideStepOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * 迎新订单 Controller(不鉴权)
 *
 * @author ZYJ
 * @date 2023/6/21
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("in/eduGuideStepOrder")
@Api(tags = "迎新订单后台api")
public class InEduGuideStepOrderController {

    private final EduGuideStepOrderService eduGuideStepOrderService;

    @ApiOperation("建行支付通知结果回调")
    @PostMapping("/constructionPayNotify")
    public String constructionPayNotify(ConstructionPayNotifyDTO dto) {
        log.info("建行支付通知结果回调, result: {}", dto.toString());
        eduGuideStepOrderService.constructionPayNotify(dto);
        return "success";
    }

    @GetMapping(value = "updateGuideRosterOrderStatus")
    @ApiOperation(value = "更新超时迎新订单状态")
    public ResultBean<String> updateGuideRosterOrderStatus() {
        eduGuideStepOrderService.updateGuideRosterOrderStatus();
        return ResultBean.buildSuccess();
    }
}
