package com.jianshui.web.controller.platform;

import com.jianshui.common.core.domain.AjaxResult;
import com.jianshui.platform.dto.TaxCalculateDTO;
import com.jianshui.platform.dto.TaxSwitchingDTO;
import com.jianshui.platform.service.TaxCalculateService;
import com.jianshui.platform.service.TaxSwitchingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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;

import java.util.List;

/**
 * @Author: kane
 * @Description: 税额税额计算控制类
 * @CreateTime: 2023-06-07  17:41
 * @Version: 1.0
 **/
@Api(tags = "金额税额计算",value = "金额税额计算")
@RestController
@RequestMapping("/platForm/taxCalculate")
public class TaxCalculateController {

    @Autowired
    private TaxCalculateService taxCalculateService;

    @Autowired
    private TaxSwitchingService taxSwitchingService;

    @ApiOperation("金额税额计算")
    @PostMapping("/calculate")
    public AjaxResult taxCalculate(@RequestBody TaxCalculateDTO taxCalculateDTO){
        return taxCalculateService.taxCalculate(taxCalculateDTO);
    }


    @ApiOperation("含税不含税切换")
    @PostMapping("/taxSwitching")
    public AjaxResult taxSwitching(@RequestBody List<TaxSwitchingDTO> dtos){
        return taxSwitchingService.taxswitching(dtos);
    }
}
