新增三方接口,修改bug

master
xiaoCJ
parent 19c8409164
commit b976826f0f

@ -0,0 +1,58 @@
package com.sztzjy.resource_center.controller.api;
import com.sztzjy.resource_center.annotation.AnonymousAccess;
import com.sztzjy.resource_center.entity.SysKnowledgeSummary;
import com.sztzjy.resource_center.entity.SysKnowledgeSummaryExample;
import com.sztzjy.resource_center.entity.SysOneCatalog;
import com.sztzjy.resource_center.entity.SysOneCatalogExample;
import com.sztzjy.resource_center.mapper.SysKnowledgeSummaryMapper;
import com.sztzjy.resource_center.mapper.SysOneCatalogMapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @Author xcj
* @Date 2024/7/19
*/
@RestController
@Api(tags = "知识概要API")
@RequestMapping("/api/stu/knowledgeNote")
public class SysKnowledgeSummaryApi {
@Autowired
private SysKnowledgeSummaryMapper knowledgeSummaryMapper;
@Autowired
private SysOneCatalogMapper oneCatalogMapper;
private SysOneCatalog getSysOneCatalogs(String systemOwner) {
SysOneCatalogExample example = new SysOneCatalogExample();
example.createCriteria().andOneNameEqualTo(systemOwner);
List<SysOneCatalog> sysOneCatalogs = oneCatalogMapper.selectByExample(example);
return sysOneCatalogs.get(0);
}
@AnonymousAccess
@ApiOperation("getSysKnowledgeSummary")
@PostMapping("uploadResourceData")
private SysKnowledgeSummary getSysKnowledgeSummary(@RequestParam String schoolId,
@RequestParam String systemOwner,
@RequestParam String courseId,
@RequestParam String chapterId) {
SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner);
String oneId = sysOneCatalogs.getOneId();
SysKnowledgeSummaryExample example = new SysKnowledgeSummaryExample();
SysKnowledgeSummaryExample.Criteria criteria = example.createCriteria();
criteria.andOneTagIdEqualTo(oneId).andThreeTagIdEqualTo(chapterId).andTwoTagIdEqualTo(courseId);
List<SysKnowledgeSummary> sysKnowledgeSummaries = knowledgeSummaryMapper.selectByExampleWithBLOBs(example);
if (sysKnowledgeSummaries != null && !sysKnowledgeSummaries.isEmpty()) {
return sysKnowledgeSummaries.get(0);
} else return null;
}
}

@ -229,7 +229,7 @@ public class AdminCaseController {
private ResultEntity<PageInfo<AdminCaseReturnDto>> get(@RequestParam Integer index,
@RequestParam Integer size,
@RequestParam(required = false) String keyWord,
@ApiParam("精品案例不传,院校案例传学校ID") @RequestParam(required = false) String source,
@ApiParam("精品案例不传,院校案例传'院校案例'") @RequestParam(required = false) String source,
@RequestParam(required = false) String labelName) {
PageHelper.startPage(index, size);
List<AdminCaseReturnDto> adminCaseReturnDtos = adminCaseMapper.selectByConditions(keyWord, source, labelName);

@ -71,7 +71,7 @@ public class StuCaseController {
private ResultEntity<PageInfo<AdminCaseReturnDto>> get(@RequestParam Integer index,
@RequestParam Integer size,
@RequestParam(required = false) String keyWord,
@ApiParam("精品案例院校案例传学校ID") @RequestParam(required = false) String source,
@ApiParam("精品案例管理员院校案例传学校ID") @RequestParam(required = false) String source,
@ApiParam("收藏案例页面传") @RequestParam(required = false) String userId,
@RequestParam(required = false) String labelName) {

@ -386,8 +386,11 @@
<if test="labelName !=null and labelName !=''">
and ad.name = #{labelName}
</if>
<if test="source !=null and source !=''">
and a.source !='管理员'
<if test="source !=null and source !='管理员'">
and a.source = #{source}
</if>
<if test="source == '管理员'">
and a.source in (#{source},'管理员')
</if>
<if test="userId !=null and userId !=''">
and acc.user_id = #{userId}

Loading…
Cancel
Save