package com.red.circle.console.adapter.app.approval;


import com.red.circle.console.app.service.app.user.UserAccountStatusLogService;
import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.web.controller.BaseController;
import com.red.circle.other.inner.model.cmd.user.UserAccountStatusLogQryCmd;
import com.red.circle.other.inner.model.dto.user.ApprovalUserAccountStatusLogDTO;
import java.util.List;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 最近的审批
 *
 * @author pengliang
 * @since 2020-01-18
 */
@AllArgsConstructor
@RestController
@RequestMapping("/approval/user/account/status/log")
public class ApprovalUserAccountStatusLogRestController extends BaseController {

  private final UserAccountStatusLogService approvalUserAccountStatusLogService;

  /**
   * 分页列表.
   */
  @GetMapping("/page")
  public PageResult<ApprovalUserAccountStatusLogDTO> pageApprovalUserAccountStatusLog(
      UserAccountStatusLogQryCmd cmd) {
    return approvalUserAccountStatusLogService.pgeApprovalUserAccountStatusLog(cmd);
  }

  /**
   * 最近的审批列表.
   */
  @GetMapping("/latest")
  public List<ApprovalUserAccountStatusLogDTO> lastApprovalUserAccountStatusLog(
      Long beApprovalUser, Integer size) {
    return approvalUserAccountStatusLogService.lastApprovalUserAccountStatusLog(beApprovalUser, size);
  }

}
