package com.zjty.autotest.controller;

import com.zjty.autotest.pojo.sjq.common.AppHttpCodeEnum;
import com.zjty.autotest.pojo.sjq.common.ResponseResult;
import com.zjty.autotest.service.UploadCodeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;
@RequestMapping("/code")
@RestController
@Api(value = "上传源代码",description = "提供上传源代码")
public class UploadCodeController {

    @Autowired
    private UploadCodeService uploadCodeService;

    @PostMapping("/upload")
    @ApiOperation("上传接口")
    public ResponseResult singleFileUpload(@RequestParam("file") MultipartFile file){
        return uploadCodeService.uploadCodeFile(file);
    }
}
