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.SysWeekStarGroupClient;
import com.red.circle.other.inner.model.cmd.sys.SysWeekStarGroupAddParamCmd;
import com.red.circle.other.inner.model.cmd.sys.SysWeekStarGroupQryCmd;
import com.red.circle.other.inner.model.dto.sys.SysWeekStarGroupDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 添加周星分组数据
 *
 * @author zongpubin on 2023/11/3
 */

@Service
@RequiredArgsConstructor
public class SysWeekStarGroupServiceImpl implements SysWeekStarGroupService {

  private final SysWeekStarGroupClient weekStarGroupClient;

  @Override
  public PageResult<SysWeekStarGroupDTO> getPage(SysWeekStarGroupQryCmd query) {
    return ResponseAssert.requiredSuccess(weekStarGroupClient.getPage(query));
  }

  @Override
  public void addGroup(SysWeekStarGroupAddParamCmd param) {
    ResponseAssert.requiredSuccess(weekStarGroupClient.addGroup(param));
  }

  @Override
  public void deleteAndAssociateGroup(Long id) {
    ResponseAssert.requiredSuccess(weekStarGroupClient.deleteAndAssociateGroup(id));
  }
}
