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

import com.red.circle.framework.core.asserts.ResponseAssert;
import com.red.circle.framework.dto.PageResult;
import com.red.circle.other.inner.endpoint.sys.SysGiftPackClient;
import com.red.circle.other.inner.model.cmd.sys.GiftPackQryCmd;
import com.red.circle.other.inner.model.dto.sys.SysGiftPackDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 礼包
 *
 * @author zongpubin on 2023/11/1
 */
@Service
@RequiredArgsConstructor
public class SysGiftPackServiceImpl implements SysGiftPackService {

  private final SysGiftPackClient giftPackClient;

  @Override
  public PageResult<SysGiftPackDTO> getGiftPackInfo(GiftPackQryCmd query) {
    return ResponseAssert.requiredSuccess(giftPackClient.getGiftPackInfo(query));
  }

  @Override
  public void addGiftPack(SysGiftPackDTO sysGiftPackDTO) {
    ResponseAssert.requiredSuccess(giftPackClient.addGiftPack(sysGiftPackDTO));
  }

  @Override
  public void updateGiftPack(SysGiftPackDTO sysGiftPackDTO) {
    ResponseAssert.requiredSuccess(giftPackClient.updateGiftPack(sysGiftPackDTO));
  }

  @Override
  public void deleteGiftPack(Long id) {
    ResponseAssert.requiredSuccess(giftPackClient.deleteGiftPack(id));
  }
}
