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

import com.red.circle.framework.core.asserts.ResponseAssert;
import com.red.circle.other.inner.endpoint.user.region.RegionAssistConfigClient;
import com.red.circle.other.inner.model.cmd.user.RegionAssistConfigQryCmd;
import com.red.circle.other.inner.model.cmd.user.SysRegionAssistCmd;
import com.red.circle.other.inner.model.dto.user.reigon.SysRegionAssistConfigDTO;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 区域.
 *
 * @author pengshigang on 2022/12/5
 */
@Service
@RequiredArgsConstructor
public class SysRegionAssistConfigBackServiceImpl implements SysRegionAssistConfigBackService {

  private final RegionAssistConfigClient regionAssistConfigClient;

  @Override
  public void add(SysRegionAssistCmd config) {
    ResponseAssert.requiredSuccess(regionAssistConfigClient.add(config));
  }

  @Override
  public void update(SysRegionAssistCmd config) {
    ResponseAssert.requiredSuccess(regionAssistConfigClient.update(config));
  }

  @Override
  public void deleteById(String id, Long updateUser) {
    ResponseAssert.requiredSuccess(regionAssistConfigClient.deleteById(id, updateUser));
  }

  @Override
  public List<SysRegionAssistConfigDTO> listByCondition(RegionAssistConfigQryCmd query) {
    return ResponseAssert.requiredSuccess(regionAssistConfigClient.listByCondition(query));
  }

}
