whycrzh
2021-01-28 c8332186836b3dfe1fbd32d7bec7cd29a57e1888
src/main/java/com/fgkj/controller/MyFileController.java
@@ -6,6 +6,7 @@
import com.fgkj.util.*;
import com.google.gson.Gson;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.imageio.ImageIO;
@@ -21,7 +22,7 @@
@RequestMapping("myFile")
@RestController
@Api
@Api(tags = "myFile接口")
public class MyFileController{
   
@@ -37,6 +38,7 @@
   
   //上传文件
   @PostMapping("/uploadTestFile")
   @ApiOperation(notes = "",value="byInfo")
   public ServiceModel UploadTestFile(@RequestParam File[] file,String[] fileFileName,String battName){
      HttpServletResponse res = ActionUtil.getResponse();
      res.setHeader("Access-Control-Allow-Origin", "*");            //允许跨域访问
@@ -109,6 +111,7 @@
   }
   @PostMapping("uploadIphoneFile")
   @ApiOperation(notes = "",value="byInfo")
   public ServiceModel UploadIphoneFile(@RequestParam String filestr,String fname,String battname){
      HttpServletResponse res = ActionUtil.getResponse();
      res.setHeader("Access-Control-Allow-Origin", "*");            //允许跨域访问
@@ -183,6 +186,7 @@
   
   //上传机房视频接口
   @PostMapping("uploadStationFile")
   @ApiOperation(notes = "",value="上传机房视频接口")
   public ServiceModel uploadStationFile(@RequestBody BattInf binf,@RequestParam File[] file,String[] fileFileName){
      // BattInf binf = getGson().fromJson(json, BattInf.class);
      String fileRoot = "stationsrc";
@@ -212,7 +216,8 @@
    * 
    *    获取指定机房得资源
    */
   @GetMapping("stationSource")
   @PostMapping("stationSource")
   @ApiOperation(notes = "",value="获取指定机房得资源")
   public ServiceModel searchStationSource(@RequestBody BattInf binf){
      String fileRoot = "stationsrc";                                             //存放机房资源文件的文件夹
      // BattInf binf = getGson().fromJson(json, BattInf.class);
@@ -288,6 +293,7 @@
   
   //上传机房视频接口(手机端)
   @PostMapping("uploadStationFile4Mobile")
   @ApiOperation(notes = "",value="上传机房视频接口(手机端)")
   public ServiceModel uploadStationFile_mobile(@RequestBody BattInf binf,@RequestParam File[] file,String[] fileFileName){
      // BattInf binf = getGson().fromJson(json, BattInf.class);
      String fileRoot = "stationsrc";
@@ -456,6 +462,7 @@
     * @return
     */
    @GetMapping("readAllStation")
   @ApiOperation(notes = "",value="读取所有上传过图片和视频的机房id文件夹")
    public ServiceModel ReadAllStation() {
       String fileRoot = "stationsrc";
      ServiceModel model = new ServiceModel();   
@@ -486,6 +493,7 @@
     * @return
     */
    @DeleteMapping("file")
   @ApiOperation(notes = "",value="删除指定的资源文件")
    public ServiceModel deleteFile(@RequestBody MyFile myFile) {
       ServiceModel model = new ServiceModel();
       // MyFile myfile = getGson().fromJson(json, MyFile.class);
@@ -517,13 +525,13 @@
       return model;
    }
 /*
   public static void main(String[] args) {
      /*String filePath = "D:/test/a/a.txt";
      *//*String filePath = "D:/test/a/a.txt";
      //ActionUtil.createFileRootIFNotExist(filePath);
      
      File file = new File(filePath);
      System.out.println(ActionUtil.tojson(file));*/
      System.out.println(ActionUtil.tojson(file));*//*
      //GraphicsFile("我是鲁星伟","D:\\1.jpg","D:\\2.jpg",0,new Color(255,0,0),"JPG");
      BattMap_information binfmation=new BattMap_information();
      binfmation.setStationId("42000001");
@@ -535,5 +543,5 @@
      String filePath = "D:\\2.jpg";
      //String filename="2.jpg";
      GraphicsFile(binfmation,file,filePath);
   }
   }*/
}