package com.sunxung.factoring.web.financing;

import com.sunxung.factoring.entity.ResponseJson;
import com.sunxung.factoring.entity.financing.review.ReviewQuotaDisburseApproval;
import com.sunxung.factoring.service.financing.review.ReviewQuotaDisburseApprovalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description : 额度支用审批Controller
 * @Author : L.Jia
 * @Date: 2024-01-20 14:56
 */

@RestController
@RequestMapping("/reviewQuotaDisburseApproval")
public class ReviewQuotaDisburseApprovalController {

    @Autowired
    private ReviewQuotaDisburseApprovalService reviewQuotaDisburseApprovalService;

    /**
     * 跳转到额度支用审批处理页面
     */
    @GetMapping("/editPage")
    public Object add(Long id) {
        return new ResponseJson(reviewQuotaDisburseApprovalService.getToEditPageByDisburseId(id));
    }

    /**
     * 编辑额度支用审批信息
     */
    @PostMapping("/doEdit")
    public Object doEdit(@RequestBody ReviewQuotaDisburseApproval quotaDisburseApproval) {
        return reviewQuotaDisburseApprovalService.editReviewQuotaDisburseApproval(quotaDisburseApproval);
    }
}
