package com.trade.client.accounts.receivepayment.controller;

import com.trade.client.accounts.receivepayment.service.ReceivePaymentService;
import com.trade.client.accounts.receivepayment.vo.ReceivePaymentDetailVo;
import com.trade.common.core.domain.ResponseResult;
import com.trade.common.core.page.GridPage;
import com.trade.service.finance.disbursement.dto.ReceivePaymentSearchDto;
import com.trade.service.finance.disbursement.vo.ReceivePaymentPageVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @description:
 * @Author: wanglang
 * @Date: 2024/10/31 17:25
 * @Version: 1.0
 */
@Api(tags = "我的收款接口", value = "我的收款接口")
@RestController
@RequestMapping("/receivePayment")
public class ReceivePaymentController {

    @Resource
    private ReceivePaymentService receivePaymentService;

    /**
     * 获取我的收款列表分页
     *
     * @param searchDto 我的收款列表分页信息条件
     * @return 我的收款列表分页信息
     */
    @ApiOperation(value = "获取我的收款列表分页", notes = "获取我的收款列表分页")
    @PostMapping("/get/page")
    public ResponseResult<GridPage<ReceivePaymentPageVo>> queryListByPage(
            @RequestBody ReceivePaymentSearchDto searchDto) {
        return ResponseResult.success(receivePaymentService.queryListByPage(searchDto));
    }

    /**
     * 获取我的收款详情
     *
     * @param id 收款id
     * @return 收款详情
     */
    @ApiOperation(value = "获取我的收款详情", notes = "获取我的收款详情")
    @GetMapping("/get/detail")
    public ResponseResult<ReceivePaymentDetailVo> queryDetailById(Long id) {
        return ResponseResult.success(receivePaymentService.queryDetailById(id));
    }
}
