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