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

import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.app.inner.service.approval.ApprovalUserViolationHistoryClientService;
import com.red.circle.other.inner.endpoint.approval.api.ApprovalUserViolationHistoryClientApi;
import com.red.circle.other.inner.model.cmd.approval.ApprovalUserViolationHistoryQryCmd;
import com.red.circle.other.inner.model.dto.approval.ApprovalUserViolationHistoryDTO;
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 zongpubin on 2024/1/22
 */
@Validated
@RestController
@RequestMapping(value = ApprovalUserViolationHistoryClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class ApprovalUserViolationHistoryClientEndpoint implements
    ApprovalUserViolationHistoryClientApi {

  private final ApprovalUserViolationHistoryClientService approvalUserViolationHistoryClientService;

  @Override
  public ResultResponse<PageResult<ApprovalUserViolationHistoryDTO>> pageHistory(
      ApprovalUserViolationHistoryQryCmd query) {
    return ResultResponse.success(approvalUserViolationHistoryClientService.pageHistory(query));
  }
}
