Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
brandkbs2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenjunjie
brandkbs2
Commits
d961690e
Commit
d961690e
authored
Jul 13, 2022
by
shenjunjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口命名规范调整
parent
7d0bd200
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
51 changed files
with
276 additions
and
170 deletions
+276
-170
src/main/java/com/zhiwei/brandkbs2/auth/AuthAspect.java
+3
-3
src/main/java/com/zhiwei/brandkbs2/common/GlobalPojo.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/config/Constant.java
+1
-0
src/main/java/com/zhiwei/brandkbs2/controller/AppArticleController.java
+15
-7
src/main/java/com/zhiwei/brandkbs2/controller/CommonController.java
+18
-4
src/main/java/com/zhiwei/brandkbs2/controller/LoginController.java
+10
-10
src/main/java/com/zhiwei/brandkbs2/controller/admin/ArticleController.java
+4
-4
src/main/java/com/zhiwei/brandkbs2/controller/admin/BaseModuleController.java
+6
-6
src/main/java/com/zhiwei/brandkbs2/controller/admin/BehaviorController.java
+5
-5
src/main/java/com/zhiwei/brandkbs2/controller/admin/ChannelController.java
+4
-4
src/main/java/com/zhiwei/brandkbs2/controller/admin/CustomTagController.java
+4
-4
src/main/java/com/zhiwei/brandkbs2/controller/admin/EventController.java
+0
-0
src/main/java/com/zhiwei/brandkbs2/controller/admin/ProjectController.java
+15
-15
src/main/java/com/zhiwei/brandkbs2/controller/admin/ReportController.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/controller/admin/UserController.java
+11
-11
src/main/java/com/zhiwei/brandkbs2/easyexcel/listener/EventFileListener.java
+5
-5
src/main/java/com/zhiwei/brandkbs2/pojo/MarkFlowEntity.java
+21
-0
src/main/java/com/zhiwei/brandkbs2/pojo/dto/EventSearchDTO.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/service/BehaviorService.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/BrandkbsTaskService.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/service/ChannelService.java
+3
-3
src/main/java/com/zhiwei/brandkbs2/service/CommonService.java
+8
-1
src/main/java/com/zhiwei/brandkbs2/service/CustomTagService.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/service/EventDataService.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/EventService.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/HighWordService.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/MarkDataService.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/ProjectService.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/service/ReportService.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/SystemInfoService.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/TagFilterService.java
+1
-1
src/main/java/com/zhiwei/brandkbs2/service/TaskService.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/UserService.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/BehaviorServiceImpl.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/BrandkbsTaskServiceImpl.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/ChannelServiceImpl.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/CommonServiceImpl.java
+24
-10
src/main/java/com/zhiwei/brandkbs2/service/impl/CustomTagServiceImpl.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/EventDataServiceImpl.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/EventServiceImpl.java
+6
-6
src/main/java/com/zhiwei/brandkbs2/service/impl/HighWordServiceImpl.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
+0
-0
src/main/java/com/zhiwei/brandkbs2/service/impl/ProjectServiceImpl.java
+3
-3
src/main/java/com/zhiwei/brandkbs2/service/impl/ReportServiceImpl.java
+4
-4
src/main/java/com/zhiwei/brandkbs2/service/impl/SystemInfoServiceImpl.java
+4
-4
src/main/java/com/zhiwei/brandkbs2/service/impl/TagFilterServiceImpl.java
+6
-7
src/main/java/com/zhiwei/brandkbs2/service/impl/TaskServiceImpl.java
+5
-2
src/main/java/com/zhiwei/brandkbs2/service/impl/UserServiceImpl.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/task/ControlCenter.java
+2
-2
src/main/java/com/zhiwei/brandkbs2/util/Tools.java
+28
-0
src/test/java/com/zhiwei/brandkbs2/TestRunWith.java
+20
-9
No files found.
src/main/java/com/zhiwei/brandkbs2/auth/AuthAspect.java
View file @
d961690e
...
...
@@ -5,7 +5,7 @@ import com.zhiwei.brandkbs2.common.GenericAttribute;
import
com.zhiwei.brandkbs2.model.CommonCodeEnum
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.UserInfo
;
import
com.zhiwei.brandkbs2.service.
I
UserService
;
import
com.zhiwei.brandkbs2.service.UserService
;
import
com.zhiwei.middleware.auth.util.JwtUtil
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.Signature
;
...
...
@@ -40,7 +40,7 @@ public class AuthAspect {
private
String
jwtKey
;
@Resource
(
name
=
"userServiceImpl"
)
private
IUserService
i
UserService
;
private
UserService
UserService
;
@Pointcut
(
"execution(com.zhiwei.brandkbs2.model.ResponseResult com.zhiwei.brandkbs2.controller..*.*(..))"
)
// @Pointcut("within(com.zhiwei.brandkbs2.controller..*)")
...
...
@@ -73,7 +73,7 @@ public class AuthAspect {
return
unAuthenticatedResponse
(
response
,
noAuth
,
joinPoint
);
}
String
uid
=
tokenInfo
.
get
(
GenericAttribute
.
USER_ID
).
toString
();
UserInfo
userInfo
=
i
UserService
.
queryUserInfo
(
uid
,
request
.
getHeader
(
"pid"
));
UserInfo
userInfo
=
UserService
.
queryUserInfo
(
uid
,
request
.
getHeader
(
"pid"
));
if
(!
noAuth
&&
null
==
userInfo
)
{
return
unAuthoriseResponse
(
response
);
}
...
...
src/main/java/com/zhiwei/brandkbs2/common/GlobalPojo.java
View file @
d961690e
package
com
.
zhiwei
.
brandkbs2
.
common
;
import
com.zhiwei.brandkbs2.service.
I
SystemInfoService
;
import
com.zhiwei.brandkbs2.service.SystemInfoService
;
import
com.zhiwei.qbjc.bean.pojo.common.MessagePlatform
;
import
com.zhiwei.qbjc.bean.pojo.common.Tag
;
import
org.apache.logging.log4j.LogManager
;
...
...
@@ -26,7 +26,7 @@ public class GlobalPojo {
public
static
final
Logger
log
=
LogManager
.
getLogger
(
GlobalPojo
.
class
);
@Resource
(
name
=
"systemInfoServiceImpl"
)
private
I
SystemInfoService
systemInfoService
;
private
SystemInfoService
systemInfoService
;
/**
* 监测系统平台
...
...
src/main/java/com/zhiwei/brandkbs2/config/Constant.java
View file @
d961690e
...
...
@@ -8,6 +8,7 @@ package com.zhiwei.brandkbs2.config;
*/
public
class
Constant
{
public
static
final
String
HOUR_PATTERN
=
"yyyy-MM-dd HH"
;
public
static
final
String
DAY_PATTERN
=
"yyyy-MM-dd"
;
/**
...
...
src/main/java/com/zhiwei/brandkbs2/controller/AppArticleController.java
View file @
d961690e
...
...
@@ -4,8 +4,9 @@ import com.zhiwei.brandkbs2.auth.Auth;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.dto.MarkSearchDTO
;
import
com.zhiwei.brandkbs2.service.IMarkDataService
;
import
com.zhiwei.brandkbs2.service.IReportService
;
import
com.zhiwei.brandkbs2.service.CommonService
;
import
com.zhiwei.brandkbs2.service.MarkDataService
;
import
com.zhiwei.brandkbs2.service.ReportService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
...
...
@@ -27,10 +28,13 @@ import javax.annotation.Resource;
public
class
AppArticleController
extends
BaseController
{
@Resource
(
name
=
"markDataServiceImpl"
)
I
MarkDataService
markDataService
;
MarkDataService
markDataService
;
@Resource
(
name
=
"reportServiceImpl"
)
IReportService
reportService
;
ReportService
reportService
;
@Resource
(
name
=
"commonServiceImpl"
)
CommonService
commonService
;
@ApiOperation
(
"舆情列表"
)
@PostMapping
(
"/mark/list"
)
...
...
@@ -62,7 +66,7 @@ public class AppArticleController extends BaseController {
return
ResponseResult
.
success
(
markDataService
.
getMarkSpread
(
startTime
,
endTime
,
true
));
}
@ApiOperation
(
"舆情分析-
平台
曝光对比"
)
@ApiOperation
(
"舆情分析-
品牌
曝光对比"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"startTime"
,
value
=
"开始时间"
,
paramType
=
"query"
,
dataType
=
"long"
),
@ApiImplicitParam
(
name
=
"endTime"
,
value
=
"结束时间"
,
paramType
=
"query"
,
dataType
=
"long"
)
...
...
@@ -102,12 +106,16 @@ public class AppArticleController extends BaseController {
return
ResponseResult
.
success
(
markDataService
.
getMarkHighWord
(
startTime
,
endTime
));
}
@ApiOperation
(
"舆情分析-获取默认时间"
)
@GetMapping
(
"/default/time"
)
public
ResponseResult
getDefaultTime
()
{
return
ResponseResult
.
success
(
commonService
.
getTimeRangeMonth
());
}
@ApiOperation
(
"舆情简报-分类统计"
)
@GetMapping
(
"/aggCount"
)
public
ResponseResult
getReportsAggCount
()
{
return
ResponseResult
.
success
(
reportService
.
getReportsAggCount
());
}
}
src/main/java/com/zhiwei/brandkbs2/controller/CommonController.java
View file @
d961690e
...
...
@@ -3,8 +3,8 @@ package com.zhiwei.brandkbs2.controller;
import
com.zhiwei.brandkbs2.auth.Auth
;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.service.
I
CommonService
;
import
com.zhiwei.brandkbs2.service.
I
ProjectService
;
import
com.zhiwei.brandkbs2.service.CommonService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.middleware.mark.pojo.enums.TagField
;
import
com.zhiwei.middleware.mark.vo.MarkerTag
;
import
io.swagger.annotations.Api
;
...
...
@@ -33,10 +33,10 @@ import java.util.stream.Collectors;
public
class
CommonController
extends
BaseController
{
@Resource
(
name
=
"commonServiceImpl"
)
I
CommonService
commonService
;
CommonService
commonService
;
@Resource
(
name
=
"projectServiceImpl"
)
I
ProjectService
projectService
;
ProjectService
projectService
;
@ApiOperation
(
"获取情感倾向标签信息"
)
@ApiImplicitParam
(
name
=
"linkedGroupId"
,
value
=
"关联项目ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
...
...
@@ -67,4 +67,18 @@ public class CommonController extends BaseController {
return
ResponseResult
.
success
(
projectService
.
getUserAllProjects
());
}
// @ApiOperation("获取默认月间隔时间节点")
// @GetMapping("/time/month")
// @Auth(role = RoleEnum.CUSTOMER)
// public ResponseResult getTimeRangeMonth() {
// return ResponseResult.success(commonService.getTimeRangeMonth());
// }
//
// @ApiOperation("获取默认周间隔时间节点")
// @GetMapping("/time/week")
// @Auth(role = RoleEnum.CUSTOMER)
// public ResponseResult getTimeRangeWeek() {
// return ResponseResult.success(commonService.getTimeRangeWeek());
// }
}
src/main/java/com/zhiwei/brandkbs2/controller/LoginController.java
View file @
d961690e
...
...
@@ -5,8 +5,8 @@ import com.zhiwei.brandkbs2.auth.Auth;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.service.
I
ProjectService
;
import
com.zhiwei.brandkbs2.service.
I
UserService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.service.UserService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
...
...
@@ -36,15 +36,15 @@ public class LoginController extends BaseController {
private
int
jwtHour
;
@Resource
(
name
=
"userServiceImpl"
)
private
IUserService
i
UserService
;
private
UserService
UserService
;
@Resource
(
name
=
"projectServiceImpl"
)
private
IProjectService
i
ProjectService
;
private
ProjectService
ProjectService
;
@ApiOperation
(
"用户登录"
)
@PostMapping
(
"/user/login"
)
public
ResponseResult
login
()
{
return
ResponseResult
.
success
(
i
UserService
.
login
().
toMap
());
return
ResponseResult
.
success
(
UserService
.
login
().
toMap
());
}
@ApiOperation
(
"用户信息获取"
)
...
...
@@ -59,7 +59,7 @@ public class LoginController extends BaseController {
@ApiImplicitParam
(
name
=
"username"
,
value
=
"用户名"
,
required
=
false
,
paramType
=
"query"
,
dataType
=
"string"
))
@PostMapping
(
"/user/bind/reset"
)
public
ResponseResult
resetBind
(
@RequestBody
JSONObject
json
)
{
i
UserService
.
resetBind
(
json
.
getString
(
"username"
));
UserService
.
resetBind
(
json
.
getString
(
"username"
));
return
ResponseResult
.
success
();
}
...
...
@@ -71,25 +71,25 @@ public class LoginController extends BaseController {
public
ResponseResult
bindUser
(
@RequestBody
JSONObject
json
)
{
String
username
=
json
.
getString
(
"username"
);
String
password
=
json
.
getString
(
"password"
);
return
ResponseResult
.
success
(
i
UserService
.
bindUser
(
username
,
password
));
return
ResponseResult
.
success
(
UserService
.
bindUser
(
username
,
password
));
}
@ApiOperation
(
"跳过绑定(赋默认权限)"
)
@PostMapping
(
"/user/bind/skip"
)
public
ResponseResult
skipBindUser
()
{
return
ResponseResult
.
success
(
i
UserService
.
skipBindUser
());
return
ResponseResult
.
success
(
UserService
.
skipBindUser
());
}
@ApiOperation
(
"校验用户是否已有绑定关系"
)
@GetMapping
(
"/user/login/checkBind"
)
public
ResponseResult
checkBind
()
{
return
ResponseResult
.
success
(
i
UserService
.
checkUserRoles
());
return
ResponseResult
.
success
(
UserService
.
checkUserRoles
());
}
@ApiOperation
(
"获取当前用户拥有的所有项目(含过期)"
)
@GetMapping
(
"/user/login/getUserAllProjects"
)
public
ResponseResult
getLoginUserAllProjects
()
{
return
ResponseResult
.
success
(
i
ProjectService
.
getLoginUserAllProjects
());
return
ResponseResult
.
success
(
ProjectService
.
getLoginUserAllProjects
());
}
@ApiOperation
(
"测试接口"
)
...
...
src/main/java/com/zhiwei/brandkbs2/controller/admin/ArticleController.java
View file @
d961690e
...
...
@@ -7,8 +7,8 @@ import com.zhiwei.brandkbs2.controller.BaseController;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.Behavior
;
import
com.zhiwei.brandkbs2.service.
I
BehaviorService
;
import
com.zhiwei.brandkbs2.service.
I
ProjectService
;
import
com.zhiwei.brandkbs2.service.BehaviorService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
...
...
@@ -55,10 +55,10 @@ public class ArticleController extends BaseController {
private
RestTemplate
restTemplate
;
@javax
.
annotation
.
Resource
(
name
=
"behaviorServiceImpl"
)
private
I
BehaviorService
behaviorService
;
private
BehaviorService
behaviorService
;
@javax
.
annotation
.
Resource
(
name
=
"projectServiceImpl"
)
private
I
ProjectService
projectService
;
private
ProjectService
projectService
;
private
static
final
Behavior
.
Operation
OPERATION
=
new
Behavior
.
Operation
(
"稿件上传"
,
true
);
...
...
src/main/java/com/zhiwei/brandkbs2/controller/admin/BaseModuleController.java
View file @
d961690e
...
...
@@ -10,9 +10,9 @@ import com.zhiwei.brandkbs2.enmus.RoleEnum;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.dto.TagFilterDTO
;
import
com.zhiwei.brandkbs2.pojo.vo.ProjectVO
;
import
com.zhiwei.brandkbs2.service.
I
HighWordService
;
import
com.zhiwei.brandkbs2.service.
I
ProjectService
;
import
com.zhiwei.brandkbs2.service.
I
TagFilterService
;
import
com.zhiwei.brandkbs2.service.HighWordService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.service.TagFilterService
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
...
...
@@ -37,13 +37,13 @@ import java.util.List;
public
class
BaseModuleController
extends
BaseController
{
@Resource
(
name
=
"tagFilterServiceImpl"
)
I
TagFilterService
tagFilterService
;
TagFilterService
tagFilterService
;
@Resource
(
name
=
"highWordServiceImpl"
)
I
HighWordService
highWordService
;
HighWordService
highWordService
;
@Resource
(
name
=
"projectServiceImpl"
)
I
ProjectService
projectService
;
ProjectService
projectService
;
@ApiOperation
(
"获取在用筛选器列表"
)
@GetMapping
(
"/tagFilter"
)
...
...
src/main/java/com/zhiwei/brandkbs2/controller/admin/BehaviorController.java
View file @
d961690e
...
...
@@ -7,8 +7,8 @@ import com.zhiwei.brandkbs2.easyexcel.EasyExcelUtil;
import
com.zhiwei.brandkbs2.easyexcel.dto.ExportBehaviorDTO
;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.service.
I
BehaviorService
;
import
com.zhiwei.brandkbs2.service.
I
ProjectService
;
import
com.zhiwei.brandkbs2.service.BehaviorService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
...
...
@@ -34,10 +34,10 @@ import java.util.List;
public
class
BehaviorController
extends
BaseController
{
@Resource
(
name
=
"behaviorServiceImpl"
)
private
I
BehaviorService
behaviorService
;
private
BehaviorService
behaviorService
;
@Resource
(
name
=
"projectServiceImpl"
)
private
IProjectService
i
ProjectService
;
private
ProjectService
ProjectService
;
@ApiOperation
(
"分页查询用户行为列表"
)
@ApiImplicitParams
({
...
...
@@ -72,7 +72,7 @@ public class BehaviorController extends BaseController {
@RequestParam
(
value
=
"behavior"
,
defaultValue
=
"true"
)
boolean
behavior
)
{
List
<
ExportBehaviorDTO
>
downloadList
=
behaviorService
.
download
(
startTime
,
endTime
,
behavior
);
String
behaviorName
=
behavior
?
"后台"
:
"前台"
;
String
sheetName
=
i
ProjectService
.
getProjectVOById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
()
+
"_"
+
behaviorName
;
String
sheetName
=
ProjectService
.
getProjectVOById
(
UserThreadLocal
.
getProjectId
()).
getProjectName
()
+
"_"
+
behaviorName
;
EasyExcelUtil
.
download
(
sheetName
+
"用户行为"
,
sheetName
,
ExportBehaviorDTO
.
class
,
downloadList
,
response
);
return
ResponseResult
.
success
();
}
...
...
src/main/java/com/zhiwei/brandkbs2/controller/admin/ChannelController.java
View file @
d961690e
...
...
@@ -12,8 +12,8 @@ import com.zhiwei.brandkbs2.enmus.RoleEnum;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.dto.ChannelDTO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.service.
I
ChannelService
;
import
com.zhiwei.brandkbs2.service.
I
ProjectService
;
import
com.zhiwei.brandkbs2.service.ChannelService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
...
...
@@ -41,10 +41,10 @@ import java.util.stream.Collectors;
public
class
ChannelController
extends
BaseController
{
@Resource
(
name
=
"channelServiceImpl"
)
I
ChannelService
channelService
;
ChannelService
channelService
;
@Resource
(
name
=
"projectServiceImpl"
)
I
ProjectService
projectService
;
ProjectService
projectService
;
@Value
(
"${brandkbs.img.url}"
)
private
String
brandkbsImgPath
;
...
...
src/main/java/com/zhiwei/brandkbs2/controller/admin/CustomTagController.java
View file @
d961690e
...
...
@@ -6,8 +6,8 @@ import com.zhiwei.brandkbs2.controller.BaseController;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.Behavior
;
import
com.zhiwei.brandkbs2.service.
I
BehaviorService
;
import
com.zhiwei.brandkbs2.service.
I
CustomTagService
;
import
com.zhiwei.brandkbs2.service.BehaviorService
;
import
com.zhiwei.brandkbs2.service.CustomTagService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
...
...
@@ -33,10 +33,10 @@ import static com.alibaba.fastjson.JSON.parseArray;
public
class
CustomTagController
extends
BaseController
{
@Resource
(
name
=
"customTagServiceImpl"
)
private
I
CustomTagService
customTagService
;
private
CustomTagService
customTagService
;
@Resource
(
name
=
"behaviorServiceImpl"
)
private
I
BehaviorService
behaviorService
;
private
BehaviorService
behaviorService
;
private
static
final
Behavior
.
Operation
OPERATION
=
new
Behavior
.
Operation
(
"自定义标签管理"
,
true
);
...
...
src/main/java/com/zhiwei/brandkbs2/controller/admin/EventController.java
View file @
d961690e
This diff is collapsed.
Click to expand it.
src/main/java/com/zhiwei/brandkbs2/controller/admin/ProjectController.java
View file @
d961690e
...
...
@@ -11,9 +11,9 @@ import com.zhiwei.brandkbs2.enmus.RoleEnum;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.Behavior
;
import
com.zhiwei.brandkbs2.pojo.vo.ProjectVO
;
import
com.zhiwei.brandkbs2.service.
I
BehaviorService
;
import
com.zhiwei.brandkbs2.service.
I
CommonService
;
import
com.zhiwei.brandkbs2.service.
I
ProjectService
;
import
com.zhiwei.brandkbs2.service.BehaviorService
;
import
com.zhiwei.brandkbs2.service.CommonService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
com.zhiwei.middleware.mark.vo.MarkerTag
;
import
io.swagger.annotations.Api
;
...
...
@@ -50,13 +50,13 @@ public class ProjectController extends BaseController {
private
RestTemplate
restTemplate
;
@Resource
(
name
=
"projectServiceImpl"
)
private
IProjectService
i
ProjectService
;
private
ProjectService
ProjectService
;
@Resource
(
name
=
"behaviorServiceImpl"
)
private
I
BehaviorService
behaviorService
;
private
BehaviorService
behaviorService
;
@Resource
(
name
=
"commonServiceImpl"
)
private
I
CommonService
commonService
;
private
CommonService
commonService
;
private
static
final
Behavior
.
Operation
OPERATION
=
new
Behavior
.
Operation
(
"项目管理"
,
true
);
...
...
@@ -75,7 +75,7 @@ public class ProjectController extends BaseController {
@ApiOperation
(
"添加项目配置"
)
@PostMapping
(
"/add"
)
public
ResponseResult
addProject
(
@RequestBody
ProjectVO
projectVO
)
{
i
ProjectService
.
addProject
(
projectVO
);
ProjectService
.
addProject
(
projectVO
);
behaviorService
.
pushBehavior
(
OPERATION
,
"添加项目配置:"
+
projectVO
.
getId
(),
request
);
return
ResponseResult
.
success
();
}
...
...
@@ -85,14 +85,14 @@ public class ProjectController extends BaseController {
@ApiImplicitParam
(
name
=
"size"
,
value
=
"每页记录数"
,
required
=
false
,
defaultValue
=
"10"
,
paramType
=
"query"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"keyword"
,
value
=
"搜索关键字"
,
required
=
false
,
defaultValue
=
""
,
paramType
=
"query"
,
dataType
=
"string"
)})
@GetMapping
(
"/list"
)
public
ResponseResult
findProjectList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
int
size
,
@RequestParam
(
value
=
"keyword"
,
defaultValue
=
""
)
String
keyword
)
{
return
ResponseResult
.
success
(
i
ProjectService
.
findProjectList
(
page
,
size
,
keyword
));
return
ResponseResult
.
success
(
ProjectService
.
findProjectList
(
page
,
size
,
keyword
));
}
@ApiOperation
(
"修改项目"
)
@PutMapping
(
"/update"
)
public
ResponseResult
updateProject
(
@RequestBody
ProjectVO
projectVO
)
{
i
ProjectService
.
updateProject
(
projectVO
);
ProjectService
.
updateProject
(
projectVO
);
behaviorService
.
pushBehavior
(
OPERATION
,
"修改项目:"
+
projectVO
.
getId
(),
request
);
return
ResponseResult
.
success
();
}
...
...
@@ -101,7 +101,7 @@ public class ProjectController extends BaseController {
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"项目ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@DeleteMapping
(
"/delete/{pid}"
)
public
ResponseResult
deleteProject
(
@PathVariable
(
"pid"
)
String
pid
)
{
i
ProjectService
.
deleteProject
(
pid
,
UserThreadLocal
.
getProjectId
());
ProjectService
.
deleteProject
(
pid
,
UserThreadLocal
.
getProjectId
());
behaviorService
.
pushBehavior
(
OPERATION
,
"删除项目:"
+
pid
,
request
);
return
ResponseResult
.
success
();
}
...
...
@@ -110,7 +110,7 @@ public class ProjectController extends BaseController {
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"项目ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@PutMapping
(
"/switch/projectShow/{pid}"
)
public
ResponseResult
switchProjectShow
(
@PathVariable
String
pid
)
{
boolean
result
=
i
ProjectService
.
switchProjectShow
(
pid
);
boolean
result
=
ProjectService
.
switchProjectShow
(
pid
);
if
(
result
)
{
behaviorService
.
pushBehavior
(
OPERATION
,
"切换项目展示状态:"
+
pid
,
request
);
return
ResponseResult
.
success
();
...
...
@@ -123,7 +123,7 @@ public class ProjectController extends BaseController {
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"项目ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@PutMapping
(
"/switch/projectStart/{pid}"
)
public
ResponseResult
switchProjectStart
(
@PathVariable
String
pid
)
{
i
ProjectService
.
switchProjectStart
(
pid
);
ProjectService
.
switchProjectStart
(
pid
);
behaviorService
.
pushBehavior
(
OPERATION
,
"切换项目状态:"
+
pid
,
request
);
return
ResponseResult
.
success
();
}
...
...
@@ -132,7 +132,7 @@ public class ProjectController extends BaseController {
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"项目ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@GetMapping
(
"/get/{pid}"
)
public
ResponseResult
getProjectVOById
(
@PathVariable
(
"pid"
)
String
pid
)
{
return
ResponseResult
.
success
(
i
ProjectService
.
getProjectVOById
(
pid
));
return
ResponseResult
.
success
(
ProjectService
.
getProjectVOById
(
pid
));
}
@ApiOperation
(
"图片上传"
)
...
...
@@ -153,7 +153,7 @@ public class ProjectController extends BaseController {
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"项目ID"
,
required
=
true
,
paramType
=
"path"
,
dataType
=
"string"
)
@GetMapping
(
"/download/keyword/{pid}"
)
public
ResponseResult
downloadArticles
(
@PathVariable
(
"pid"
)
String
pid
)
{
ProjectVO
project
=
i
ProjectService
.
getProjectVOById
(
pid
);
ProjectVO
project
=
ProjectService
.
getProjectVOById
(
pid
);
EasyExcelUtil
.
download
(
project
.
getBrandName
()
+
"_命中关键词"
,
"sheet1"
,
UploadKeywordDTO
.
class
,
UploadKeywordDTO
.
change2This
(
project
.
getHitKeywords
()),
response
);
return
ResponseResult
.
success
();
}
...
...
@@ -202,7 +202,7 @@ public class ProjectController extends BaseController {
@GetMapping
(
"/user/getUserAllProjects"
)
@Auth
(
role
=
RoleEnum
.
CUSTOMER
)
public
ResponseResult
getUserAllProjects
()
{
return
ResponseResult
.
success
(
i
ProjectService
.
getUserAllProjects
());
return
ResponseResult
.
success
(
ProjectService
.
getUserAllProjects
());
}
}
src/main/java/com/zhiwei/brandkbs2/controller/admin/ReportController.java
View file @
d961690e
...
...
@@ -4,7 +4,7 @@ import com.zhiwei.brandkbs2.auth.Auth;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.dto.ReportSettingsDTO
;
import
com.zhiwei.brandkbs2.service.
I
ReportService
;
import
com.zhiwei.brandkbs2.service.ReportService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -24,7 +24,7 @@ import javax.annotation.Resource;
public
class
ReportController
{
@Resource
(
name
=
"reportServiceImpl"
)
private
I
ReportService
reportService
;
private
ReportService
reportService
;
@ApiOperation
(
"获取简报设置"
)
...
...
src/main/java/com/zhiwei/brandkbs2/controller/admin/UserController.java
View file @
d961690e
...
...
@@ -6,8 +6,8 @@ import com.zhiwei.brandkbs2.enmus.RoleEnum;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.Behavior
;
import
com.zhiwei.brandkbs2.pojo.dto.UserDTO
;
import
com.zhiwei.brandkbs2.service.
I
BehaviorService
;
import
com.zhiwei.brandkbs2.service.
I
UserService
;
import
com.zhiwei.brandkbs2.service.BehaviorService
;
import
com.zhiwei.brandkbs2.service.UserService
;
import
com.zhiwei.middleware.auth.pojo.CenterUser
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
...
...
@@ -31,10 +31,10 @@ import javax.annotation.Resource;
public
class
UserController
extends
BaseController
{
@Resource
(
name
=
"userServiceImpl"
)
private
IUserService
i
UserService
;
private
UserService
UserService
;
@Resource
(
name
=
"behaviorServiceImpl"
)
private
I
BehaviorService
behaviorService
;
private
BehaviorService
behaviorService
;
private
static
final
Behavior
.
Operation
OPERATION
=
new
Behavior
.
Operation
(
"用户管理"
,
true
);
...
...
@@ -55,7 +55,7 @@ public class UserController extends BaseController {
@RequestParam
(
value
=
"keyword"
,
defaultValue
=
""
)
String
keyword
,
@RequestParam
(
value
=
"pid"
)
String
pid
,
@RequestParam
(
value
=
"role"
,
defaultValue
=
"-1"
)
int
role
)
{
return
ResponseResult
.
success
(
i
UserService
.
findUserList
(
page
,
size
,
keyword
,
pid
,
role
));
return
ResponseResult
.
success
(
UserService
.
findUserList
(
page
,
size
,
keyword
,
pid
,
role
));
}
@ApiOperation
(
"根据手机号搜索用户信息"
)
...
...
@@ -77,7 +77,7 @@ public class UserController extends BaseController {
@ApiOperation
(
"添加用户"
)
@PostMapping
(
"/add"
)
public
ResponseResult
addUser
(
@RequestBody
UserDTO
userDTO
)
{
i
UserService
.
addUser
(
userDTO
);
UserService
.
addUser
(
userDTO
);
behaviorService
.
pushBehavior
(
OPERATION
,
"添加用户:"
+
userDTO
.
getId
(),
request
);
return
ResponseResult
.
success
();
}
...
...
@@ -89,7 +89,7 @@ public class UserController extends BaseController {
@DeleteMapping
(
"/delete"
)
@Auth
(
role
=
RoleEnum
.
ADMIN
)
public
ResponseResult
deleteUser
(
@RequestParam
(
value
=
"uid"
)
String
userId
,
@RequestParam
(
value
=
"pid"
)
String
pid
)
{
i
UserService
.
deleteUser
(
userId
,
pid
);
UserService
.
deleteUser
(
userId
,
pid
);
behaviorService
.
pushBehavior
(
OPERATION
,
"删除用户:"
+
userId
,
request
);
return
ResponseResult
.
success
();
}
...
...
@@ -97,7 +97,7 @@ public class UserController extends BaseController {
@ApiOperation
(
"编辑用户"
)
@PutMapping
(
"/update"
)
public
ResponseResult
updateUser
(
@RequestBody
UserDTO
userDTO
)
{
i
UserService
.
updateUser
(
userDTO
);
UserService
.
updateUser
(
userDTO
);
behaviorService
.
pushBehavior
(
OPERATION
,
"编辑用户:"
+
userDTO
,
request
);
return
ResponseResult
.
success
();
}
...
...
@@ -113,14 +113,14 @@ public class UserController extends BaseController {
public
ResponseResult
findSuperAdminList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
int
size
,
@RequestParam
(
value
=
"keyword"
,
defaultValue
=
""
)
String
keyword
)
{
return
ResponseResult
.
success
(
i
UserService
.
findSuperAdminList
(
page
,
size
,
keyword
));
return
ResponseResult
.
success
(
UserService
.
findSuperAdminList
(
page
,
size
,
keyword
));
}
@ApiOperation
(
"添加超级管理员"
)
@PostMapping
(
"/add/superAdmin"
)
@Auth
(
role
=
RoleEnum
.
SUPER_ADMIN
)
public
ResponseResult
addSuperAdmin
(
@RequestBody
UserDTO
userDTO
)
{
i
UserService
.
addSuperAdmin
(
userDTO
);
UserService
.
addSuperAdmin
(
userDTO
);
behaviorService
.
pushBehavior
(
OPERATION
,
"添加超级管理员:"
+
userDTO
.
getId
(),
request
);
return
ResponseResult
.
success
();
}
...
...
@@ -131,7 +131,7 @@ public class UserController extends BaseController {
@DeleteMapping
(
"/delete/superAdmin"
)
@Auth
(
role
=
RoleEnum
.
SUPER_ADMIN
)
public
ResponseResult
deleteSuperAdmin
(
@RequestParam
(
value
=
"uid"
)
String
userId
)
{
i
UserService
.
deleteSuperAdmin
(
userId
);
UserService
.
deleteSuperAdmin
(
userId
);
behaviorService
.
pushBehavior
(
OPERATION
,
"删除超级管理员:"
+
userId
,
request
);
return
ResponseResult
.
success
();
}
...
...
src/main/java/com/zhiwei/brandkbs2/easyexcel/listener/EventFileListener.java
View file @
d961690e
...
...
@@ -3,7 +3,7 @@ package com.zhiwei.brandkbs2.easyexcel.listener;
import
com.alibaba.excel.context.AnalysisContext
;
import
com.alibaba.excel.event.AnalysisEventListener
;
import
com.zhiwei.brandkbs2.easyexcel.dto.UploadEventDTO
;
import
com.zhiwei.brandkbs2.service.
I
EventService
;
import
com.zhiwei.brandkbs2.service.EventService
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.ArrayList
;
...
...
@@ -25,12 +25,12 @@ public class EventFileListener extends AnalysisEventListener<UploadEventDTO> {
* 储存解析数据集合
*/
private
final
List
<
UploadEventDTO
>
datas
=
new
ArrayList
<>(
BATCH_COUNT
);
private
final
IEventService
i
EventService
;
private
final
EventService
EventService
;
private
final
String
projectId
;
private
final
String
linkedGroupId
;
public
EventFileListener
(
IEventService
i
EventService
,
String
projectId
,
String
linkedGroupId
)
{
this
.
iEventService
=
i
EventService
;
public
EventFileListener
(
EventService
EventService
,
String
projectId
,
String
linkedGroupId
)
{
this
.
EventService
=
EventService
;
this
.
projectId
=
projectId
;
this
.
linkedGroupId
=
linkedGroupId
;
}
...
...
@@ -65,6 +65,6 @@ public class EventFileListener extends AnalysisEventListener<UploadEventDTO> {
* 保存更新事件信息逻辑
*/
private
void
addFileEvent
()
{
datas
.
forEach
(
eventDTO
->
i
EventService
.
addFileEvent
(
projectId
,
linkedGroupId
,
eventDTO
));
datas
.
forEach
(
eventDTO
->
EventService
.
addFileEvent
(
projectId
,
linkedGroupId
,
eventDTO
));
}
}
src/main/java/com/zhiwei/brandkbs2/pojo/MarkFlowEntity.java
View file @
d961690e
...
...
@@ -37,6 +37,11 @@ public class MarkFlowEntity {
private
JSONObject
type
;
/**
* 信息字段
*/
private
JSONObject
info
;
/**
* 消息内容
*/
private
Object
data
;
...
...
@@ -82,6 +87,7 @@ public class MarkFlowEntity {
CompleteText
completeText
=
CompleteText
.
restoreFromEs
(
tJson
);
this
.
type
=
FlowEntityUtil
.
getCompleteTextType
(
completeText
);
this
.
data
=
completeText
;
this
.
info
=
createInfoWithEmotion
(
tJson
);
break
;
case
INCOMPLETE:
if
(!
Tools
.
isEmpty
(
tJson
.
get
(
"ind_full_text"
)))
{
...
...
@@ -90,6 +96,7 @@ public class MarkFlowEntity {
IncompleteText
incompleteText
=
IncompleteText
.
restoreFromEs
(
tJson
);
this
.
type
=
FlowEntityUtil
.
getIncompleteTextType
(
incompleteText
);
this
.
data
=
incompleteText
;
this
.
info
=
createInfoWithEmotion
(
tJson
);
break
;
case
QA:
if
(!
Tools
.
isEmpty
(
tJson
.
get
(
"ind_full_text"
)))
{
...
...
@@ -104,6 +111,7 @@ public class MarkFlowEntity {
QAText
qaText
=
QAText
.
restoreFromEs
(
tJson
);
this
.
type
=
FlowEntityUtil
.
getQaTextType
(
qaText
);
this
.
data
=
qaText
;
this
.
info
=
createInfoWithEmotion
(
tJson
);
break
;
case
VIDEO:
if
(!
Tools
.
isEmpty
(
tJson
.
get
(
"ind_full_text"
)))
{
...
...
@@ -115,10 +123,23 @@ public class MarkFlowEntity {
Video
video
=
Video
.
restoreFromEs
(
tJson
);
this
.
type
=
FlowEntityUtil
.
getVideoType
(
video
);
this
.
data
=
video
;
this
.
info
=
createInfoWithEmotion
(
tJson
);
break
;
default
:
break
;
}
}
private
JSONObject
createInfoWithEmotion
(
JSONObject
tJson
)
{
JSONObject
info
=
new
JSONObject
();
String
emotion
=
Tools
.
getEmotion
(
tJson
);
if
(
null
==
emotion
)
{
info
.
put
(
"hasTag"
,
false
);
return
info
;
}
info
.
put
(
"hasTag"
,
true
);
info
.
put
(
"showEmotion"
,
emotion
);
return
info
;
}
}
src/main/java/com/zhiwei/brandkbs2/pojo/dto/EventSearchDTO.java
View file @
d961690e
...
...
@@ -10,7 +10,7 @@ import java.util.Map;
/**
* @ClassName: EventSearchDto
* @Description
TODO
* @Description
EventSearchDto
* @author: sjj
* @date: 2022-05-20 14:07
*/
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
BehaviorService.java
→
src/main/java/com/zhiwei/brandkbs2/service/BehaviorService.java
View file @
d961690e
...
...
@@ -9,12 +9,12 @@ import javax.servlet.http.HttpServletRequest;
import
java.util.List
;
/**
* @ClassName:
I
BehaviorService
* @ClassName: BehaviorService
* @Description 用户行为业务接口
* @author: sjj
* @date: 2022-05-27 11:05
*/
public
interface
I
BehaviorService
{
public
interface
BehaviorService
{
/**
* 添加用户行为
*
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
BrandkbsTaskService.java
→
src/main/java/com/zhiwei/brandkbs2/service/BrandkbsTaskService.java
View file @
d961690e
...
...
@@ -9,7 +9,7 @@ import com.zhiwei.brandkbs2.pojo.BrandkbsTask;
* @description 定时任务业务接口
* @date 2019/12/12 13:58
*/
public
interface
I
BrandkbsTaskService
{
public
interface
BrandkbsTaskService
{
/**
* 根据任务名称获取任务
*
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
ChannelService.java
→
src/main/java/com/zhiwei/brandkbs2/service/ChannelService.java
View file @
d961690e
...
...
@@ -10,12 +10,12 @@ import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import
java.util.List
;
/**
* @ClassName:
I
ChannelService
* @Description
I
ChannelService
* @ClassName: ChannelService
* @Description ChannelService
* @author: sjj
* @date: 2022-06-16 16:00
*/
public
interface
I
ChannelService
{
public
interface
ChannelService
{
/**
* 根据搜索条件查询渠道列表
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
CommonService.java
→
src/main/java/com/zhiwei/brandkbs2/service/CommonService.java
View file @
d961690e
...
...
@@ -12,7 +12,7 @@ import java.util.List;
* @author: sjj
* @date: 2022-06-02 11:22
*/
public
interface
I
CommonService
{
public
interface
CommonService
{
/**
* 获取qbjcTags
...
...
@@ -34,13 +34,20 @@ public interface ICommonService {
/**
* 获取qbjcPlatform名称
*
* @return 平台名称
*/
List
<
String
>
getQbjcPlatformNames
();
/**
* 获取qbjcPlatform
*
* @return 平台
*/
List
<
JSONObject
>
getQbjcPlatform
(
String
...
includeFields
);
Long
[]
getTimeRangeMonth
();
Long
[]
getTimeRangeWeek
();
}
src/main/java/com/zhiwei/brandkbs2/service/
I
CustomTagService.java
→
src/main/java/com/zhiwei/brandkbs2/service/CustomTagService.java
View file @
d961690e
...
...
@@ -12,7 +12,7 @@ import java.util.List;
* @description 自定义标签业务接口
* @date 2022年3月24日15:20:16
*/
public
interface
I
CustomTagService
{
public
interface
CustomTagService
{
/**
* 分页查询该项目所有自定义标签数据
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
EventDataService.java
→
src/main/java/com/zhiwei/brandkbs2/service/EventDataService.java
View file @
d961690e
...
...
@@ -3,12 +3,12 @@ package com.zhiwei.brandkbs2.service;
import
com.zhiwei.brandkbs2.pojo.Event
;
/**
* @ClassName:
I
EventDataService
* @ClassName: EventDataService
* @Description 事件数据业务接口抽象类
* @author: sjj
* @date: 2022-05-23 17:48
*/
public
interface
I
EventDataService
{
public
interface
EventDataService
{
/**
* 更新事件数据
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
EventService.java
→
src/main/java/com/zhiwei/brandkbs2/service/EventService.java
View file @
d961690e
...
...
@@ -16,12 +16,12 @@ import org.springframework.web.multipart.MultipartFile;
import
java.util.List
;
/**
* @ClassName:
I
EventService
* @ClassName: EventService
* @Description 事件管理业务接口
* @author: sjj
* @date: 2022-05-17 16:32
*/
public
interface
I
EventService
{
public
interface
EventService
{
/**
* 根据事件id查询事件
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
HighWordService.java
→
src/main/java/com/zhiwei/brandkbs2/service/HighWordService.java
View file @
d961690e
...
...
@@ -7,12 +7,12 @@ import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import
java.util.List
;
/**
* @ClassName:
I
HighWordService
* @ClassName: HighWordService
* @Description 高频词服务接口
* @author: sjj
* @date: 2022-06-06 09:59
*/
public
interface
I
HighWordService
{
public
interface
HighWordService
{
/**
* 分页查询高频词列表
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
MarkDataService.java
→
src/main/java/com/zhiwei/brandkbs2/service/MarkDataService.java
View file @
d961690e
...
...
@@ -8,12 +8,12 @@ import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import
java.util.List
;
/**
* @ClassName:
I
MarkDataService
* @ClassName: MarkDataService
* @Description: 标注数据服务抽象类
* @author: sjj
* @date: 2022-06-28 14:04
*/
public
interface
I
MarkDataService
{
public
interface
MarkDataService
{
/**
* @param markSearchDTO 标注数据搜索传输类
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
ProjectService.java
→
src/main/java/com/zhiwei/brandkbs2/service/ProjectService.java
View file @
d961690e
...
...
@@ -13,7 +13,7 @@ import java.util.List;
* @description 项目业务接口
* @date 2022年4月18日16:49:10
*/
public
interface
I
ProjectService
{
public
interface
ProjectService
{
/**
* 添加项目
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
ReportService.java
→
src/main/java/com/zhiwei/brandkbs2/service/ReportService.java
View file @
d961690e
...
...
@@ -6,12 +6,12 @@ import com.zhiwei.brandkbs2.pojo.dto.ReportSettingsDTO;
import
java.util.Map
;
/**
* @ClassName:
I
ReportService
* @ClassName: ReportService
* @Description 报告业务接口
* @author: sjj
* @date: 2022-05-31 18:00
*/
public
interface
I
ReportService
{
public
interface
ReportService
{
/**
* 获取项目报告配置信息
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
SystemInfoService.java
→
src/main/java/com/zhiwei/brandkbs2/service/SystemInfoService.java
View file @
d961690e
...
...
@@ -6,12 +6,12 @@ import com.zhiwei.qbjc.bean.pojo.common.Tag;
import
java.util.List
;
/**
* @ClassName:
I
SystemInfoService
* @ClassName: SystemInfoService
* @Description 监测系统相关infoService
* @author: sjj
* @date: 2022-06-16 14:19
*/
public
interface
I
SystemInfoService
{
public
interface
SystemInfoService
{
/**
* 获取监测系统Platforms
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
TagFilterService.java
→
src/main/java/com/zhiwei/brandkbs2/service/TagFilterService.java
View file @
d961690e
...
...
@@ -10,7 +10,7 @@ import java.util.List;
* @author: sjj
* @date: 2022-06-01 13:40
*/
public
interface
I
TagFilterService
{
public
interface
TagFilterService
{
/**
* 获取在用筛选器列表
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
TaskService.java
→
src/main/java/com/zhiwei/brandkbs2/service/TaskService.java
View file @
d961690e
package
com
.
zhiwei
.
brandkbs2
.
service
;
/**
* @ClassName:
I
TaskService
* @ClassName: TaskService
* @Description 定时服务抽象类
* @author: sjj
* @date: 2022-06-16 15:27
*/
public
interface
I
TaskService
{
public
interface
TaskService
{
/**
* 渠道记录
...
...
src/main/java/com/zhiwei/brandkbs2/service/
I
UserService.java
→
src/main/java/com/zhiwei/brandkbs2/service/UserService.java
View file @
d961690e
...
...
@@ -8,12 +8,12 @@ import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import
java.util.List
;
/**
* @ClassName:
I
UserService
* @ClassName: UserService
* @Description 用户管理服务接口
* @author: sjj
* @date: 2022-04-28 14:58
*/
public
interface
I
UserService
{
public
interface
UserService
{
/**
* 用户登录
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/BehaviorServiceImpl.java
View file @
d961690e
...
...
@@ -11,7 +11,7 @@ import com.zhiwei.brandkbs2.pojo.User;
import
com.zhiwei.brandkbs2.pojo.UserRole
;
import
com.zhiwei.brandkbs2.pojo.vo.BehaviorVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.service.
I
BehaviorService
;
import
com.zhiwei.brandkbs2.service.BehaviorService
;
import
com.zhiwei.brandkbs2.util.MongoUtil
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
org.apache.commons.collections4.CollectionUtils
;
...
...
@@ -39,7 +39,7 @@ import java.util.stream.Collectors;
* @date: 2022-05-27 13:41
*/
@Service
(
"behaviorServiceImpl"
)
public
class
BehaviorServiceImpl
implements
I
BehaviorService
{
public
class
BehaviorServiceImpl
implements
BehaviorService
{
public
static
final
Logger
log
=
LogManager
.
getLogger
(
BehaviorServiceImpl
.
class
);
@Resource
(
name
=
"behaviorDao"
)
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/BrandkbsTaskServiceImpl.java
View file @
d961690e
...
...
@@ -3,7 +3,7 @@ package com.zhiwei.brandkbs2.service.impl;
import
com.zhiwei.brandkbs2.config.Constant
;
import
com.zhiwei.brandkbs2.dao.IBrandkbsTaskDao
;
import
com.zhiwei.brandkbs2.pojo.BrandkbsTask
;
import
com.zhiwei.brandkbs2.service.
I
BrandkbsTaskService
;
import
com.zhiwei.brandkbs2.service.BrandkbsTaskService
;
import
org.springframework.data.mongodb.core.query.Update
;
import
org.springframework.stereotype.Service
;
...
...
@@ -17,7 +17,7 @@ import java.util.Objects;
* @date: 2022-07-12 17:38
*/
@Service
public
class
BrandkbsTaskServiceImpl
implements
I
BrandkbsTaskService
{
public
class
BrandkbsTaskServiceImpl
implements
BrandkbsTaskService
{
@Resource
(
name
=
"brandkbsTaskDao"
)
private
IBrandkbsTaskDao
brandkbsTaskDao
;
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/ChannelServiceImpl.java
View file @
d961690e
...
...
@@ -16,7 +16,7 @@ import com.zhiwei.brandkbs2.model.CommonCodeEnum;
import
com.zhiwei.brandkbs2.pojo.*
;
import
com.zhiwei.brandkbs2.pojo.dto.ChannelDTO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.service.
I
ChannelService
;
import
com.zhiwei.brandkbs2.service.ChannelService
;
import
com.zhiwei.brandkbs2.util.MongoUtil
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
org.apache.commons.collections4.CollectionUtils
;
...
...
@@ -38,7 +38,7 @@ import java.util.stream.Collectors;
* @date: 2022-06-16 16:07
*/
@Service
(
"channelServiceImpl"
)
public
class
ChannelServiceImpl
implements
I
ChannelService
{
public
class
ChannelServiceImpl
implements
ChannelService
{
@Resource
(
name
=
"eventDataDao"
)
IEventDataDao
eventDataDao
;
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/CommonServiceImpl.java
View file @
d961690e
package
com
.
zhiwei
.
brandkbs2
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zhiwei.brandkbs2.service.ICommonService
;
import
com.zhiwei.brandkbs2.service.IProjectService
;
import
com.zhiwei.brandkbs2.common.GenericAttribute
;
import
com.zhiwei.brandkbs2.config.Constant
;
import
com.zhiwei.brandkbs2.service.CommonService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
com.zhiwei.middleware.mark.pojo.enums.TagField
;
import
com.zhiwei.middleware.mark.service.MarkerClient
;
import
com.zhiwei.middleware.mark.vo.MarkerTag
;
import
com.zhiwei.middleware.mark.vo.TagSearch
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpEntity
;
...
...
@@ -14,10 +18,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.web.client.RestTemplate
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -27,13 +28,13 @@ import java.util.stream.Collectors;
* @date: 2022-06-02 11:23
*/
@Service
(
"commonServiceImpl"
)
public
class
CommonServiceImpl
implements
I
CommonService
{
public
class
CommonServiceImpl
implements
CommonService
{
@Value
(
"${qbjc.platform.url}"
)
private
String
qbjcPlatformUrl
;
@Resource
(
name
=
"projectServiceImpl"
)
private
I
ProjectService
projectService
;
private
ProjectService
projectService
;
@Autowired
private
MarkerClient
markClient
;
...
...
@@ -71,8 +72,7 @@ public class CommonServiceImpl implements ICommonService {
@Override
public
List
<
String
>
getQbjcPlatformNames
()
{
HttpEntity
<
JSONObject
>
entity
=
restTemplate
.
getForEntity
(
qbjcPlatformUrl
,
JSONObject
.
class
);
return
Objects
.
requireNonNull
(
entity
.
getBody
()).
getJSONArray
(
"data"
).
toJavaList
(
JSONObject
.
class
).
stream
().
map
(
json
->
json
.
getString
(
"name"
))
.
collect
(
Collectors
.
toList
());
return
Objects
.
requireNonNull
(
entity
.
getBody
()).
getJSONArray
(
"data"
).
toJavaList
(
JSONObject
.
class
).
stream
().
map
(
json
->
json
.
getString
(
"name"
)).
collect
(
Collectors
.
toList
());
}
@Override
...
...
@@ -90,4 +90,18 @@ public class CommonServiceImpl implements ICommonService {
}).
collect
(
Collectors
.
toList
());
}
@Override
public
Long
[]
getTimeRangeMonth
()
{
long
endTime
=
DateUtils
.
addDays
(
Tools
.
truncDate
(
new
Date
(),
Constant
.
DAY_PATTERN
),
1
).
getTime
();
long
startTime
=
DateUtils
.
addMonths
(
new
Date
(
endTime
),
-
1
).
getTime
();
return
new
Long
[]{
startTime
,
endTime
};
}
@Override
public
Long
[]
getTimeRangeWeek
()
{
long
endTime
=
DateUtils
.
addDays
(
Tools
.
truncDate
(
new
Date
(),
Constant
.
DAY_PATTERN
),
1
).
getTime
();
long
startTime
=
DateUtils
.
addWeeks
(
new
Date
(
endTime
),
-
1
).
getTime
();
return
new
Long
[]{
startTime
,
endTime
};
}
}
src/main/java/com/zhiwei/brandkbs2/service/impl/CustomTagServiceImpl.java
View file @
d961690e
...
...
@@ -10,7 +10,7 @@ import com.zhiwei.brandkbs2.model.CommonCodeEnum;
import
com.zhiwei.brandkbs2.pojo.CustomTag
;
import
com.zhiwei.brandkbs2.pojo.vo.CustomTagVo
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.service.
I
CustomTagService
;
import
com.zhiwei.brandkbs2.service.CustomTagService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.elasticsearch.action.DocWriteResponse
;
import
org.elasticsearch.action.update.UpdateRequest
;
...
...
@@ -30,7 +30,7 @@ import java.util.stream.Collectors;
* @date 2022年3月24日18:22:53
*/
@Service
public
class
CustomTagServiceImpl
implements
I
CustomTagService
{
public
class
CustomTagServiceImpl
implements
CustomTagService
{
@Resource
(
name
=
"customTagDao"
)
private
ICustomTagDao
customTagDao
;
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/EventDataServiceImpl.java
View file @
d961690e
...
...
@@ -5,7 +5,7 @@ import com.zhiwei.brandkbs2.dao.IEventDataDao;
import
com.zhiwei.brandkbs2.es.EsClientDao
;
import
com.zhiwei.brandkbs2.pojo.Event
;
import
com.zhiwei.brandkbs2.pojo.EventData
;
import
com.zhiwei.brandkbs2.service.
I
EventDataService
;
import
com.zhiwei.brandkbs2.service.EventDataService
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
...
...
@@ -25,7 +25,7 @@ import java.util.stream.Collectors;
* @date: 2022-05-23 17:49
*/
@Service
(
"eventDataServiceImpl"
)
public
class
EventDataServiceImpl
implements
I
EventDataService
{
public
class
EventDataServiceImpl
implements
EventDataService
{
public
static
final
Logger
log
=
LogManager
.
getLogger
(
EventDataServiceImpl
.
class
);
@Resource
(
name
=
"eventDao"
)
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/EventServiceImpl.java
View file @
d961690e
...
...
@@ -26,9 +26,9 @@ import com.zhiwei.brandkbs2.pojo.dto.YqEventDTO;
import
com.zhiwei.brandkbs2.pojo.vo.EventVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.pojo.vo.YqEventSearchVO
;
import
com.zhiwei.brandkbs2.service.
I
EventDataService
;
import
com.zhiwei.brandkbs2.service.
I
EventService
;
import
com.zhiwei.brandkbs2.service.
I
ProjectService
;
import
com.zhiwei.brandkbs2.service.EventDataService
;
import
com.zhiwei.brandkbs2.service.EventService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.util.MongoUtil
;
import
com.zhiwei.brandkbs2.util.Tools
;
import
org.apache.commons.collections4.CollectionUtils
;
...
...
@@ -62,7 +62,7 @@ import java.util.stream.Collectors;
* @date: 2022-05-17 16:36
*/
@Service
(
"eventServiceImpl"
)
public
class
EventServiceImpl
implements
I
EventService
{
public
class
EventServiceImpl
implements
EventService
{
private
static
final
Logger
log
=
LogManager
.
getLogger
(
EventServiceImpl
.
class
);
@Value
(
"${qbjc.event.tag.url}"
)
...
...
@@ -81,10 +81,10 @@ public class EventServiceImpl implements IEventService {
private
IEventDataDao
eventDataDao
;
@Resource
(
name
=
"eventDataServiceImpl"
)
private
I
EventDataService
eventDataService
;
private
EventDataService
eventDataService
;
@Resource
(
name
=
"projectServiceImpl"
)
private
I
ProjectService
projectService
;
private
ProjectService
projectService
;
@Resource
(
name
=
"mongoUtil"
)
private
com
.
zhiwei
.
brandkbs2
.
util
.
MongoUtil
mongoUtil
;
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/HighWordServiceImpl.java
View file @
d961690e
...
...
@@ -6,7 +6,7 @@ import com.zhiwei.brandkbs2.dao.IHighWordDao;
import
com.zhiwei.brandkbs2.easyexcel.dto.ExportHighWordDTO
;
import
com.zhiwei.brandkbs2.pojo.HighWord
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.service.
I
HighWordService
;
import
com.zhiwei.brandkbs2.service.HighWordService
;
import
com.zhiwei.brandkbs2.util.MongoUtil
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
...
...
@@ -23,7 +23,7 @@ import java.util.stream.Collectors;
* @date: 2022-06-06 10:02
*/
@Service
(
"highWordServiceImpl"
)
public
class
HighWordServiceImpl
implements
I
HighWordService
{
public
class
HighWordServiceImpl
implements
HighWordService
{
@Resource
(
name
=
"highWordDao"
)
IHighWordDao
highWordDao
;
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/MarkDataServiceImpl.java
View file @
d961690e
This diff is collapsed.
Click to expand it.
src/main/java/com/zhiwei/brandkbs2/service/impl/ProjectServiceImpl.java
View file @
d961690e
...
...
@@ -13,7 +13,7 @@ import com.zhiwei.brandkbs2.pojo.Project;
import
com.zhiwei.brandkbs2.pojo.User
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.pojo.vo.ProjectVO
;
import
com.zhiwei.brandkbs2.service.
I
ProjectService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.util.MongoUtil
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
@@ -32,7 +32,7 @@ import java.util.stream.Collectors;
* @date 2022年4月18日16:49:10
*/
@Service
(
"projectServiceImpl"
)
public
class
ProjectServiceImpl
implements
I
ProjectService
{
public
class
ProjectServiceImpl
implements
ProjectService
{
@Resource
(
name
=
"userDao"
)
private
IUserDao
userDao
;
...
...
@@ -62,7 +62,7 @@ public class ProjectServiceImpl implements IProjectService {
}
//给超管添加该项目权限,并且初始化预警推送 TODO
// for (Integer SUPER_ADMINUid : userMapper.getAllSUPER_ADMINUids()) {
//
i
UserService.insertAdminRoleAndWarn(SUPER_ADMINUid, project.getId());
// UserService.insertAdminRoleAndWarn(SUPER_ADMINUid, project.getId());
// }
projectDao
.
insertOneWithoutId
(
projectVO
.
creatProject
(
new
Date
()));
}
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/ReportServiceImpl.java
View file @
d961690e
...
...
@@ -9,8 +9,8 @@ import com.zhiwei.brandkbs2.exception.ExceptionCast;
import
com.zhiwei.brandkbs2.model.CommonCodeEnum
;
import
com.zhiwei.brandkbs2.pojo.ReportSettings
;
import
com.zhiwei.brandkbs2.pojo.dto.ReportSettingsDTO
;
import
com.zhiwei.brandkbs2.service.
I
ProjectService
;
import
com.zhiwei.brandkbs2.service.
I
ReportService
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
import
com.zhiwei.brandkbs2.service.ReportService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
...
...
@@ -31,7 +31,7 @@ import java.util.stream.Collectors;
* @date: 2022-05-31 18:01
*/
@Service
(
"reportServiceImpl"
)
public
class
ReportServiceImpl
implements
I
ReportService
{
public
class
ReportServiceImpl
implements
ReportService
{
public
static
final
Logger
log
=
LogManager
.
getLogger
(
ReportServiceImpl
.
class
);
@Resource
(
name
=
"reportDao"
)
...
...
@@ -41,7 +41,7 @@ public class ReportServiceImpl implements IReportService {
IReportSettingsDao
reportSettingsDao
;
@Resource
(
name
=
"projectServiceImpl"
)
I
ProjectService
projectService
;
ProjectService
projectService
;
@Override
public
Map
<
String
,
ReportSettingsDTO
>
getReportSettings
()
{
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/SystemInfoServiceImpl.java
View file @
d961690e
package
com
.
zhiwei
.
brandkbs2
.
service
.
impl
;
import
com.zhiwei.brandkbs2.dao.IQbjcPojoDao
;
import
com.zhiwei.brandkbs2.service.
I
SystemInfoService
;
import
com.zhiwei.brandkbs2.service.SystemInfoService
;
import
com.zhiwei.qbjc.bean.pojo.common.MessagePlatform
;
import
com.zhiwei.qbjc.bean.pojo.common.Tag
;
import
org.springframework.stereotype.Service
;
...
...
@@ -10,13 +10,13 @@ import javax.annotation.Resource;
import
java.util.List
;
/**
* @ClassName:
I
SystemInfoServiceImpl
* @Description
I
SystemInfoServiceImpl
* @ClassName: SystemInfoServiceImpl
* @Description SystemInfoServiceImpl
* @author: sjj
* @date: 2022-06-16 14:21
*/
@Service
(
"systemInfoServiceImpl"
)
public
class
SystemInfoServiceImpl
implements
I
SystemInfoService
{
public
class
SystemInfoServiceImpl
implements
SystemInfoService
{
@Resource
(
name
=
"qbjcPojoDao"
)
private
IQbjcPojoDao
qbjcPojoDao
;
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/TagFilterServiceImpl.java
View file @
d961690e
...
...
@@ -4,12 +4,11 @@ import com.zhiwei.brandkbs2.auth.UserThreadLocal;
import
com.zhiwei.brandkbs2.dao.ITagFilterDao
;
import
com.zhiwei.brandkbs2.pojo.TagFilter
;
import
com.zhiwei.brandkbs2.pojo.dto.TagFilterDTO
;
import
com.zhiwei.brandkbs2.service.
I
CommonService
;
import
com.zhiwei.brandkbs2.service.
IProject
Service
;
import
com.zhiwei.brandkbs2.service.
ITagFilter
Service
;
import
com.zhiwei.brandkbs2.service.CommonService
;
import
com.zhiwei.brandkbs2.service.
TagFilter
Service
;
import
com.zhiwei.brandkbs2.service.
Project
Service
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
...
...
@@ -24,16 +23,16 @@ import java.util.stream.Collectors;
* @date: 2022-06-01 13:40
*/
@Service
(
"tagFilterServiceImpl"
)
public
class
TagFilterServiceImpl
implements
I
TagFilterService
{
public
class
TagFilterServiceImpl
implements
TagFilterService
{
@Resource
(
name
=
"tagFilterDao"
)
private
ITagFilterDao
tagFilterDao
;
@Resource
(
name
=
"commonServiceImpl"
)
private
I
CommonService
commonService
;
private
CommonService
commonService
;
@Resource
(
name
=
"projectServiceImpl"
)
private
I
ProjectService
projectService
;
private
ProjectService
projectService
;
@Override
public
List
<
TagFilterDTO
>
getTagFilter
()
{
...
...
src/main/java/com/zhiwei/brandkbs2/service/impl/TaskServiceImpl.java
View file @
d961690e
...
...
@@ -8,7 +8,7 @@ import com.zhiwei.brandkbs2.es.EsClientDao;
import
com.zhiwei.brandkbs2.pojo.BrandkbsTask
;
import
com.zhiwei.brandkbs2.pojo.Channel
;
import
com.zhiwei.brandkbs2.pojo.ChannelIndex
;
import
com.zhiwei.brandkbs2.service.
I
TaskService
;
import
com.zhiwei.brandkbs2.service.TaskService
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.stereotype.Service
;
...
...
@@ -25,7 +25,7 @@ import java.util.Map;
* @date: 2022-06-16 15:28
*/
@Service
(
"taskServiceImpl"
)
public
class
TaskServiceImpl
implements
I
TaskService
{
public
class
TaskServiceImpl
implements
TaskService
{
public
static
final
Logger
log
=
LogManager
.
getLogger
(
TaskServiceImpl
.
class
);
@Resource
(
name
=
"esClientDao"
)
...
...
@@ -66,5 +66,8 @@ public class TaskServiceImpl implements ITaskService {
public
void
reportSend
()
{
Date
now
=
new
Date
();
BrandkbsTask
task
=
brandkbsTaskDao
.
findTaskByTaskNameAndVersion
(
Constant
.
TASK_REPORT_JOB
,
Constant
.
INIT_VERSION
);
}
}
src/main/java/com/zhiwei/brandkbs2/service/impl/UserServiceImpl.java
View file @
d961690e
...
...
@@ -14,7 +14,7 @@ import com.zhiwei.brandkbs2.pojo.UserInfo;
import
com.zhiwei.brandkbs2.pojo.UserRole
;
import
com.zhiwei.brandkbs2.pojo.dto.UserDTO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.service.
I
UserService
;
import
com.zhiwei.brandkbs2.service.UserService
;
import
com.zhiwei.brandkbs2.util.MongoUtil
;
import
com.zhiwei.middleware.auth.pojo.CenterUser
;
import
org.apache.commons.collections4.CollectionUtils
;
...
...
@@ -36,7 +36,7 @@ import java.util.stream.Collectors;
* @date: 2022-04-28 17:34
*/
@Service
(
"userServiceImpl"
)
public
class
UserServiceImpl
implements
I
UserService
{
public
class
UserServiceImpl
implements
UserService
{
@Resource
(
name
=
"userDao"
)
private
IUserDao
userDao
;
...
...
src/main/java/com/zhiwei/brandkbs2/task/ControlCenter.java
View file @
d961690e
package
com
.
zhiwei
.
brandkbs2
.
task
;
import
com.zhiwei.brandkbs2.service.
I
TaskService
;
import
com.zhiwei.brandkbs2.service.TaskService
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.context.annotation.Profile
;
...
...
@@ -22,7 +22,7 @@ public class ControlCenter {
public
static
final
Logger
log
=
LogManager
.
getLogger
(
ControlCenter
.
class
);
@Resource
(
name
=
"taskServiceImpl"
)
private
I
TaskService
taskService
;
private
TaskService
taskService
;
@Async
(
"scheduledExecutor"
)
@Scheduled
(
cron
=
"0 0 1 * * ?"
)
...
...
src/main/java/com/zhiwei/brandkbs2/util/Tools.java
View file @
d961690e
...
...
@@ -20,6 +20,7 @@ import com.zhiwei.qbjc.bean.tools.BeanTools;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.MapUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.apache.commons.lang3.time.FastDateFormat
;
import
org.dozer.DozerBeanMapper
;
import
org.springframework.data.mapping.MappingException
;
...
...
@@ -39,6 +40,8 @@ import java.util.stream.Collectors;
import
java.util.stream.Stream
;
import
static
com
.
zhiwei
.
brandkbs2
.
common
.
GenericAttribute
.
ES_MARK_CACHE_MAPS
;
import
static
com
.
zhiwei
.
brandkbs2
.
config
.
Constant
.
DAY_PATTERN
;
import
static
com
.
zhiwei
.
brandkbs2
.
config
.
Constant
.
HOUR_PATTERN
;
import
static
java
.
util
.
Objects
.
nonNull
;
/**
...
...
@@ -516,4 +519,28 @@ public class Tools {
return
result
;
}
public
static
Long
[]
formatTimeRange
(
Long
startTime
,
Long
endTime
)
{
if
(
Objects
.
isNull
(
startTime
)
||
Objects
.
isNull
(
endTime
))
{
endTime
=
DateUtils
.
addDays
(
Tools
.
truncDate
(
new
Date
(),
DAY_PATTERN
),
1
).
getTime
();
startTime
=
DateUtils
.
addMonths
(
new
Date
(
endTime
),
-
1
).
getTime
();
}
else
{
startTime
=
Tools
.
truncDate
(
new
Date
(
startTime
),
HOUR_PATTERN
).
getTime
();
endTime
=
Tools
.
truncDate
(
new
Date
(
endTime
),
HOUR_PATTERN
).
getTime
();
}
return
new
Long
[]{
startTime
,
endTime
};
}
public
String
getEmotionByEsMarkMap
(
Map
<
String
,
Object
>
map
)
{
List
<
JSONObject
>
cacheMaps
=
(
List
<
JSONObject
>)
map
.
get
(
GenericAttribute
.
ES_MARK_CACHE_MAPS
);
if
(
null
==
cacheMaps
)
{
return
null
;
}
for
(
JSONObject
json
:
cacheMaps
)
{
if
(
Constant
.
EMOTION_LABEL_KEY
.
equals
(
json
.
getString
(
"group_name"
)))
{
return
json
.
getString
(
"name"
);
}
}
return
null
;
}
}
\ No newline at end of file
src/test/java/com/zhiwei/brandkbs2/TestRunWith.java
View file @
d961690e
package
com
.
zhiwei
.
brandkbs2
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.controller.AppArticleController
;
import
com.zhiwei.brandkbs2.dao.IChannelLabelDao
;
import
com.zhiwei.brandkbs2.dao.IEventDataDao
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.ChannelIndex
;
import
com.zhiwei.brandkbs2.service.ITaskService
;
import
com.zhiwei.brandkbs2.pojo.UserInfo
;
import
com.zhiwei.brandkbs2.service.TaskService
;
import
com.zhiwei.brandkbs2.util.TextUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.Test
;
...
...
@@ -18,7 +22,7 @@ import java.util.List;
/**
* @ClassName: TestRunWith
* @Description T
ODO
* @Description T
estRunWith
* @author: sjj
* @date: 2022-06-16 16:27
*/
...
...
@@ -28,7 +32,7 @@ import java.util.List;
public
class
TestRunWith
{
@Autowired
ITaskService
i
TaskService
;
TaskService
TaskService
;
@Autowired
IEventDataDao
eventDataDao
;
...
...
@@ -39,13 +43,20 @@ public class TestRunWith {
@Autowired
TextUtil
textUtil
;
@Autowired
AppArticleController
appArticleController
;
@Test
public
void
test1
(){
iTaskService
.
messageFlowCount
(
1
);
public
void
test1
()
{
UserInfo
userInfo
=
new
UserInfo
();
userInfo
.
setProjectId
(
"62beadd1bbf8eb20f96d2f2f"
);
UserThreadLocal
.
set
(
userInfo
);
ResponseResult
result
=
appArticleController
.
getMarkSpread
(
1657468800000L
,
1657555200000L
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
result
));
}
@Test
public
void
test2
(){
public
void
test2
()
{
ChannelIndex
channelIndex
=
new
ChannelIndex
();
channelIndex
.
setPlatform
(
"微信"
);
channelIndex
.
setRealSource
(
"微信公众号"
);
...
...
@@ -55,16 +66,16 @@ public class TestRunWith {
}
@Test
public
void
test3
(){
public
void
test3
()
{
channelLabelDao
.
getChannelLabelType
();
}
@Test
public
void
test4
(){
public
void
test4
()
{
List
<
String
>
list
=
new
ArrayList
<>();
list
.
add
(
"分析高频词耗时"
);
list
.
add
(
"分析高频词"
);
List
<
JSONObject
>
highWordsJson
=
TextUtil
.
getHighWordsJson
(
list
,
1
);
List
<
JSONObject
>
highWordsJson
=
TextUtil
.
getHighWordsJson
(
list
,
1
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
highWordsJson
));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment