Skip to content
Snippets Groups Projects
Commit 6ba5c242 authored by jaron771's avatar jaron771
Browse files

fix /slr/recommend

parent 1ba7099e
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,6 @@
<start-class>com.nju.svcrecommend.SvcRecommendApplication</start-class>
<docker.image.name>oasisplus/svc-recommend</docker.image.name>
<docker.image.tag>latest</docker.image.tag>
<evosuiteVersion>1.0.6</evosuiteVersion>
</properties>
<dependencies>
......@@ -108,18 +107,6 @@
<artifactId>json</artifactId>
<version>20140107</version>
</dependency>
<dependency>
<groupId>org.evosuite</groupId>
<artifactId>evosuite-standalone-runtime</artifactId>
<version>${evosuiteVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
......@@ -178,51 +165,6 @@
</resources>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<!-- 指定扫描规则 -->
<include>**/*Test.java</include>
</includes>
</configuration>
<!-- 经测试版本必须是2.12 -->
<version>2.12</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.5.201505241946</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
......
......@@ -24,10 +24,14 @@ public class SLRSvcImp implements SLRSvc {
}
@Override
public ResponseVO getSLRRecommend(String keyword, int page, int pageSize, int sortBy, int startTime, int endTime) {
ArrayList<PaperVO> paperVOS = acmslrMapper.selectPaperVOsByKeyword("%"+keyword+"%", startTime, endTime);
paperVOS.addAll(ieeeslrMapper.selectPaperVOsByKeyword("%"+keyword+"%", startTime, endTime));
public ResponseVO getSLRRecommend(String keywords, int page, int pageSize, int sortBy, int startTime, int endTime) {
String[] k = keywords.split(";");
ArrayList<PaperVO> paperVOS = new ArrayList<>();
for(String keyword: k){
paperVOS.addAll(acmslrMapper.selectPaperVOsByKeyword("%"+keyword+"%", startTime, endTime));
paperVOS.addAll(ieeeslrMapper.selectPaperVOsByKeyword("%"+keyword+"%", startTime, endTime));
}
if(paperVOS.size() == 0) {return ResponseVO.buildFailure("No result.");}
PaperVO[] paperVOSArray = (PaperVO[])paperVOS.toArray(new PaperVO[paperVOS.size()]);
if (sortBy == 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment