package shop.alien.lawyer.controller;

import io.swagger.annotations.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import shop.alien.entity.result.R;
import shop.alien.lawyer.service.AlipayZftCreateRecordService;

/**
 * 支付宝直付通进件创建记录
 */
@Slf4j
@Api(tags = {"律师平台-支付宝直付通进件"})
@ApiSort(25)
@CrossOrigin
@RestController
@RequestMapping("/lawyer/alipayZftCreateRecord")
@RequiredArgsConstructor
public class AlipayZftCreateRecordController {

    private final AlipayZftCreateRecordService alipayZftCreateRecordService;

    @ApiOperation("根据商户名称（law_firm）查询是否存在已填写支付宝二级商户账号的律师用户")
    @ApiOperationSupport(order = 1)
    @ApiImplicitParam(name = "merchantName", value = "商户名称", required = true, paramType = "query", dataType = "String")
    @GetMapping("/existsSuccessful")
    public R<Boolean> existsByMerchantName(@RequestParam("merchantName") String merchantName) {
        log.info("AlipayZftCreateRecordController.existsByMerchantName?merchantName={}", merchantName);
        return alipayZftCreateRecordService.existsByMerchantName(merchantName);
    }
}
