VideoController.java
1.51 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
52
package com.bsth.controller.video;
import com.alibaba.fastjson.JSON;
import com.bsth.common.ResponseCode;
import com.bsth.entity.Business;
import com.bsth.entity.Line;
import com.bsth.entity.video.VideoTree;
import com.bsth.service.BusinessService;
import com.bsth.service.LineService;
import com.bsth.service.video.VideoService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
/**
* @author liujun
* @date 2024年07月01日 12:52
*/
@RestController
@Slf4j
@RequestMapping("video")
public class VideoController {
@Autowired
private VideoService videoService;
@GetMapping("/tree")
public Map<String, Object> combinationTree() {
Map<String, Object> result = new HashMap<>();
try {
List<VideoTree> trees = videoService.combinationTree();
result.put("status", ResponseCode.SUCCESS);
result.put("data", trees);
} catch (Exception e) {
log.error("查询视频树异常", e);
result.put("status", ResponseCode.ERROR);
}
return result;
}
@GetMapping("/tree1")
public String combinationTree1() {
List<VideoTree> trees = videoService.combinationTree();
return JSON.toJSONString(trees);
}
}