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.SysNoticeMessageClient;
import com.red.circle.other.inner.model.cmd.sys.SysNoticeMessageCmd;
import com.red.circle.other.inner.model.cmd.sys.SysNoticeMessageQryCmd;
import com.red.circle.other.inner.model.dto.sys.SysNoticeMessageDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 系统公告通知消息 服务实现类.
 * </p>
 *
 * @author houyong
 * @since 2021-04-02
 */
@Service
@RequiredArgsConstructor
public class SysNoticeMessageServiceImpl implements SysNoticeMessageService {

  private final SysNoticeMessageClient noticeMessageClient;

  @Override
  public PageResult<SysNoticeMessageDTO> getNoticeMessage(SysNoticeMessageQryCmd query) {
    return ResponseAssert.requiredSuccess(noticeMessageClient.getNoticeMessage(query));
  }

  @Override
  public void addNoticeMessage(SysNoticeMessageCmd sysNoticeMessage) {
    ResponseAssert.requiredSuccess(noticeMessageClient.addNoticeMessage(sysNoticeMessage));
  }

  @Override
  public void updateNoticeMessage(SysNoticeMessageCmd sysNoticeMessage) {
    ResponseAssert.requiredSuccess(noticeMessageClient.updateNoticeMessage(sysNoticeMessage));
  }

  @Override
  public void offShelf(Long id, Boolean offShelf) {
    ResponseAssert.requiredSuccess(noticeMessageClient.offShelf(id, offShelf));
  }

  @Override
  public void announcement(Long id) {
    ResponseAssert.requiredSuccess(noticeMessageClient.announcement(id));
  }

  @Override
  public void deleteNoticeMessage(Long id) {
    ResponseAssert.requiredSuccess(noticeMessageClient.deleteNoticeMessage(id));
  }
}
