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.PayApplicationClient;
import com.red.circle.order.inner.model.cmd.SysPayApplicationCommodityCmd;
import com.red.circle.order.inner.model.cmd.SysPayApplicationCommodityQryCmd;
import com.red.circle.order.inner.model.dto.SysPayApplicationCommodityDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 应用商品 服务实现类
 * </p>
 *
 * @author pengliang
 * @since 2021-11-29
 */
@Service
@RequiredArgsConstructor
public class SysPayApplicationCommodityServiceImpl implements
    SysPayApplicationCommodityService {

  private final PayApplicationClient payApplicationClient;

  @Override
  public PageResult<SysPayApplicationCommodityDTO> pageCommodity(
      SysPayApplicationCommodityQryCmd query) {
    return ResponseAssert.requiredSuccess(payApplicationClient.pageCommodity(query));
  }

  @Override
  public void addOrUpdateCommodity(SysPayApplicationCommodityCmd param) {
    ResponseAssert.requiredSuccess(payApplicationClient.addOrUpdateCommodity(param));
  }

  @Override
  public void switchShelf(Long id, Boolean shelf) {
    ResponseAssert.requiredSuccess(payApplicationClient.switchShelf(id, shelf));
  }

}
