package com.red.circle.other.app.inner.endpoint.sys;

import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.app.inner.service.sys.ReportedUserClientService;
import com.red.circle.other.inner.endpoint.sys.api.ReportedUserClientApi;
import com.red.circle.other.inner.model.cmd.approval.ApprovalReportedCmd;
import com.red.circle.other.inner.model.cmd.sys.SysReportedQryCmd;
import com.red.circle.other.inner.model.dto.sys.SysReportedUserDTO;
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;

/**
 * <p>
 * 记录记录记录.
 * </p>
 *
 * @author pengshigang
 * @since 2021-10-26
 */
@Validated
@RestController
@RequestMapping(value = ReportedUserClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class ReportedUserClientEndpoint implements ReportedUserClientApi {

  private final ReportedUserClientService reportedUserClientService;

  @Override
  public ResultResponse<PageResult<SysReportedUserDTO>> pageSysReportedUser(
      SysReportedQryCmd sysReportedQuery) {
    return ResultResponse.success(reportedUserClientService.pageSysReportedUser(sysReportedQuery));
  }

  @Override
  public ResultResponse<Void> approvalReported(ApprovalReportedCmd cmd) {
    reportedUserClientService.approvalReported(cmd);
    return ResultResponse.success();
  }
}
