记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
fb155961
Commit
fb155961
authored
Dec 28, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev_goblin' into dev_goblin
parents
9d71a883
1c21218e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
330 additions
and
151 deletions
+330
-151
GoblinRedisConst.java
...m/liquidnet/service/goblin/constant/GoblinRedisConst.java
+1
-0
GoblinFrontHotWordController.java
...troller/zhengzai/goblin/GoblinFrontHotWordController.java
+83
-0
IGoblinFrontHotWordService.java
...n/zhengzai/goblin/service/IGoblinFrontHotWordService.java
+17
-0
GoblinFrontBannerServiceImpl.java
...gzai/goblin/service/imp/GoblinFrontBannerServiceImpl.java
+8
-47
GoblinFrontHotWordServiceImpl.java
...zai/goblin/service/imp/GoblinFrontHotWordServiceImpl.java
+119
-0
GoblinFrontNavigationServiceImpl.java
.../goblin/service/imp/GoblinFrontNavigationServiceImpl.java
+8
-14
GoblinFrontHotWord.java
...m/liquidnet/service/goblin/entity/GoblinFrontHotWord.java
+78
-74
GoblinFrontHotWordMapper.java
...idnet/service/goblin/mapper/GoblinFrontHotWordMapper.java
+16
-16
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/constant/GoblinRedisConst.java
View file @
fb155961
...
@@ -5,6 +5,7 @@ public class GoblinRedisConst {
...
@@ -5,6 +5,7 @@ public class GoblinRedisConst {
/* ----------------------------------------------------------------- */
/* ----------------------------------------------------------------- */
public
static
final
String
FRONT_BANNER
=
"front_banner"
;
//前端banner
public
static
final
String
FRONT_BANNER
=
"front_banner"
;
//前端banner
public
static
final
String
FRONT_NAVIGATION
=
"front_navigation"
;
//前端banner
public
static
final
String
FRONT_NAVIGATION
=
"front_navigation"
;
//前端banner
public
static
final
String
FRONT_HOTWORD
=
"front_hot_word"
;
//前端banner
/* ----------------------------------------------------------------- */
/* ----------------------------------------------------------------- */
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/goblin/GoblinFrontHotWordController.java
0 → 100644
View file @
fb155961
package
com
.
liquidnet
.
client
.
admin
.
web
.
controller
.
zhengzai
.
goblin
;
import
com.alibaba.fastjson.JSON
;
import
com.liquidnet.client.admin.common.core.controller.BaseController
;
import
com.liquidnet.client.admin.common.core.domain.AjaxResult
;
import
com.liquidnet.client.admin.zhengzai.goblin.service.imp.GoblinFrontHotWordServiceImpl
;
import
com.liquidnet.service.goblin.entity.GoblinFrontHotWord
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
/**
* <p>
* 热词
前端控制器
* </p>
*
* @author liquidnet
* @since 2021-12-28
*/
@RestController
@RequestMapping
(
"/hotWord"
)
public
class
GoblinFrontHotWordController
extends
BaseController
{
@Autowired
GoblinFrontHotWordServiceImpl
goblinFrontHotWordService
;
/**
* @author zhangfuxin
* @Description:添加banner
* @date 2021/12/27 下午1:22
*/
@PostMapping
(
"create"
)
@ApiOperation
(
value
=
"增加热词"
)
@ResponseBody
public
AjaxResult
create
(
@RequestBody
GoblinFrontHotWord
goblinFrontHotWord
)
{
logger
.
info
(
"增加热词{}"
,
JSON
.
toJSONString
(
goblinFrontHotWord
));
boolean
result
=
goblinFrontHotWordService
.
create
(
goblinFrontHotWord
);
if
(
result
)
{
return
success
(
"操作成功"
);
}
else
{
return
error
(
"操作失败"
);
}
}
@PostMapping
(
"update"
)
@ApiOperation
(
value
=
"修改热词"
)
@ResponseBody
public
AjaxResult
update
(
@RequestBody
GoblinFrontHotWord
goblinFrontHotWord
)
{
logger
.
info
(
"修改热词{}"
,
JSON
.
toJSONString
(
goblinFrontHotWord
));
boolean
result
=
goblinFrontHotWordService
.
update
(
goblinFrontHotWord
);
if
(
result
)
{
return
success
(
"操作成功"
);
}
else
{
return
error
(
"操作失败"
);
}
}
@PostMapping
(
"delete"
)
@ApiOperation
(
value
=
"删除热词"
)
@ResponseBody
public
AjaxResult
delete
(
@RequestBody
GoblinFrontHotWord
goblinFrontHotWord
)
{
logger
.
info
(
"删除热词{}"
,
JSON
.
toJSONString
(
goblinFrontHotWord
));
boolean
result
=
goblinFrontHotWordService
.
delete
(
goblinFrontHotWord
.
getMid
());
if
(
result
)
{
return
success
(
"操作成功"
);
}
else
{
return
error
(
"操作失败"
);
}
}
@PostMapping
(
"getOne"
)
@ApiOperation
(
value
=
"查看详情"
)
@ResponseBody
public
AjaxResult
getOne
(
@RequestBody
GoblinFrontHotWord
goblinFrontHotWord
)
{
logger
.
info
(
"查看详情{}"
,
JSON
.
toJSONString
(
goblinFrontHotWord
));
goblinFrontHotWord
=
goblinFrontHotWordService
.
getOne
(
goblinFrontHotWord
.
getMid
());
return
AjaxResult
.
success
(
goblinFrontHotWord
);
}
@PostMapping
(
"page"
)
@ApiOperation
(
value
=
"分页"
)
@ResponseBody
public
AjaxResult
page
(
@RequestParam
(
name
=
"pageSize"
,
required
=
true
)
int
pageSize
,
@RequestParam
(
name
=
"pageNumber"
,
required
=
true
)
int
pageNumber
,
@RequestBody
GoblinFrontHotWord
goblinFrontHotWord
)
{
logger
.
info
(
"分页banner{}"
,
JSON
.
toJSONString
(
goblinFrontHotWord
));
return
AjaxResult
.
success
(
goblinFrontHotWordService
.
page
(
pageSize
,
pageNumber
,
null
));
}
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/goblin/service/IGoblinFrontHotWordService.java
0 → 100644
View file @
fb155961
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
goblin
.
service
;
import
com.liquidnet.service.goblin.entity.GoblinFrontHotWord
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* <p>
* 热词
服务类
* </p>
*
* @author liquidnet
* @since 2021-12-28
*/
public
interface
IGoblinFrontHotWordService
extends
IService
<
GoblinFrontHotWord
>
{
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/goblin/service/imp/GoblinFrontBannerServiceImpl.java
View file @
fb155961
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
goblin
.
service
.
imp
;
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
goblin
.
service
.
imp
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinFrontBannerService
;
import
com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinFrontBannerService
;
import
com.liquidnet.client.admin.zhengzai.kylin.utils.DataUtils
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.liquidnet.common.cache.redis.util.RedisDataSourceUtil
;
import
com.liquidnet.common.cache.redis.util.RedisDataSourceUtil
;
import
com.liquidnet.common.cache.redis.util.RedisGoblinUtil
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.entity.GoblinFrontBanner
;
import
com.liquidnet.service.goblin.entity.GoblinFrontBanner
;
import
com.liquidnet.service.goblin.entity.GoblinFrontNavigation
;
import
com.liquidnet.service.goblin.mapper.GoblinFrontBannerMapper
;
import
com.liquidnet.service.goblin.mapper.GoblinFrontBannerMapper
;
import
com.liquidnet.service.kylin.dao.BannerDetailsListDao
;
import
com.liquidnet.service.kylin.dto.param.BannersSearchParam
;
import
com.liquidnet.service.kylin.dto.vo.mongo.KylinOrderTicketVo
;
import
com.mongodb.BasicDBObject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.aggregation.VariableOperators
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.mongodb.core.query.Update
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.
util.ArrayList
;
import
java.
time.LocalDateTime
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
/**
* <p>
* <p>
...
@@ -52,18 +36,19 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
...
@@ -52,18 +36,19 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
private
RedisDataSourceUtil
redisDataSourceUtil
;
private
RedisDataSourceUtil
redisDataSourceUtil
;
public
boolean
create
(
GoblinFrontBanner
goblinFrontBanner
){
public
boolean
create
(
GoblinFrontBanner
goblinFrontBanner
){
goblinFrontBanner
.
setCreateTime
(
LocalDateTime
.
now
());
//设置bannerid
//设置bannerid
goblinFrontBanner
.
setBannerId
(
GoblinRedisConst
.
FRONT_BANNER
+
IDGenerator
.
nextTimeId
());
goblinFrontBanner
.
setBannerId
(
GoblinRedisConst
.
FRONT_BANNER
+
IDGenerator
.
nextTimeId
());
//增加 banner
//增加 banner
goblinFrontBannerMapper
.
insert
(
goblinFrontBanner
);
goblinFrontBannerMapper
.
insert
(
goblinFrontBanner
);
//mongo db增加
/*
//mongo db增加
mongoTemplate.save(goblinFrontBanner,GoblinFrontBanner.class.getSimpleName());
mongoTemplate.save(goblinFrontBanner,GoblinFrontBanner.class.getSimpleName());
//redis 增加
//redis 增加
LambdaQueryWrapper<GoblinFrontBanner> queryWrapper = Wrappers.lambdaQuery(GoblinFrontBanner.class);
LambdaQueryWrapper<GoblinFrontBanner> queryWrapper = Wrappers.lambdaQuery(GoblinFrontBanner.class);
queryWrapper.ne(GoblinFrontBanner::getDelTag,1);
queryWrapper.ne(GoblinFrontBanner::getDelTag,1);
queryWrapper.orderByDesc(GoblinFrontBanner::getIndexs);
queryWrapper.orderByDesc(GoblinFrontBanner::getIndexs);
List<GoblinFrontBanner> list=goblinFrontBannerMapper.selectList(queryWrapper);
List<GoblinFrontBanner> list=goblinFrontBannerMapper.selectList(queryWrapper);
redisDataSourceUtil
.
getRedisGoblinUtil
().
set
(
GoblinRedisConst
.
FRONT_BANNER
,
list
);
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_BANNER,list);
*/
return
true
;
return
true
;
}
}
/***
/***
...
@@ -72,9 +57,10 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
...
@@ -72,9 +57,10 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
* @date 2021/12/27 下午4:03
* @date 2021/12/27 下午4:03
*/
*/
public
boolean
update
(
GoblinFrontBanner
goblinFrontBanner
){
public
boolean
update
(
GoblinFrontBanner
goblinFrontBanner
){
goblinFrontBanner
.
setUpdateTime
(
LocalDateTime
.
now
());
//数据库修改
//数据库修改
goblinFrontBannerMapper
.
updateById
(
goblinFrontBanner
);
goblinFrontBannerMapper
.
updateById
(
goblinFrontBanner
);
//mongodb修改
/*
//mongodb修改
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontBanner)));
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontBanner)));
mongoTemplate.getCollection(GoblinFrontBanner.class.getSimpleName()).updateOne(
mongoTemplate.getCollection(GoblinFrontBanner.class.getSimpleName()).updateOne(
Query.query(Criteria.where("bannerId").is(goblinFrontBanner.getBannerId())).getQueryObject(),
Query.query(Criteria.where("bannerId").is(goblinFrontBanner.getBannerId())).getQueryObject(),
...
@@ -86,17 +72,7 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
...
@@ -86,17 +72,7 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
queryWrapper.ne(GoblinFrontBanner::getDelTag,1);
queryWrapper.ne(GoblinFrontBanner::getDelTag,1);
queryWrapper.orderByDesc(GoblinFrontBanner::getIndexs);
queryWrapper.orderByDesc(GoblinFrontBanner::getIndexs);
List<GoblinFrontBanner> list=goblinFrontBannerMapper.selectList(queryWrapper);
List<GoblinFrontBanner> list=goblinFrontBannerMapper.selectList(queryWrapper);
redisDataSourceUtil
.
getRedisGoblinUtil
().
set
(
GoblinRedisConst
.
FRONT_BANNER
,
list
);
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_BANNER,list);*/
/* if(redisDataSourceUtil.getRedisGoblinUtil().hasKey(GoblinRedisConst.FRONT_BANNER+"0")){
ArrayList<GoblinFrontBanner> list = (ArrayList<GoblinFrontBanner>) redisDataSourceUtil.getRedisGoblinUtil().get(GoblinRedisConst.FRONT_BANNER+0);
list= (ArrayList<GoblinFrontBanner>) list.stream().map(goblinFrontBanner1->{
if(goblinFrontBanner1.getBannerId().equals(goblinFrontBanner.getBannerId())){
return goblinFrontBanner;
}
return goblinFrontBanner1;
}).collect(Collectors.toList());
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_BANNER+"0",list);
}*/
return
true
;
return
true
;
}
}
/**
/**
...
@@ -116,21 +92,6 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
...
@@ -116,21 +92,6 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
GoblinFrontBanner
goblinFrontBanner
=
goblinFrontBannerMapper
.
selectById
(
id
);
GoblinFrontBanner
goblinFrontBanner
=
goblinFrontBannerMapper
.
selectById
(
id
);
goblinFrontBanner
.
setDelTag
(
1
);
goblinFrontBanner
.
setDelTag
(
1
);
this
.
update
(
goblinFrontBanner
);
this
.
update
(
goblinFrontBanner
);
/* //数据库
goblinFrontBannerMapper.deleteById(id);
//mongodb 删除
mongoTemplate.remove(Query.query(Criteria.where("mid").is(id)), GoblinFrontBanner.class, GoblinFrontBanner.class.getSimpleName());
//redis 删除
if(redisDataSourceUtil.getRedisGoblinUtil().hasKey(GoblinRedisConst.FRONT_BANNER+"0")){
ArrayList<GoblinFrontBanner> list = (ArrayList<GoblinFrontBanner>) redisDataSourceUtil.getRedisGoblinUtil().get(GoblinRedisConst.FRONT_BANNER+0);
list= (ArrayList<GoblinFrontBanner>) list.stream().map(goblinFrontBanner1->{
if(goblinFrontBanner1.getMid().equals(id)){
return null;
}
return goblinFrontBanner1;
}).collect(Collectors.toList());
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_BANNER+"0",list);
}*/
return
true
;
return
true
;
}
}
/**
/**
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/goblin/service/imp/GoblinFrontHotWordServiceImpl.java
0 → 100644
View file @
fb155961
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
goblin
.
service
.
imp
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinFrontHotWordService
;
import
com.liquidnet.common.cache.redis.util.RedisDataSourceUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.entity.GoblinFrontHotWord
;
import
com.liquidnet.service.goblin.mapper.GoblinFrontHotWordMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.util.List
;
/**
* <p>
* 热词
服务实现类
* </p>
*
* @author liquidnet
* @since 2021-12-28
*/
@Service
public
class
GoblinFrontHotWordServiceImpl
extends
ServiceImpl
<
GoblinFrontHotWordMapper
,
GoblinFrontHotWord
>
implements
IGoblinFrontHotWordService
{
@Autowired
private
MongoTemplate
mongoTemplate
;
@Autowired
GoblinFrontHotWordMapper
goblinFrontHotWordMapper
;
@Autowired
private
RedisDataSourceUtil
redisDataSourceUtil
;
public
boolean
create
(
GoblinFrontHotWord
goblinFrontHotWord
){
goblinFrontHotWord
.
setCreateTime
(
LocalDateTime
.
now
());
//设置bannerid
goblinFrontHotWord
.
setHotWordId
(
GoblinRedisConst
.
FRONT_HOTWORD
+
IDGenerator
.
nextTimeId
());
//增加 banner
goblinFrontHotWordMapper
.
insert
(
goblinFrontHotWord
);
/* //mongo db增加
mongoTemplate.save(GoblinFrontHotWord,GoblinFrontHotWord.class.getSimpleName());
//redis 增加
LambdaQueryWrapper<GoblinFrontHotWord> queryWrapper = Wrappers.lambdaQuery(GoblinFrontHotWord.class);
queryWrapper.ne(GoblinFrontHotWord::getDelTag,1);
queryWrapper.orderByDesc(GoblinFrontHotWord::getIndexs);
List<GoblinFrontHotWord> list=goblinFrontBannerMapper.selectList(queryWrapper);
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_HOTWORD,list);*/
return
true
;
}
/***
* @author zhangfuxin
* @Description: 修改
* @date 2021/12/27 下午4:03
*/
public
boolean
update
(
GoblinFrontHotWord
goblinFrontHotWord
){
goblinFrontHotWord
.
setUpdateTime
(
LocalDateTime
.
now
());
//数据库修改
goblinFrontHotWordMapper
.
updateById
(
goblinFrontHotWord
);
/*//mongodb修改
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontHotWord)));
mongoTemplate.getCollection(GoblinFrontHotWord.class.getSimpleName()).updateOne(
Query.query(Criteria.where("hotWordId").is(goblinFrontHotWord.getHotWordId())).getQueryObject(),
orderObject
);
//redis 修改
//从数据库中查出来,从新塞进去
LambdaQueryWrapper<GoblinFrontHotWord> queryWrapper = Wrappers.lambdaQuery(GoblinFrontHotWord.class);
queryWrapper.ne(GoblinFrontHotWord::getDelTag,1);
queryWrapper.orderByDesc(GoblinFrontHotWord::getIndexs);
List<GoblinFrontHotWord> list=goblinFrontHotWordMapper.selectList(queryWrapper);
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_HOTWORD,list);*/
return
true
;
}
/**
* @author zhangfuxin
* @Description:查看详情
* @date 2021/12/27 下午4:34
*/
public
GoblinFrontHotWord
getOne
(
Long
id
){
return
goblinFrontHotWordMapper
.
selectById
(
id
);
}
/**
* @author zhangfuxin
* @Description: 删除 banner
* @date 2021/12/27 下午4:36
*/
public
boolean
delete
(
Long
id
){
GoblinFrontHotWord
goblinFrontHotWord
=
goblinFrontHotWordMapper
.
selectById
(
id
);
goblinFrontHotWord
.
setDelTag
(
1
);
this
.
update
(
goblinFrontHotWord
);
return
true
;
}
/**
* @author zhangfuxin
* @Description:分页
* @date 2021/12/27 下午5:19
*/
public
PageInfo
<
GoblinFrontHotWord
>
page
(
int
pageSize
,
int
pageNumber
,
GoblinFrontHotWord
goblinFrontHotWord
)
{
PageInfo
<
GoblinFrontHotWord
>
pageInfoTmp
=
null
;
try
{
PageHelper
.
startPage
(
pageNumber
,
pageSize
);
LambdaQueryWrapper
<
GoblinFrontHotWord
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
GoblinFrontHotWord
.
class
);
queryWrapper
.
ne
(
GoblinFrontHotWord:
:
getDelTag
,
1
);
queryWrapper
.
orderByDesc
(
GoblinFrontHotWord:
:
getCreateTime
);
List
<
GoblinFrontHotWord
>
list
=
goblinFrontHotWordMapper
.
selectList
(
queryWrapper
);
pageInfoTmp
=
new
PageInfo
(
list
);
}
catch
(
Exception
e
)
{
return
new
PageInfo
();
}
return
pageInfoTmp
;
}
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/goblin/service/imp/GoblinFrontNavigationServiceImpl.java
View file @
fb155961
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
goblin
.
service
.
imp
;
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
goblin
.
service
.
imp
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinFrontNavigationService
;
import
com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinFrontNavigationService
;
import
com.liquidnet.common.cache.redis.util.RedisDataSourceUtil
;
import
com.liquidnet.common.cache.redis.util.RedisDataSourceUtil
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.entity.GoblinFrontBanner
;
import
com.liquidnet.service.goblin.entity.GoblinFrontNavigation
;
import
com.liquidnet.service.goblin.entity.GoblinFrontNavigation
;
import
com.liquidnet.service.goblin.mapper.GoblinFrontBannerMapper
;
import
com.liquidnet.service.goblin.mapper.GoblinFrontNavigationMapper
;
import
com.liquidnet.service.goblin.mapper.GoblinFrontNavigationMapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.mongodb.BasicDBObject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.
util.ArrayList
;
import
java.
time.LocalDateTime
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -45,24 +37,26 @@ public class GoblinFrontNavigationServiceImpl extends ServiceImpl<GoblinFrontNav
...
@@ -45,24 +37,26 @@ public class GoblinFrontNavigationServiceImpl extends ServiceImpl<GoblinFrontNav
private
RedisDataSourceUtil
redisDataSourceUtil
;
private
RedisDataSourceUtil
redisDataSourceUtil
;
public
boolean
create
(
GoblinFrontNavigation
goblinFrontNavigation
){
public
boolean
create
(
GoblinFrontNavigation
goblinFrontNavigation
){
goblinFrontNavigation
.
setCreateTime
(
LocalDateTime
.
now
());
//设置金刚位id
//设置金刚位id
goblinFrontNavigation
.
setNavigationId
(
GoblinRedisConst
.
FRONT_NAVIGATION
+
IDGenerator
.
nextTimeId
());
goblinFrontNavigation
.
setNavigationId
(
GoblinRedisConst
.
FRONT_NAVIGATION
+
IDGenerator
.
nextTimeId
());
//mysql插入
//mysql插入
goblinFrontNavigationMapper
.
insert
(
goblinFrontNavigation
);
goblinFrontNavigationMapper
.
insert
(
goblinFrontNavigation
);
//mongo db增加
/*
//mongo db增加
mongoTemplate.save(goblinFrontNavigation,GoblinFrontNavigation.class.getSimpleName());
mongoTemplate.save(goblinFrontNavigation,GoblinFrontNavigation.class.getSimpleName());
//redis增加
//redis增加
LambdaQueryWrapper<GoblinFrontNavigation> queryWrapper = Wrappers.lambdaQuery(GoblinFrontNavigation.class);
LambdaQueryWrapper<GoblinFrontNavigation> queryWrapper = Wrappers.lambdaQuery(GoblinFrontNavigation.class);
queryWrapper.ne(GoblinFrontNavigation::getDelTag,1);
queryWrapper.ne(GoblinFrontNavigation::getDelTag,1);
queryWrapper.orderByDesc(GoblinFrontNavigation::getIndexs);
queryWrapper.orderByDesc(GoblinFrontNavigation::getIndexs);
List<GoblinFrontNavigation> list=goblinFrontNavigationMapper.selectList(queryWrapper);
List<GoblinFrontNavigation> list=goblinFrontNavigationMapper.selectList(queryWrapper);
redisDataSourceUtil
.
getRedisGoblinUtil
().
set
(
GoblinRedisConst
.
FRONT_NAVIGATION
,
list
);
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_NAVIGATION,list);
*/
return
true
;
return
true
;
}
}
public
boolean
update
(
GoblinFrontNavigation
goblinFrontNavigation
){
public
boolean
update
(
GoblinFrontNavigation
goblinFrontNavigation
){
goblinFrontNavigation
.
setUpdateTime
(
LocalDateTime
.
now
());
//数据库修改
//数据库修改
goblinFrontNavigationMapper
.
updateById
(
goblinFrontNavigation
);
goblinFrontNavigationMapper
.
updateById
(
goblinFrontNavigation
);
//mongodb修改
/
*/
/mongodb修改
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontNavigation)));
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontNavigation)));
mongoTemplate.getCollection(GoblinFrontNavigation.class.getSimpleName()).updateOne(
mongoTemplate.getCollection(GoblinFrontNavigation.class.getSimpleName()).updateOne(
Query.query(Criteria.where("navigationId").is(goblinFrontNavigation.getNavigationId())).getQueryObject(),
Query.query(Criteria.where("navigationId").is(goblinFrontNavigation.getNavigationId())).getQueryObject(),
...
@@ -74,7 +68,7 @@ public class GoblinFrontNavigationServiceImpl extends ServiceImpl<GoblinFrontNav
...
@@ -74,7 +68,7 @@ public class GoblinFrontNavigationServiceImpl extends ServiceImpl<GoblinFrontNav
queryWrapper.ne(GoblinFrontNavigation::getDelTag,1);
queryWrapper.ne(GoblinFrontNavigation::getDelTag,1);
queryWrapper.orderByDesc(GoblinFrontNavigation::getIndexs);
queryWrapper.orderByDesc(GoblinFrontNavigation::getIndexs);
List<GoblinFrontNavigation> list=goblinFrontNavigationMapper.selectList(queryWrapper);
List<GoblinFrontNavigation> list=goblinFrontNavigationMapper.selectList(queryWrapper);
redisDataSourceUtil
.
getRedisGoblinUtil
().
set
(
GoblinRedisConst
.
FRONT_NAVIGATION
,
list
);
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_NAVIGATION,list);
*/
return
true
;
return
true
;
}
}
public
GoblinFrontNavigation
getOne
(
Long
id
){
public
GoblinFrontNavigation
getOne
(
Long
id
){
...
...
liquidnet-bus-do/liquidnet-service-goblin-do/src/main/java/com/liquidnet/service/goblin/entity/GoblinFrontHotWord.java
View file @
fb155961
package
com
.
liquidnet
.
service
.
goblin
.
entity
;
package
com
.
liquidnet
.
service
.
goblin
.
entity
;
import
java.time.LocalDateTime
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
java.io.Serializable
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
/**
import
java.io.Serializable
;
* <p>
import
java.time.LocalDateTime
;
* 热词
/**
* </p>
* <p>
*
* 热词
* @author liquidnet
* @since 2021-12-27
* </p>
*/
*
@Data
* @author liquidnet
@EqualsAndHashCode
(
callSuper
=
false
)
* @since 2021-12-28
public
class
GoblinFrontHotWord
implements
Serializable
{
*/
@Data
private
static
final
long
serialVersionUID
=
1L
;
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
GoblinFrontHotWord
implements
Serializable
{
/**
* 主键
private
static
final
long
serialVersionUID
=
1L
;
*/
private
Long
mid
;
/**
* 主键
/**
*/
* 热词
@TableId
(
value
=
"mid"
,
type
=
IdType
.
AUTO
)
*/
private
Long
mid
;
private
String
word
;
/**
/**
* 热词
* 1开启2未开启
*/
*/
private
String
word
;
private
Integer
status
;
/**
/**
* 1开启2未开启
* 排序
*/
*/
private
Integer
status
;
private
Integer
indexs
;
/**
/**
* 排序
* 1、滚动2、按时切换
*/
*/
private
Integer
indexs
;
private
Integer
changeType
;
/**
/**
* 1、滚动2、按时切换
* 切换时间单位为s
*/
*/
private
Integer
changeType
;
private
Integer
changeTime
;
/**
/**
* 切换时间单位为s
* 创建时间
*/
*/
private
Integer
changeTime
;
private
LocalDateTime
createTime
;
/**
/**
* 创建时间
* 修改时间
*/
*/
private
LocalDateTime
createTime
;
private
LocalDateTime
updateTime
;
/**
/**
* 修改时间
* 热词id
*/
*/
private
LocalDateTime
updateTime
;
private
String
hotWordId
;
/**
/**
* 热词id
* 0未删除1已删除
*/
*/
private
String
hotWordId
;
private
Integer
delTag
;
/**
* 0未删除1已删除
}
*/
private
Integer
delTag
;
}
liquidnet-bus-do/liquidnet-service-goblin-do/src/main/java/com/liquidnet/service/goblin/mapper/GoblinFrontHotWordMapper.java
View file @
fb155961
package
com
.
liquidnet
.
service
.
goblin
.
mapper
;
package
com
.
liquidnet
.
service
.
goblin
.
mapper
;
import
com.liquidnet.service.goblin.entity.GoblinFrontHotWord
;
import
com.liquidnet.service.goblin.entity.GoblinFrontHotWord
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
/**
* <p>
* <p>
* 热词
* 热词
Mapper 接口
Mapper 接口
* </p>
* </p>
*
*
* @author liquidnet
* @author liquidnet
* @since 2021-12-2
7
* @since 2021-12-2
8
*/
*/
public
interface
GoblinFrontHotWordMapper
extends
BaseMapper
<
GoblinFrontHotWord
>
{
public
interface
GoblinFrontHotWordMapper
extends
BaseMapper
<
GoblinFrontHotWord
>
{
}
}
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