package com.red.circle.external.inner.endpoint.censor;

import com.red.circle.external.inner.endpoint.censor.api.CensorImageClientApi;
import com.red.circle.external.inner.model.dto.CensorImageResponseDTO;
import com.red.circle.external.inner.service.censor.CensorImageClientService;
import com.red.circle.framework.dto.ResultResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 图片安全鉴定.
 *
 * @author pengliang on 2023/10/17
 */
@Validated
@RestController
@RequestMapping(value = CensorImageClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class CensorImageClientEndpoint implements CensorImageClientApi {

  private final CensorImageClientService censorImageClientService;

  @Override
  public ResultResponse<CensorImageResponseDTO> auditing(String detectUrl) {
    return ResultResponse.success(censorImageClientService.auditing(detectUrl));
  }

}
