package com.red.circle.external.inner.service.censor.impl;

import com.red.circle.component.censor.api.AuditingRequest;
import com.red.circle.component.censor.api.ICensorImageService;
import com.red.circle.external.inner.convertor.CensorImageInnerConvertor;
import com.red.circle.external.inner.model.dto.CensorImageResponseDTO;
import com.red.circle.external.inner.service.censor.CensorImageClientService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 图片安全鉴定.
 *
 * @author pengliang on 2023/10/17
 */
@Service
@RequiredArgsConstructor
public class CensorImageClientServiceImpl implements CensorImageClientService {

  private final ICensorImageService censorImageService;
  private final CensorImageInnerConvertor censorImageInnerConvertor;

  @Override
  public CensorImageResponseDTO auditing(String detectUrl) {
    AuditingRequest request = new AuditingRequest();
    request.setDetectUrl(detectUrl);
    return censorImageInnerConvertor.toCensorImageResponseDTO(censorImageService.auditing(request));
  }

}
