package com.om.controller.admin;


import com.om.entity.vo.SDKInfoVO;
import com.om.entity.vo.SDKInfoVO;
import com.om.service.ISdkVersionInfoService;
import com.om.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author bmmx
 * @since 2024-03-19
 */
@RestController
@RequestMapping("/sdk-version-info")
@Api(tags = "SDK模块")
public class SdkVersionInfoController {

    @Resource
    ISdkVersionInfoService infoService;
    @ApiOperation("增加按钮")
    @PostMapping("/add")
    public Result add(@RequestBody SDKInfoVO sdkInfoVO){

        return infoService.add(sdkInfoVO);
    }
    @ApiOperation("删除sdk")
    @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("修改sdk")
    @PostMapping("/edit")
    public Result edit(@RequestBody SDKInfoVO sdkInfoVO){

        return infoService.edit(sdkInfoVO);
    }

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

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

}
