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

import com.red.circle.framework.core.asserts.ResponseAssert;
import com.red.circle.framework.dto.PageResult;
import com.red.circle.other.inner.endpoint.dynamic.DynamicTagClient;
import com.red.circle.other.inner.model.cmd.dynamic.DynamicTagCmd;
import com.red.circle.other.inner.model.cmd.dynamic.PageDynamicTagQryCmd;
import com.red.circle.other.inner.model.dto.dynamic.DynamicTagDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 动态标签 服务类.
 * </p>
 *
 * @author pengshigang
 * @since 2022-4-15
 */

@Service
@RequiredArgsConstructor
public class DynamicTagServiceImpl implements DynamicTagService {

  private final DynamicTagClient dynamicTagClient;

  @Override
  public void addOrUpdate(DynamicTagCmd tag) {

    ResponseAssert.requiredSuccess(dynamicTagClient.addOrUpdate(tag));
  }


  @Override
  public PageResult<DynamicTagDTO> pageData(PageDynamicTagQryCmd query) {

    return ResponseAssert.requiredSuccess(dynamicTagClient.pageData(query));
  }
}
