ReceiveDataController.java
1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package com.viontech.controller;
import com.alibaba.fastjson.JSONObject;
import com.viontech.service.adapter.IRedisService;
import com.viontech.vo.VideoVo;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class ReceiveDataController extends BaseController {
@Autowired
IRedisService iRedisService;
@PostMapping({"/recv/datas"})
@ResponseBody
public Object recvData(@RequestBody JSONObject data) {
Map<Object, Object> result = new HashMap<>(2);
this.iRedisService.recvData(data);
result.put("ecode", "200");
result.put("enote", "OK");
return result;
}
@PostMapping({"/recv/video"})
@ResponseBody
public Object recvVideo(VideoVo videoVo) {
Map<Object, Object> result = new HashMap<>(2);
try {
this.iRedisService.uploadVideo(videoVo);
} catch (Exception e) {
e.printStackTrace();
}
result.put("ecode", "200");
result.put("enote", "OK");
return result;
}
@PostMapping({"/recv/upload"})
@ResponseBody
public Object upload(VideoVo videoVo) {
Map<Object, Object> result = new HashMap<>(2);
result.put("ecode", "200");
result.put("enote", "OK");
return result;
}
}