package com.om.controller.admin;


import com.om.entity.vo.PcbInfoVO;
import com.om.service.IPcbVersionDescribeService;
import com.om.service.IPcbVersionInfoService;
import com.om.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author bmmx
 * @since 2024-03-12
 */
@RestController
@RequestMapping("/pcb-version-info")
@Api(tags = "PCB模块")
@Slf4j
public class PcbVersionInfoController {

    @Resource
    IPcbVersionInfoService infoService;
    @ApiOperation("增加按钮")
    @PostMapping("/add")
    public Result add(@RequestBody PcbInfoVO pcbInfoVO){

        return infoService.add(pcbInfoVO);
    }
    @ApiOperation("删除pcb")
    @DeleteMapping("/delete/{id}")
    public Result delete(@PathVariable(name = "id") Integer id){

        return infoService.delete(id);
    }
    @ApiOperation("下载文件")
    @GetMapping("/downloadFile")
    public Result downloadFile(@RequestParam Integer id){

        return infoService.downloadFile(id);
    }
    @ApiOperation("修改pcb")
    @PostMapping("/edit")
    public Result edit(@RequestBody PcbInfoVO pcbInfoVO){

        return infoService.edit(pcbInfoVO);
    }

    @ApiOperation("分页查询PCB数据集合")
    @GetMapping("/getPageList")
    public Result getPageList(@RequestParam Integer pageIndex,
                              @RequestParam Integer pageSize,
                              @RequestParam String username){

        return infoService.getPageList(pageIndex,pageSize,username);
    }




}
