SceneUploadController.java 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package com.fdkankan.scene.controller;
  2. import com.fdkankan.common.controller.BaseController;
  3. import com.fdkankan.scene.service.ISceneUploadService;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.web.bind.annotation.RequestMapping;
  6. import org.springframework.web.bind.annotation.RequestMethod;
  7. import org.springframework.web.bind.annotation.RequestParam;
  8. import org.springframework.web.bind.annotation.RestController;
  9. import org.springframework.web.multipart.MultipartFile;
  10. @RestController
  11. @RequestMapping("/api/scene/upload")
  12. public class SceneUploadController extends BaseController {
  13. @Autowired
  14. private ISceneUploadService sceneUploadService;
  15. /**
  16. * 上传图片到oss,base64
  17. * base64 图片base64
  18. * fileName 文件名称
  19. * blzType 业务类型
  20. * files 文件
  21. * num 场景码
  22. * type 0添加,1替换
  23. */
  24. @RequestMapping(value = "/files", method = RequestMethod.POST)
  25. public String uploads(@RequestParam(value = "base64",required = false) String base64,
  26. @RequestParam(value = "fileName",required = false) String fileName,
  27. @RequestParam(value = "blzType",required = false) String blzType,
  28. @RequestParam(value = "files",required = false) MultipartFile[] files,
  29. @RequestParam(value = "num",required = false) String num,
  30. @RequestParam(value = "type",required = false,defaultValue = "0") Integer type) throws Exception {
  31. return sceneUploadService.uploads(base64,fileName,blzType,files,num,type,getToken());
  32. }
  33. }