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 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)); } /** * */ }