提交 89dbd7bf authored 作者: chaoyanjun's avatar chaoyanjun

--no commit message

上级 b1d12603
......@@ -19,7 +19,9 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
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 com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
......@@ -60,7 +62,7 @@ public class LiveController {
@ApiOperation(value="创建直播")
@PostMapping(value="/save")
public CallBack<String> save(@RequestBody SaveOrUpdateLiveForm entity,HttpServletRequest request){
public CallBack<String> save(@RequestBody SaveOrUpdateLiveForm entity,@RequestParam("image") MultipartFile image,@RequestParam("file") MultipartFile file){
Live live = new Live();
BeanUtils.copyProperties(entity, live);
live.setLiveTime(Timestamp.valueOf(entity.getLiveTime()).getTime()/1000);
......@@ -85,13 +87,8 @@ public class LiveController {
liveService.updateByPrimaryKeySelective(live);
LiveImageForm f = new LiveImageForm();
f.setWebinar_id(Integer.parseInt(data));
try {
Map<String, String> map = HttpsUtils.reciveImageAndParams(request);
f.setMap(map);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
f.setImage(image);
f.setFile(file);
// 设置直播封面
MicroRoarReturn create = create(f,"image");
if ("200".equals(create.getCode())) {
......
......@@ -2,6 +2,8 @@ package com.zrqx.live.commons.form;
import java.util.Map;
import org.springframework.web.multipart.MultipartFile;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -14,6 +16,8 @@ public class LiveImageForm {
@ApiModelProperty("直播id")
private Integer webinar_id;
@ApiModelProperty("文件/图片流")
private Map<String, String> map;
@ApiModelProperty("图片流")
private MultipartFile file;
@ApiModelProperty("图片流")
private MultipartFile image;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论