package com.base.biz.controller.rpc;


import com.base.api.model.request.QueryLinkCountDTO;
import com.base.biz.model.dto.request.LinkCountDTO;
import com.base.biz.service.LinkCountService;
import com.base.orbit.web.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController

@RequestMapping("/rpc/linkCount")
public class LinkCountRpcController {

    @Autowired
    private LinkCountService linkCountService;

    @ApiOperation(value = "余量计算")
    @PostMapping("/count")
    public Object linkCount(@RequestBody QueryLinkCountDTO req) {
        LinkCountDTO linkCountDTO = new LinkCountDTO();
        BeanUtils.copyProperties(req, linkCountDTO);
        Double Margin = linkCountService.linkCount(linkCountDTO);
        return Margin;
    }
}
