package com.jeequan.jeepay.pay.ctrl.openapi;

import com.jeequan.jeepay.pay.anno.OpenLabel;
import com.jeequan.jeepay.pay.ctrl.OpenApiController;
import com.jeequan.jeepay.pay.service.openapi.impl.MchApplymentApiService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * TODO
 *
 * @author deng
 * @since 2024/4/19
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/open/applyment")
public class MchApplymentController extends OpenApiController {

    private final MchApplymentApiService mchApplymentApiService;

    /**
     * 创建草稿商户，返回编辑的H5链接
     * @return
     */
    @OpenLabel
    @PostMapping(value = "/h5Data")
    public Object createApplymentUrl() {
        return mchApplymentApiService.createH5MchApplyment(getRQ());
    }

    /**
     * 查询商户信息
     * @return
     */
    @OpenLabel
    @PostMapping(value = "/queryApplymentInfo")
    public Object queryApplymentInfo() {
        return mchApplymentApiService.queryApplymentInfo(getRQ());
    }
}
