package com.yida.data.system.controller;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.system.ConstructionPayConfig;
import com.yida.data.common.core.entity.system.UnionPayConfig;
import com.yida.data.common.core.utils.Asserts;
import com.yida.data.system.service.ConstructionPayConfigService;
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 2023/6/19
 */
@RestController
@RequiredArgsConstructor
@Api(tags = "建行学习支付配置信息(无鉴权)")
@RequestMapping("/in/constructionPayConfig")
public class InConstructionPayConfigController {

    private final ConstructionPayConfigService constructionPayConfigService;

    @ApiOperation("根据部门查询建行支付配置")
    @GetMapping("/getConstructionPayConfigByDept")
    public ResultBean<ConstructionPayConfig> getConstructionPayConfigByDept(Long deptId) {
        Asserts.isNotNull(deptId, "部门不能为空");
        return ResultBean.buildSuccess(constructionPayConfigService.getOne(Wrappers.lambdaQuery(new ConstructionPayConfig())
                .eq(ConstructionPayConfig::getDeptId, deptId)));
    }

}
