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

import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.app.inner.service.approval.ManagerApprovalNotPassClientService;
import com.red.circle.other.inner.endpoint.approval.api.ManagerApprovalNotPassClientApi;
import com.red.circle.other.inner.model.cmd.approval.TmpManagerApprovalCmd;
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/12/27
 */
@Validated
@RestController
@RequestMapping(value = ManagerApprovalNotPassClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class ManagerApprovalNotPassClientEndpoint implements ManagerApprovalNotPassClientApi {

  private final ManagerApprovalNotPassClientService managerApprovalNotPassClientService;

  @Override
  public ResultResponse<Void> approval(TmpManagerApprovalCmd cmd) {
    managerApprovalNotPassClientService.approval(cmd);
    return ResultResponse.success();
  }

}
