package com.yida.data.system.controller;

import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.system.UnionPayConfig;
import com.yida.data.common.core.utils.Asserts;
import com.yida.data.system.service.UnionPayConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 银联云闪付支付配置信息 Controller
 *
 * @author ZYJ
 * @date 2022/6/23
 */
@RestController
@RequiredArgsConstructor
@Api(tags = "银联云闪付支付配置信息(无鉴权)")
@RequestMapping("/in/unionPayConfig")
public class InUnionPayConfigController {

    private final UnionPayConfigService unionPayConfigService;

    @ApiOperation("根据部门查询银联云闪付支付配置")
    @GetMapping("/getUnionPayConfigByDept")
    public ResultBean<UnionPayConfig> getUnionPayConfigByDept(Long deptId) {
        Asserts.isNotNull(deptId, "部门不能为空");
        return ResultBean.buildSuccess(unionPayConfigService.getUnionPayConfigByDept(deptId));
    }

}
