package com.inkasso.factoring.ledgermanagement.web;

import com.inkasso.adapter.response.ResponseData;
import com.inkasso.factoring.ledgermanagement.service.LedgerAccountBasicInfoService;
import com.inkasso.factoring.settlement.entity.SearchBusiness;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description : 分账管理控制层
 * @Author : L.Jia
 * @Date: 2024-03-23 10:28
 */

@RestController
@RequestMapping("/ledger")
public class LedgerController {

    @Autowired
    private LedgerAccountBasicInfoService ledgerAccountBasicInfoService;

    /**
     * 列表页查询
     */
    @PostMapping(value = "/doList")
    public Object doList(@RequestBody SearchBusiness search) {
        return ResponseData.success(ledgerAccountBasicInfoService.list(search));
    }

    /**
     * 分账查看
     *
     * @param id 分账管理Id
     * @return
     */
    @GetMapping("/doView")
    public Object doView(Long id, Long supplierId) {
        return ResponseData.success(ledgerAccountBasicInfoService.getView(id, supplierId));
    }
}
