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

import com.red.circle.framework.core.asserts.ResponseAssert;
import com.red.circle.framework.dto.PageResult;
import com.red.circle.other.inner.model.cmd.user.BeautifulNumberQryCmd;
import com.red.circle.other.inner.model.cmd.user.UserBeautifulNumberCmd;
import com.red.circle.other.inner.model.dto.user.BeautifulNumberDTO;
import com.red.circle.other.inner.endpoint.user.user.UserBeautifulNumberApplyClient;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 房间靓号 服务实现类.
 * </p>
 *
 * @author houyong
 * @since 2021-03-31
 */
@Service
@RequiredArgsConstructor
public class UserBeautifulNumberServiceImpl implements
    UserBeautifulNumberService {

  private final UserBeautifulNumberApplyClient userBeautifulNumberApplyClient;

  @Override
  public PageResult<BeautifulNumberDTO> pageBeautifulNumber(BeautifulNumberQryCmd query) {
    return ResponseAssert.requiredSuccess(
        userBeautifulNumberApplyClient.pageBeautifulNumber(query));
  }

  @Override
  public void updateBeautifulNumber(UserBeautifulNumberCmd cmd) {
    ResponseAssert.requiredSuccess(userBeautifulNumberApplyClient.updateBeautifulNumber(cmd));
  }

  @Override
  public void addBeautifulNumber(UserBeautifulNumberCmd cmd) {
    ResponseAssert.requiredSuccess(userBeautifulNumberApplyClient.addBeautifulNumber(cmd));
  }

  @Override
  public void deleteBeautifulNumber(Long id) {
    ResponseAssert.requiredSuccess(userBeautifulNumberApplyClient.deleteBeautifulNumber(id));
  }

}
