12345678910111213141516171819202122232425262728293031323334353637 |
- package com.fdkankan.scene.controller;
- import com.fdkankan.common.controller.BaseController;
- import com.fdkankan.scene.service.ISceneUploadService;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import org.springframework.web.bind.annotation.RequestParam;
- import org.springframework.web.bind.annotation.RestController;
- import org.springframework.web.multipart.MultipartFile;
- @RestController
- @RequestMapping("/api/scene/upload")
- public class SceneUploadController extends BaseController {
- @Autowired
- private ISceneUploadService sceneUploadService;
- /**
- * 上传图片到oss,base64
- * base64 图片base64
- * fileName 文件名称
- * files 文件
- * num 场景码
- * type 0添加,1替换
- */
- @RequestMapping(value = "/files", method = RequestMethod.POST)
- public String uploads(@RequestParam(value = "base64",required = false) String base64,
- @RequestParam(value = "fileName",required = false) String fileName,
- @RequestParam(value = "files",required = false) MultipartFile[] files,
- @RequestParam(value = "num",required = false) String num,
- @RequestParam(value = "type",required = false,defaultValue = "0") Integer type) throws Exception {
- return sceneUploadService.uploads(base64,fileName,files,num,type,getToken());
- }
- }
|