|
|
@ -1,7 +1,7 @@
|
|
|
|
package com.sztzjy.financial_bigdata.controller.tea;
|
|
|
|
package com.sztzjy.financial_bigdata.controller.tea;
|
|
|
|
|
|
|
|
|
|
|
|
import com.sztzjy.financial_bigdata.annotation.AnonymousAccess;
|
|
|
|
import com.sztzjy.financial_bigdata.annotation.AnonymousAccess;
|
|
|
|
import com.sztzjy.financial_bigdata.entity.*;
|
|
|
|
import com.sztzjy.financial_bigdata.entity.TeaResourceCenter;
|
|
|
|
import com.sztzjy.financial_bigdata.entity.resource_entity.SysResource;
|
|
|
|
import com.sztzjy.financial_bigdata.entity.resource_entity.SysResource;
|
|
|
|
import com.sztzjy.financial_bigdata.resourceCenterAPI.ResourceCenterApi;
|
|
|
|
import com.sztzjy.financial_bigdata.resourceCenterAPI.ResourceCenterApi;
|
|
|
|
import com.sztzjy.financial_bigdata.service.tea.ITeaResourceCenterService;
|
|
|
|
import com.sztzjy.financial_bigdata.service.tea.ITeaResourceCenterService;
|
|
|
@ -10,11 +10,17 @@ import com.sztzjy.financial_bigdata.util.file.IFileUtil;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
//资源中心
|
|
|
|
//资源中心
|
|
|
@ -35,7 +41,7 @@ public class TeaResourceCenterController {
|
|
|
|
@GetMapping("selectResource")
|
|
|
|
@GetMapping("selectResource")
|
|
|
|
@ApiOperation("**查看资源文件列表,图片资源使用默认图片")
|
|
|
|
@ApiOperation("**查看资源文件列表,图片资源使用默认图片")
|
|
|
|
public ResultEntity<List<TeaResourceCenter>> selectResource(@ApiParam("学校id") @RequestParam String schoolId,
|
|
|
|
public ResultEntity<List<TeaResourceCenter>> selectResource(@ApiParam("学校id") @RequestParam String schoolId,
|
|
|
|
@ApiParam("课程Id") @RequestParam String courseId, @RequestParam String systemOwner) {
|
|
|
|
@ApiParam("课程Id") @RequestParam String courseId, @RequestParam String systemOwner) {
|
|
|
|
List<SysResource> resourceList = null;
|
|
|
|
List<SysResource> resourceList = null;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
resourceList = ResourceCenterApi.selectResource(schoolId, courseId, systemOwner);
|
|
|
|
resourceList = ResourceCenterApi.selectResource(schoolId, courseId, systemOwner);
|
|
|
@ -49,9 +55,15 @@ public class TeaResourceCenterController {
|
|
|
|
@AnonymousAccess
|
|
|
|
@AnonymousAccess
|
|
|
|
@GetMapping("selectResourceByChapterId")
|
|
|
|
@GetMapping("selectResourceByChapterId")
|
|
|
|
@ApiOperation("**根据章节查看资源文件列表,图片资源使用默认图片")
|
|
|
|
@ApiOperation("**根据章节查看资源文件列表,图片资源使用默认图片")
|
|
|
|
public ResultEntity<List<TeaResourceCenter>> selectResourceByChapterId(@ApiParam("章节Id") @RequestParam String chapterId, @RequestParam String systemOwner) {
|
|
|
|
public ResultEntity<List<TeaResourceCenter>> selectResourceByChapterId(@ApiParam("章节Id") @RequestParam(required = false) String chapterId,
|
|
|
|
|
|
|
|
@RequestParam String systemOwner) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
List<SysResource> resourceList = ResourceCenterApi.selectResourceByChapterId(chapterId, systemOwner);
|
|
|
|
List<SysResource> resourceList = new ArrayList<>();
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(chapterId)) {
|
|
|
|
|
|
|
|
resourceList = ResourceCenterApi.selectResourceByChapterId(systemOwner);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
resourceList = ResourceCenterApi.selectResourceByChapterId(chapterId, systemOwner);
|
|
|
|
|
|
|
|
}
|
|
|
|
return new ResultEntity(HttpStatus.OK, "根据章节查看资源文件列表,展示成功", resourceList);
|
|
|
|
return new ResultEntity(HttpStatus.OK, "根据章节查看资源文件列表,展示成功", resourceList);
|
|
|
|
} catch (IOException e) {
|
|
|
|
} catch (IOException e) {
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "资源中心接口异常");
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "资源中心接口异常");
|
|
|
|