package com.jianshui.web.controller.platform;

import com.jianshui.common.core.domain.AjaxResult;
import com.jianshui.invoice.domain.dto.FindRedWordDTO;
import com.jianshui.invoice.domain.dto.HXResponse;
import com.jianshui.platform.dto.invoicered.RedWordSelectionDTO;
import com.jianshui.platform.dto.invoicered.RedWordDTO;
import com.jianshui.platform.service.RedInformationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: kane
 * @Description: 红字信息相关接口
 * @CreateTime: 2023-06-21  15:06
 * @Version: 1.0
 **/
@Api(tags = "红字信息相关接口")
@RestController
@RequestMapping("/platForm/redInformation")
public class RedInformationController {

    @Autowired
    private RedInformationService redInformationService;

    @ApiOperation("红字信息选择")
    @PostMapping("/redWordSelection")
    public AjaxResult redWordSelection(@RequestBody RedWordSelectionDTO dto){
        return redInformationService.redWordSelection(dto);
    }


    @ApiOperation("红字信息提交")
    @PostMapping("/redWordSubmit")
    public AjaxResult redWordSubmit(@RequestBody RedWordDTO dto){
        return redInformationService.redWordSubmit(dto);
    }

    @ApiOperation("红字信息列表展示")
    @PostMapping("/findRedWord")
    public AjaxResult findRedWord(@RequestBody FindRedWordDTO dto){
        return redInformationService.findRedWord(dto);
    }

    @ApiOperation("红字信息明细展示")
    @GetMapping("/findRedWordDetail/{id}")
    public AjaxResult findRedWordDetail(@PathVariable Long id){
        return redInformationService.findRedWordDetail(id);
    }

    @ApiOperation("红字信息删除")
    @DeleteMapping("/deleteRedWord/{ids}")
    public AjaxResult deleteRedWord(@PathVariable Long[] ids){
        return redInformationService.deleteRedWord(ids);
    }

    @ApiOperation("红字信息修改")
    @PutMapping("/updateRedWord")
    public AjaxResult updateRedWord(@RequestBody RedWordDTO dto){
        return redInformationService.updateRedWord(dto);
    }

    @ApiOperation("红字信息上传")
    @GetMapping("/uploadRedWord/{id}")
    public HXResponse uploadRedWord(@PathVariable Long id){
        // TODO 暂未开发完成
        return redInformationService.uploadRedWord(id);
    }
}
