| | |
| | | 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; |
| | |
| | | |
| | | @RequestMapping("myFile") |
| | | @RestController |
| | | @Api |
| | | @Api(tags = "myFile接口") |
| | | public class MyFileController{ |
| | | |
| | | |
| | |
| | | |
| | | //上传文件 |
| | | @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", "*"); //允许跨域访问 |
| | |
| | | } |
| | | |
| | | @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", "*"); //允许跨域访问 |
| | |
| | | |
| | | //上传机房视频接口 |
| | | @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"; |
| | |
| | | * |
| | | * 获取指定机房得资源 |
| | | */ |
| | | @GetMapping("stationSource") |
| | | @PostMapping("stationSource") |
| | | @ApiOperation(notes = "",value="获取指定机房得资源") |
| | | public ServiceModel searchStationSource(@RequestBody BattInf binf){ |
| | | String fileRoot = "stationsrc"; //存放机房资源文件的文件夹 |
| | | // BattInf binf = getGson().fromJson(json, BattInf.class); |
| | |
| | | |
| | | //上传机房视频接口(手机端) |
| | | @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"; |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("readAllStation") |
| | | @ApiOperation(notes = "",value="读取所有上传过图片和视频的机房id文件夹") |
| | | public ServiceModel ReadAllStation() { |
| | | String fileRoot = "stationsrc"; |
| | | ServiceModel model = new ServiceModel(); |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("file") |
| | | @ApiOperation(notes = "",value="删除指定的资源文件") |
| | | public ServiceModel deleteFile(@RequestBody MyFile myFile) { |
| | | ServiceModel model = new ServiceModel(); |
| | | // MyFile myfile = getGson().fromJson(json, MyFile.class); |
| | |
| | | |
| | | 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"); |
| | |
| | | String filePath = "D:\\2.jpg"; |
| | | //String filename="2.jpg"; |
| | | GraphicsFile(binfmation,file,filePath); |
| | | } |
| | | }*/ |
| | | } |