派生自 projectDept/qhighschool

yn147
2023-11-23 42c48ce1d64e941d28c7bfe4093f9659e77bd523
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package com.qxueyou.scc.stucontroller;
 
import java.util.Date;
import java.util.List;
 
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 com.qxueyou.scc.base.model.Result;
import com.qxueyou.scc.base.util.CollectionUtils;
import com.qxueyou.scc.base.util.QBeanUtils;
import com.qxueyou.scc.teach.res.model.Res;
import com.qxueyou.scc.teach.res.model.ResLib;
import com.qxueyou.scc.teach.res.service.IResService;
 
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
 
/**
 * 学习端 资源控制器
 * 
 * @author chenjunliang
 *
 */
@Api(tags= "课件接口-学员端")
@RestController
@RequestMapping(value = "/stu/res")
public class StuResController {
    
    @Autowired
    IResService resService;
    
    /**
     * 获取资源列表
     * 
     * @param classId
     *            班级id
     * @param limit
     *            每页显示几条
     * @param pageNum
     *            页码
     */
    @ApiOperation(value = "获取资源列表", notes = "")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "classId", value = "班级id", required = true, paramType="query", dataType = "String")
    })
    @GetMapping(value = "getResLst")
    public Result getResLst(String classId, Integer limit, Integer pageNum) {
 
        List<Res> resLst = resService.listResByLib(ResLib.OWNNER_TYPE_CLASS, classId, "", limit, pageNum, "");
        System.out.println(resLst);
        return new Result(true, "success",
                CollectionUtils.newObjectMap("resCount",
                        resService.listResCountByLib(ResLib.OWNNER_TYPE_CLASS, classId, "", ""), "resLst",
                        QBeanUtils.listBean2ListMap(resLst, CollectionUtils.newStringMap("resId", "resId", "name",
                                "resName", "type", "type", "updateTime", "endTime", "updateTime", "updateTime"))
 
                ));
    }
 
    /**
     * 资源管理查看
     * 
     * @param resId
     *            资源id ( 0,视频。1,音频。2,文档。3,练习)
     */
    @GetMapping(value = "getResDetail")
    public Result getResDetail(String resId) {
 
        return new Result(true, "success", CollectionUtils.newObjectMap("resName", "练习.jpg", "size", 590.68,
                "updateTime", new Date(), "endTime", new Date(), "urlPath", "/web/path", "type", 3));
    }
    
    /**
     * 
     */
 
}