package com.red.circle.console.app.service.app.sys.pay;

import com.red.circle.framework.core.asserts.ResponseAssert;
import com.red.circle.framework.dto.PageResult;
import com.red.circle.order.inner.endpoint.PayChannelClient;
import com.red.circle.order.inner.model.cmd.SysPayChannelCmd;
import com.red.circle.order.inner.model.cmd.SysPayChannelQryCmd;
import com.red.circle.order.inner.model.dto.SysPayChannelDTO;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 支付渠道 服务实现类
 * </p>
 *
 * @author pengliang
 * @since 2021-11-29
 */
@Service
@RequiredArgsConstructor
public class SysPayChannelServiceImpl implements SysPayChannelService {

  private final PayChannelClient payChannelClient;

  @Override
  public PageResult<SysPayChannelDTO> pageChannel(SysPayChannelQryCmd query) {
    return ResponseAssert.requiredSuccess(payChannelClient.pageChannel(query));
  }

  @Override
  public List<SysPayChannelDTO> listChannel() {
    return ResponseAssert.requiredSuccess(payChannelClient.listChannel());
  }

  @Override
  public void addChannel(SysPayChannelCmd param) {
    ResponseAssert.requiredSuccess(payChannelClient.addChannel(param));
  }

  @Override
  public void updateChannel(SysPayChannelCmd param) {
    ResponseAssert.requiredSuccess(payChannelClient.updateChannel(param));
  }

}
