Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-cloud-analysis
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.online.exam
pica-cloud-analysis
提交
5aeacaab
提交
5aeacaab
编写于
1月 18, 2019
作者:
minghao.wu
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'release' into 'master'
Release See merge request
!1
上级
a5b1f5ef
1a9e474e
流水线
#3974
已通过 于阶段
in 7 second
变更
14
流水线
1
展开全部
显示空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
684 行增加
和
1031 行删除
+684
-1031
CommonUtils.java
...m/pica/cloud/online/exam/analysis/common/CommonUtils.java
+0
-11
pom.xml
pom.xml
+1
-1
pom.xml
server/pom.xml
+5
-16
App.java
.../java/com/pica/cloud/online/exam/analysis/server/App.java
+2
-2
BeanConfiguration.java
...exam/analysis/server/configuration/BeanConfiguration.java
+10
-4
SpringContextAware.java
...xam/analysis/server/configuration/SpringContextAware.java
+25
-0
AnalysisController.java
...e/exam/analysis/server/controller/AnalysisController.java
+62
-685
AntiSpamController.java
...e/exam/analysis/server/controller/AntiSpamController.java
+26
-59
AntiSpamRecordMapper.java
...ine/exam/analysis/server/mapper/AntiSpamRecordMapper.java
+2
-0
CatFilterConfigure.java
...line/exam/analysis/server/monitor/CatFilterConfigure.java
+0
-23
CHCAnalysisService.java
...line/exam/analysis/server/service/CHCAnalysisService.java
+62
-129
AntiSpamServiceImpl.java
...xam/analysis/server/service/impl/AntiSpamServiceImpl.java
+1
-1
CHCAnalysisServiceImpl.java
.../analysis/server/service/impl/CHCAnalysisServiceImpl.java
+487
-100
AnalysisRoundMapper.xml
server/src/main/resources/mybatis/AnalysisRoundMapper.xml
+1
-0
未找到文件。
common/src/main/java/com/pica/cloud/online/exam/analysis/common/CommonUtils.java
浏览文件 @
5aeacaab
package
com
.
pica
.
cloud
.
online
.
exam
.
analysis
.
common
;
package
com
.
pica
.
cloud
.
online
.
exam
.
analysis
.
common
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.pica.cloud.foundation.redis.RedisClient
;
import
com.pica.cloud.foundation.utils.entity.PicaUser
;
import
com.pica.cloud.foundation.utils.entity.PicaUser
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -25,14 +24,4 @@ public class CommonUtils {
...
@@ -25,14 +24,4 @@ public class CommonUtils {
}
}
return
JSON
.
parseObject
(
JSON
.
toJSONString
(
map
),
PicaUser
.
class
);
return
JSON
.
parseObject
(
JSON
.
toJSONString
(
map
),
PicaUser
.
class
);
}
}
public
static
PicaUser
getUserByToken
(
RedisClient
client
,
String
token
)
{
PicaUser
picaUser
=
null
;
try
{
picaUser
=
CommonUtils
.
getUser
(
client
.
getToken
(
token
));
}
catch
(
Exception
e
)
{
logger
.
error
(
"根据token获取user失败:"
+
token
);
}
return
picaUser
;
}
}
}
pom.xml
浏览文件 @
5aeacaab
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
<dependency>
<dependency>
<groupId>
com.pica.cloud.foundation
</groupId>
<groupId>
com.pica.cloud.foundation
</groupId>
<artifactId>
pica-cloud-utils
</artifactId>
<artifactId>
pica-cloud-utils
</artifactId>
<version>
1.0.7
-SNAPSHOT
</version>
<version>
2.0.0
-SNAPSHOT
</version>
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
</dependencies>
</dependencies>
...
...
server/pom.xml
浏览文件 @
5aeacaab
...
@@ -101,17 +101,15 @@
...
@@ -101,17 +101,15 @@
<artifactId>
springfox-swagger-ui
</artifactId>
<artifactId>
springfox-swagger-ui
</artifactId>
<version>
2.8.0
</version>
<version>
2.8.0
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.pica.cloud.foundation
</groupId>
<groupId>
redis.clients
</groupId>
<artifactId>
pica-cloud-r
edis
</artifactId>
<artifactId>
j
edis
</artifactId>
<version>
1.1.2
</version>
<version>
2.9.0
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.pica.cloud.foundation
</groupId>
<groupId>
com.pica.cloud.foundation
</groupId>
<artifactId>
pica-cloud-
util
s
</artifactId>
<artifactId>
pica-cloud-
redi
s
</artifactId>
<version>
1.
0.7
-SNAPSHOT
</version>
<version>
1.
2.0
-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<dependency>
...
@@ -138,10 +136,6 @@
...
@@ -138,10 +136,6 @@
<version>
5.1.39
</version>
<version>
5.1.39
</version>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-sleuth-zipkin-stream
</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-stream-rabbit
</artifactId>
<artifactId>
spring-cloud-starter-stream-rabbit
</artifactId>
...
@@ -154,11 +148,6 @@
...
@@ -154,11 +148,6 @@
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
com.pica.cloud.foundation
</groupId>
<artifactId>
pica-cloud-utils
</artifactId>
<version>
1.0.7-SNAPSHOT
</version>
</dependency>
<dependency>
<dependency>
<groupId>
com.dianping.cat
</groupId>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
cat-core
</artifactId>
<artifactId>
cat-core
</artifactId>
...
...
server/src/main/java/com/pica/cloud/online/exam/analysis/server/App.java
浏览文件 @
5aeacaab
...
@@ -9,10 +9,10 @@ import org.springframework.cloud.netflix.feign.EnableFeignClients;
...
@@ -9,10 +9,10 @@ import org.springframework.cloud.netflix.feign.EnableFeignClients;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
@EnableCircuitBreaker
@EnableCircuitBreaker
@SpringBootApplication
@SpringBootApplication
(
scanBasePackages
=
"com.pica.cloud"
)
@EnableDiscoveryClient
@EnableDiscoveryClient
@EnableSwagger2
@EnableSwagger2
@EnableFeignClients
@EnableFeignClients
(
basePackages
=
"com.pica.cloud"
)
@MapperScan
(
"com.pica.cloud.online.exam.analysis.server.mapper"
)
@MapperScan
(
"com.pica.cloud.online.exam.analysis.server.mapper"
)
public
class
App
{
public
class
App
{
public
static
void
main
(
String
[]
args
)
public
static
void
main
(
String
[]
args
)
...
...
server/src/main/java/com/pica/cloud/online/exam/analysis/server/configuration/BeanConfiguration.java
浏览文件 @
5aeacaab
package
com
.
pica
.
cloud
.
online
.
exam
.
analysis
.
server
.
configuration
;
package
com
.
pica
.
cloud
.
online
.
exam
.
analysis
.
server
.
configuration
;
import
com.pica.cloud.foundation.redis.CacheMigrateClient
;
import
com.pica.cloud.foundation.redis.ICacheClient
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.cloud.context.config.annotation.RefreshScope
;
import
org.springframework.cloud.context.config.annotation.RefreshScope
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
com.pica.cloud.foundation.redis.RedisClient
;
@Configuration
@Configuration
@RefreshScope
@RefreshScope
public
class
BeanConfiguration
{
public
class
BeanConfiguration
{
@Autowired
private
SpringContextAware
springContextAware
;
@Value
(
"${spring.redis.config}"
)
@Value
(
"${spring.redis.config}"
)
private
String
configStr
;
private
String
configStr
;
@Bean
@Bean
public
RedisClient
redisClient
()
{
@ConditionalOnMissingBean
System
.
out
.
println
(
configStr
);
public
ICacheClient
cacheClient
()
{
return
new
CacheMigrateClient
(
springContextAware
.
getActiveProfile
());
return
new
RedisClient
(
configStr
);
}
}
}
}
server/src/main/java/com/pica/cloud/online/exam/analysis/server/configuration/SpringContextAware.java
0 → 100644
浏览文件 @
5aeacaab
package
com
.
pica
.
cloud
.
online
.
exam
.
analysis
.
server
.
configuration
;
import
org.springframework.beans.BeansException
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContextAware
;
import
org.springframework.stereotype.Component
;
/**
* @author wuminghao
* @date 2018/12/27 14:11
*/
@Component
public
class
SpringContextAware
implements
ApplicationContextAware
{
private
ApplicationContext
context
=
null
;
@Override
public
void
setApplicationContext
(
ApplicationContext
applicationContext
)
throws
BeansException
{
this
.
context
=
applicationContext
;
}
public
String
getActiveProfile
()
{
return
context
.
getEnvironment
().
getActiveProfiles
()[
0
];
}
}
server/src/main/java/com/pica/cloud/online/exam/analysis/server/controller/AnalysisController.java
浏览文件 @
5aeacaab
此差异已折叠。
点击以展开。
server/src/main/java/com/pica/cloud/online/exam/analysis/server/controller/AntiSpamController.java
浏览文件 @
5aeacaab
...
@@ -3,17 +3,16 @@ package com.pica.cloud.online.exam.analysis.server.controller;
...
@@ -3,17 +3,16 @@ package com.pica.cloud.online.exam.analysis.server.controller;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.pica.cloud.foundation.entity.PicaResponse
;
import
com.pica.cloud.foundation.entity.PicaResponse
;
import
com.pica.cloud.foundation.entity.PicaResultCode
;
import
com.pica.cloud.foundation.entity.PicaResultCode
;
import
com.pica.cloud.foundation.redis.
Redis
Client
;
import
com.pica.cloud.foundation.redis.
ICache
Client
;
import
com.pica.cloud.foundation.utils.annotation.LoginPermission
;
import
com.pica.cloud.foundation.utils.annotation.LoginPermission
;
import
com.pica.cloud.foundation.utils.controller.BaseController
;
import
com.pica.cloud.foundation.utils.entity.PicaUser
;
import
com.pica.cloud.foundation.utils.entity.PicaUser
;
import
com.pica.cloud.online.exam.analysis.common.CommonUtils
;
import
com.pica.cloud.online.exam.analysis.common.util.ReturnUtil
;
import
com.pica.cloud.online.exam.analysis.common.util.ReturnUtil
;
import
com.pica.cloud.online.exam.analysis.server.service.AntiSpamService
;
import
com.pica.cloud.online.exam.analysis.server.service.AntiSpamService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.apache.commons.lang3.tuple.Pair
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
/**
/**
...
@@ -22,10 +21,10 @@ import org.springframework.web.bind.annotation.*;
...
@@ -22,10 +21,10 @@ import org.springframework.web.bind.annotation.*;
*/
*/
@RestController
@RestController
@RequestMapping
(
"/antispam"
)
@RequestMapping
(
"/antispam"
)
@Api
(
value
=
"内容甄别解析"
,
description
=
"检测文本、图片内容"
)
public
class
AntiSpamController
extends
BaseController
{
public
class
AntiSpamController
{
@Qualifier
(
"cacheMigrateClient"
)
@Autowired
@Autowired
private
Redis
Client
redisClient
;
private
ICache
Client
redisClient
;
@Autowired
@Autowired
AntiSpamService
antiSpamService
;
AntiSpamService
antiSpamService
;
...
@@ -36,33 +35,17 @@ public class AntiSpamController {
...
@@ -36,33 +35,17 @@ public class AntiSpamController {
public
PicaResponse
processText
(
@RequestBody
String
content
,
public
PicaResponse
processText
(
@RequestBody
String
content
,
@RequestHeader
String
sysCode
,
@RequestHeader
String
sysCode
,
@RequestHeader
String
token
)
{
@RequestHeader
String
token
)
{
PicaUser
user
=
CommonUtils
.
getUserByToken
(
redisClient
,
token
);
PicaUser
user
=
fetchPicaUser
();
Pair
<
String
,
Integer
>
params
;
if
(
user
==
null
||
user
.
getId
().
intValue
()
==
0
)
{
return
ReturnUtil
.
getPicaResponse
(
PicaResultCode
.
LOGIN_FAILE
);
}
StringBuilder
sbContent
=
new
StringBuilder
();
/**
* type:0 不检测广告 其他: 检测广告, 默认不检测
*/
Integer
type
=
0
;
try
{
try
{
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
content
);
params
=
parseContentAndType
(
content
);
sbContent
.
append
(
jsonObject
.
get
(
"content"
).
toString
());
type
=
(
jsonObject
.
get
(
"type"
)
!=
null
?
Integer
.
parseInt
(
jsonObject
.
get
(
"type"
).
toString
())
:
0
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
return
ReturnUtil
.
getPicaResponse
(
PicaResultCode
.
PARAM_IS_INVALID
);
return
ReturnUtil
.
getPicaResponse
(
PicaResultCode
.
PARAM_IS_INVALID
);
}
}
return
antiSpamService
.
processString
(
user
.
getId
(),
sysCode
,
params
.
getLeft
(),
params
.
getRight
()
!=
0
);
return
antiSpamService
.
processString
(
user
.
getId
(),
sysCode
,
sbContent
.
toString
(),
type
!=
0
);
}
}
@LoginPermission
@ApiOperation
(
value
=
"内容检测"
,
response
=
PicaResponse
.
class
)
@ApiOperation
(
value
=
"内容检测"
,
response
=
PicaResponse
.
class
)
@RequestMapping
(
value
=
"/text/v1"
,
method
=
RequestMethod
.
POST
,
produces
=
"application/json;charset=UTF-8"
)
@RequestMapping
(
value
=
"/text/v1"
,
method
=
RequestMethod
.
POST
,
produces
=
"application/json;charset=UTF-8"
)
public
PicaResponse
processTextV1
(
@RequestBody
String
content
,
public
PicaResponse
processTextV1
(
@RequestBody
String
content
,
...
@@ -71,53 +54,30 @@ public class AntiSpamController {
...
@@ -71,53 +54,30 @@ public class AntiSpamController {
return
processText
(
content
,
sysCode
,
token
);
return
processText
(
content
,
sysCode
,
token
);
}
}
@LoginPermission
@ApiOperation
(
value
=
"内容检测"
,
response
=
PicaResponse
.
class
)
@ApiOperation
(
value
=
"内容检测"
,
response
=
PicaResponse
.
class
)
@RequestMapping
(
value
=
"/text/v2"
,
method
=
RequestMethod
.
POST
,
produces
=
"application/json;charset=UTF-8"
)
@RequestMapping
(
value
=
"/text/v2"
,
method
=
RequestMethod
.
POST
,
produces
=
"application/json;charset=UTF-8"
)
public
PicaResponse
processTextV2
(
@RequestBody
String
content
,
public
PicaResponse
processTextV2
(
@RequestBody
String
content
,
@RequestHeader
String
sysCode
,
@RequestHeader
String
sysCode
,
@RequestHeader
String
token
)
{
@RequestHeader
String
token
)
{
PicaUser
user
=
CommonUtils
.
getUserByToken
(
redisClient
,
token
);
PicaUser
user
=
fetchPicaUser
();
Pair
<
String
,
Integer
>
params
;
if
(
user
==
null
||
user
.
getId
().
intValue
()
==
0
)
{
return
ReturnUtil
.
getPicaResponse
(
PicaResultCode
.
LOGIN_FAILE
);
}
StringBuilder
sbContent
=
new
StringBuilder
();
/**
* type:0 不检测广告 其他: 检测广告, 默认不检测
*/
Integer
type
=
0
;
try
{
try
{
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
content
);
params
=
parseContentAndType
(
content
);
sbContent
.
append
(
jsonObject
.
get
(
"content"
).
toString
());
type
=
(
jsonObject
.
get
(
"type"
)
!=
null
?
Integer
.
parseInt
(
jsonObject
.
get
(
"type"
).
toString
())
:
0
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
return
ReturnUtil
.
getPicaResponse
(
PicaResultCode
.
PARAM_IS_INVALID
);
return
ReturnUtil
.
getPicaResponse
(
PicaResultCode
.
PARAM_IS_INVALID
);
}
}
return
antiSpamService
.
processStringV2
(
return
antiSpamService
.
processStringV2
(
user
.
getId
(),
sysCode
,
params
.
getLeft
(),
params
.
getRight
()
!=
0
);
user
.
getId
(),
sysCode
,
sbContent
.
toString
(),
type
!=
0
);
}
}
@LoginPermission
@ApiOperation
(
value
=
"图片检测"
,
response
=
PicaResponse
.
class
)
@ApiOperation
(
value
=
"图片检测"
,
response
=
PicaResponse
.
class
)
@RequestMapping
(
value
=
"/image"
,
method
=
RequestMethod
.
POST
,
produces
=
"application/json;charset=UTF-8"
)
@RequestMapping
(
value
=
"/image"
,
method
=
RequestMethod
.
POST
,
produces
=
"application/json;charset=UTF-8"
)
public
PicaResponse
processImage
(
@RequestBody
String
content
,
public
PicaResponse
processImage
(
@RequestBody
String
content
,
@RequestHeader
String
sysCode
,
@RequestHeader
String
sysCode
,
@RequestHeader
String
token
)
{
@RequestHeader
String
token
)
{
if
(
token
==
null
)
{
PicaUser
user
=
fetchPicaUser
();
return
ReturnUtil
.
getPicaResponse
(
PicaResultCode
.
SYSTEM_NO_TOKEN
);
}
PicaUser
user
=
CommonUtils
.
getUserByToken
(
redisClient
,
token
);
if
(
user
==
null
||
user
.
getId
().
intValue
()
==
0
)
{
return
ReturnUtil
.
getPicaResponse
(
PicaResultCode
.
LOGIN_FAILE
);
}
StringBuilder
sbContent
=
new
StringBuilder
();
StringBuilder
sbContent
=
new
StringBuilder
();
try
{
try
{
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
content
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
content
);
...
@@ -132,4 +92,11 @@ public class AntiSpamController {
...
@@ -132,4 +92,11 @@ public class AntiSpamController {
return
ReturnUtil
.
getPicaResponse
(
PicaResultCode
.
SUCCESS
);
return
ReturnUtil
.
getPicaResponse
(
PicaResultCode
.
SUCCESS
);
}
}
public
Pair
<
String
,
Integer
>
parseContentAndType
(
String
content
)
{
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
content
);
return
Pair
.
of
(
jsonObject
.
get
(
"content"
).
toString
(),
jsonObject
.
get
(
"type"
)
!=
null
?
Integer
.
parseInt
(
jsonObject
.
get
(
"type"
).
toString
())
:
0
);
}
}
}
server/src/main/java/com/pica/cloud/online/exam/analysis/server/mapper/AntiSpamRecordMapper.java
浏览文件 @
5aeacaab
package
com
.
pica
.
cloud
.
online
.
exam
.
analysis
.
server
.
mapper
;
package
com
.
pica
.
cloud
.
online
.
exam
.
analysis
.
server
.
mapper
;
import
com.pica.cloud.online.exam.analysis.server.entity.AntiSpamRecord
;
import
com.pica.cloud.online.exam.analysis.server.entity.AntiSpamRecord
;
import
org.springframework.stereotype.Component
;
@Component
public
interface
AntiSpamRecordMapper
{
public
interface
AntiSpamRecordMapper
{
int
deleteByPrimaryKey
(
Integer
id
);
int
deleteByPrimaryKey
(
Integer
id
);
...
...
server/src/main/java/com/pica/cloud/online/exam/analysis/server/monitor/CatFilterConfigure.java
已删除
100644 → 0
浏览文件 @
a5b1f5ef
package
com
.
pica
.
cloud
.
online
.
exam
.
analysis
.
server
.
monitor
;
import
org.springframework.boot.web.servlet.FilterRegistrationBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
com.dianping.cat.servlet.CatFilter
;
@Configuration
public
class
CatFilterConfigure
{
@Bean
public
FilterRegistrationBean
catFilter
()
{
FilterRegistrationBean
registration
=
new
FilterRegistrationBean
();
CatFilter
filter
=
new
CatFilter
();
registration
.
setFilter
(
filter
);
registration
.
addUrlPatterns
(
"/*"
);
registration
.
setName
(
"cat-filter"
);
registration
.
setOrder
(
1
);
return
registration
;
}
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/online/exam/analysis/server/service/CHCAnalysisService.java
浏览文件 @
5aeacaab
package
com
.
pica
.
cloud
.
online
.
exam
.
analysis
.
server
.
service
;
package
com
.
pica
.
cloud
.
online
.
exam
.
analysis
.
server
.
service
;
import
com.pica.cloud.foundation.entity.PicaResponse
;
import
com.pica.cloud.foundation.utils.entity.PicaUser
;
import
com.pica.cloud.online.exam.analysis.common.dto.*
;
import
com.pica.cloud.online.exam.analysis.common.dto.*
;
import
com.pica.cloud.online.exam.analysis.server.entity.AnalysisRound
;
import
com.pica.cloud.online.exam.analysis.server.entity.AnalysisRound
;
import
com.pica.cloud.online.exam.analysis.server.entity.AnalysisRoundExamTitle
;
import
com.pica.cloud.online.exam.analysis.server.entity.AnalysisRoundExamTitle
;
import
com.pica.cloud.online.exam.analysis.server.entity.CHCAnalysis
;
import
com.pica.cloud.online.exam.analysis.server.entity.CHCAnalysis
;
import
com.pica.cloud.online.exam.analysis.server.entity.Reply
;
import
com.pica.cloud.online.exam.analysis.server.entity.Reply
;
import
io.swagger.models.auth.In
;
import
org.omg.CORBA.INTERNAL
;
import
org.omg.CORBA.INTERNAL
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Optional
;
/**
/**
* @author wuminghao
* @author wuminghao
* @date 2018/8/17 9:40
* @date 2018/8/17 9:40
*/
*/
public
interface
CHCAnalysisService
{
public
interface
CHCAnalysisService
{
/**
* 根据活动id获取活动详情
* @param analysisId
* @return
*/
CHCAnalysis
getAnalysisById
(
Integer
analysisId
);
/**
* 根据活动id获取活动详情
* @param analysisId
* @return
*/
CHCAnalysisDto
getCHCAnalysisDtoById
(
Integer
analysisId
);
/**
/**
* 根据活动id获取活动详情
* 获取CHC活动详情
* @param analysisId
* @param analysisId 活动id
* @param user
* @return
* @return
*/
*/
CHCAnalysisDto
get
PSAAnalysisDtoById
(
Integer
analysisId
);
CHCAnalysisDto
get
CHCActivityDetail
(
Integer
analysisId
,
PicaUser
user
);
/**
/**
*
根据活动id获取活动的轮数
*
获取PSA活动详情
* @param analysisId
* @param analysisId
活动id
* @return
* @return
*/
*/
List
<
AnalysisRoundDto
>
getRoundListByAnalysisId
(
Integer
analysisId
);
CHCAnalysisDto
getPSAActivityDetail
(
Integer
analysisId
);
/**
/**
*
根据轮的id获取信息
*
获取轮详情
* @param roundId
* @param roundId
轮id
* @return
* @return
*/
*/
RoundExamTitleDto
getRound
ExamTitleDtoById
(
Integer
roundId
);
RoundExamTitleDto
getRound
Detail
(
Integer
roundId
);
/**
/**
*
根据轮的id获取信息
*
获取轮详情V2
* @param roundId
* @param roundId
* @return
* @return
*/
*/
AnalysisRound
getRoundInfoById
(
Integer
roundId
);
RoundExamTitleV2Dto
getRoundDetailV2
(
Integer
roundId
);
/**
* 根据轮的id获取题目信息
* @param roundId
* @return
*/
List
<
ExamTitleDto
>
getExamTitleListByRoundId
(
Integer
roundId
);
/**
* 获取当前的活动-轮-题目关联表
* @param analysisRoundExamTitleId
* @return
*/
AnalysisRoundExamTitle
getAnanlysisRoundExamTitleById
(
Integer
analysisRoundExamTitleId
);
/**
* 获取考题信息
* @param analysisRoundExamTitleId
* @return
*/
ExamTitleDto
getExamTitleDtoById
(
Integer
analysisRoundExamTitleId
);
/**
* 获取当前题目的下一题目
* @param roundId 当前轮的id
* @param analysisRoundExamTitleId 当前题目的id
* @return 下一题目的id
*/
ExamTitleDto
getNextExamTitleDtoById
(
Integer
roundId
,
Integer
analysisRoundExamTitleId
);
/**
* 根据题目id获取回复信息
* @param analysisRoundExamTitleId
* @param userId
* @return
*/
List
<
ReplyDto
>
getReplyListDtoByExamTitleId
(
Integer
analysisRoundExamTitleId
,
Integer
userId
);
/**
* 根据id获取reply
* @param replyId
* @return
*/
Reply
getReplyById
(
Integer
replyId
);
/**
/**
* 根据id获取下一条reply
* 获取题目的回复列表
* @param replyId
* @return
*/
Reply
getNextReplyById
(
Integer
replyId
);
/**
* 根据reply获取replydto
* @param reply
* @param userId
* @return
*/
ReplyDto
getReplyDtoByReply
(
Reply
reply
,
Integer
userId
);
/**
* 插入点赞记录
* @param analysisId
* @param roundId
* @param examTitleId
* @param examTitleId
* @param
replyId
* @param
user
* @return
* @return
*/
*/
Integer
insertStarRecord
(
Integer
analysisId
,
Integer
roundId
,
Integer
examTitleId
,
Integer
replyId
,
Integer
userId
);
ExamTitleReplyDto
getReplyListByExamTitleId
(
Integer
examTitleId
,
PicaUser
user
);
/**
/**
* 取消点赞记录
* 获取题目的回复列表 分页
* @param replyId
* @param examTitleId 题目id
* @param userId
* @param pageNo 页码
* @param pageSize 大小
* @param user
* @return
* @return
*/
*/
Integer
removeStarRecord
(
Integer
replyId
,
Integer
userId
);
ExamTitleReplyDto
getReplyListV2ByExamTitleId
(
Integer
examTitleId
,
Integer
pageNo
,
Integer
pageSize
,
PicaUser
user
);
/**
/**
*
增加解析
*
获取下一题的回复列表
* @param examTitleId
* @param examTitleId
* @param content
* @param user
* @param userId
* @return
* @return
*/
*/
Integer
insertReply
(
Integer
examTitleId
,
String
content
,
Integer
userId
);
ExamTitleReplyDto
getNextReplyListByExamTitleId
(
Integer
examTitleId
,
PicaUser
user
);
/**
* 获取我的评论状态
* @param examTitleId
* @param userId
* @return
*/
Integer
getReplyStatus
(
Integer
examTitleId
,
Integer
userId
);
/**
/**
* 获取
我的评论
详情
* 获取
回复的
详情
* @param
examTitleI
d
* @param
replyId 回复i
d
* @param user
Id
* @param user
用户
* @return
* @return
*/
*/
Reply
getReplyByExamTitleId
(
Integer
examTitleId
,
Integer
userId
);
ExamTitleReplyDetailDto
getReplyDetailByReplyId
(
Integer
replyId
,
PicaUser
user
);
/**
/**
* 根据考试id获取评论列表
* 获取下一回复的详情
* @param examTitleId
* @param replyId
* @param user
* @return
* @return
*/
*/
List
<
Reply
>
getReplyList
(
Integer
examTitleId
);
ExamTitleReplyDetailDto
getNextReplyDetailByReplyId
(
Integer
replyId
,
PicaUser
user
);
/**
/**
* 获取所有的历史轮详情
* 获取回复的详情
* @param ananlysisId
* @param examTitleId 题目id
* @param user 用户
* @return
* @return
*/
*/
List
<
AnalysisRoundDto
>
getCHCHistoryRound
(
Integer
analysisId
);
ExamTitleReplyDetailDto
getReplyDetailByExamTitleId
(
Integer
examTitleId
,
PicaUser
user
);
/**
/**
* 获取某一轮的最多得票数
* 点赞
* @param roundId
* @param user 用户
* @param analysisId 活动id
* @param roundId 轮id
* @param examTitleId 题目id
* @param replyId 回复id
* @return
* @return
*/
*/
Integer
getElectedStarCountByRoundId
(
Integer
round
Id
);
PicaResponse
starReply
(
PicaUser
user
,
Integer
analysisId
,
Integer
roundId
,
Integer
examTitleId
,
Integer
reply
Id
);
/**
/**
* 获取被选中的医生id
* 解析/回复某一个题目
* @param roundId
* @param user 用户
* @param sysCode
* @param examTitleId 题目
* @param content 内容
* @param isAdFilterOpen 广告检测
* @return
* @return
*/
*/
Integer
getElectedDoctorIdByRoundId
(
Integer
roundId
);
PicaResponse
reply
(
PicaUser
user
,
String
sysCode
,
Integer
examTitleId
,
String
content
,
Boolean
isAdFilterOpen
);
/**
/**
*
根据医生id和轮id获取得赞数
*
获取我的赞
* @param
roundId
* @param
user 用户
* @param
doctorI
d
* @param
roundId 某轮的i
d
* @return
* @return
*/
*/
Integer
getStarCountByRoundIdAndDoctorId
(
Integer
roundId
,
Integer
doctor
Id
);
MyStarDto
myStar
(
PicaUser
user
,
Optional
<
Integer
>
round
Id
);
/**
/**
*
根据医生id和轮id获取得赞记录
*
取消点赞
* @param r
oundI
d
* @param r
eplyId 活动i
d
* @param
doctorId
* @param
user 用户
* @return
* @return
*/
*/
List
<
UserExamTitleDto
>
getMyStarRecordByRoundIdAndDoctorId
(
Integer
roundId
,
Integer
doctorId
);
Integer
removeStarRecord
(
Integer
replyId
,
PicaUser
user
);
}
}
server/src/main/java/com/pica/cloud/online/exam/analysis/server/service/impl/AntiSpamServiceImpl.java
浏览文件 @
5aeacaab
...
@@ -38,7 +38,7 @@ public class AntiSpamServiceImpl implements AntiSpamService {
...
@@ -38,7 +38,7 @@ public class AntiSpamServiceImpl implements AntiSpamService {
@Autowired
@Autowired
private
AntiSpamRecordMapper
antiSpamRecordMapper
;
private
AntiSpamRecordMapper
antiSpamRecordMapper
;
private
static
HttpClient
httpClient
=
HttpClient4Utils
.
createHttpClient
(
100
,
2
0
,
2000
,
2000
,
2000
);
private
static
HttpClient
httpClient
=
HttpClient4Utils
.
createHttpClient
(
200
,
20
0
,
2000
,
2000
,
2000
);
private
static
HttpClient
httpClientImage
=
HttpClient4Utils
.
createHttpClient
(
100
,
20
,
10000
,
2000
,
2000
);
private
static
HttpClient
httpClientImage
=
HttpClient4Utils
.
createHttpClient
(
100
,
20
,
10000
,
2000
,
2000
);
private
String
neteaseResult
(
String
content
,
boolean
isAdFilterOpen
)
{
private
String
neteaseResult
(
String
content
,
boolean
isAdFilterOpen
)
{
...
...
server/src/main/java/com/pica/cloud/online/exam/analysis/server/service/impl/CHCAnalysisServiceImpl.java
浏览文件 @
5aeacaab
此差异已折叠。
点击以展开。
server/src/main/resources/mybatis/AnalysisRoundMapper.xml
浏览文件 @
5aeacaab
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
seq_no from p_analysis_round
seq_no from p_analysis_round
where is_published = 1
where is_published = 1
and is_deleted = 0
and is_deleted = 0
and analysis_id = #{id,jdbcType=INTEGER}
order by seq_no desc
order by seq_no desc
limit 1)
limit 1)
order by seq_no
order by seq_no
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录