记得上下班打卡 | 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
ed2a981e
Commit
ed2a981e
authored
Jun 22, 2026
by
姜秀龙
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'refs/remotes/origin/master' into test-ecs
parents
b046aebe
2fb244b4
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
590 additions
and
17 deletions
+590
-17
SweetConstant.java
...a/com/liquidnet/service/sweet/constant/SweetConstant.java
+1
-0
SweetManualPosition.java
...liquidnet/service/sweet/constant/SweetManualPosition.java
+99
-0
SweetManualExtConfigParam.java
...uidnet/service/sweet/param/SweetManualExtConfigParam.java
+27
-0
SweetManualMapGeojsonParam.java
...idnet/service/sweet/param/SweetManualMapGeojsonParam.java
+18
-0
ISweetManualExtConfigService.java
...t/service/sweet/service/ISweetManualExtConfigService.java
+17
-0
ISweetManualSortService.java
...uidnet/service/sweet/service/ISweetManualSortService.java
+8
-2
SweetManualSortOptionVo.java
...m/liquidnet/service/sweet/vo/SweetManualSortOptionVo.java
+22
-0
SweetManualSortVo.java
...ava/com/liquidnet/service/sweet/vo/SweetManualSortVo.java
+35
-0
SweetManualExtConfigDto.java
.../liquidnet/service/sweet/dto/SweetManualExtConfigDto.java
+27
-0
SweetManual.java
.../java/com/liquidnet/service/sweet/entity/SweetManual.java
+20
-0
db_20250608_manual_ext_config.sql
...dnet-service-sweet/docu/db_20250608_manual_ext_config.sql
+7
-0
db_20250609_manual_geojson_json.sql
...et-service-sweet/docu/db_20250609_manual_geojson_json.sql
+5
-0
SweetAppletController.java
...idnet/service/sweet/controller/SweetAppletController.java
+10
-0
SweetManualExtConfigController.java
...vice/sweet/controller/SweetManualExtConfigController.java
+52
-0
SweetManualSortController.java
...t/service/sweet/controller/SweetManualSortController.java
+18
-7
SweetManualExtConfigServiceImpl.java
...e/sweet/service/impl/SweetManualExtConfigServiceImpl.java
+142
-0
SweetManualSortServiceImpl.java
...ervice/sweet/service/impl/SweetManualSortServiceImpl.java
+39
-8
RedisDataUtils.java
...ava/com/liquidnet/service/sweet/utils/RedisDataUtils.java
+43
-0
No files found.
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/constant/SweetConstant.java
View file @
ed2a981e
...
...
@@ -9,6 +9,7 @@ public class SweetConstant {
public
final
static
String
REDIS_KEY_SWEET_MANUAL_NOTIFY_LIST
=
"sweet:manual:notify:manual:"
;
public
final
static
String
REDIS_KEY_SWEET_MANUAL_RICH_TEXT
=
"sweet:manual:richText:manual:"
;
public
final
static
String
REDIS_KEY_SWEET_MANUAL_SORT
=
"sweet:manual:sort:manual:"
;
public
final
static
String
REDIS_KEY_SWEET_MANUAL_EXT_CONFIG
=
"sweet:manual:extConfig:manual:"
;
public
final
static
String
REDIS_KEY_SWEET_ARTISTS_RELATION
=
"sweet:artists:relation:uid:"
;
public
final
static
String
REDIS_KEY_SWEET_ARTISTS_DETAILS
=
"sweet:artists:details:"
;
public
final
static
String
REDIS_KEY_SWEET_SHOP
=
"sweet:artists:shop:manual:"
;
...
...
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/constant/SweetManualPosition.java
0 → 100644
View file @
ed2a981e
package
com
.
liquidnet
.
service
.
sweet
.
constant
;
import
com.liquidnet.service.sweet.vo.SweetManualSortOptionVo
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* 草莓音乐节手册 Tab 显示模块
*/
public
enum
SweetManualPosition
{
ARTIST
(
"artist"
,
"艺人"
),
SIGNING_TIME
(
"signingTime"
,
"签售时间"
),
SITE_MAP
(
"siteMap"
,
"现场地图"
),
HOW_TO_REACH
(
"howToReach"
,
"交通出行"
),
OFFICIAL_SUPPORT
(
"officialSupport"
,
"官方支持"
),
AUDIENCE_NOTICE
(
"audienceNotice"
,
"观众须知"
),
PREVENTION_GUIDELINES
(
"preventionGuidelines"
,
"防疫指南"
),
NOTICE
(
"notice"
,
"通知公告"
),
STRATEGY
(
"strategy"
,
"观演攻略"
),
CUSTOMER_SERVICE
(
"customerService"
,
"客服"
),
FOOD_GUIDE
(
"foodGuide"
,
"餐饮攻略"
),
ALBUM
(
"album"
,
"相册"
),
LOST_FOUND
(
"lostFound"
,
"失物招领"
),
MAP_GEOJSON
(
"mapGeojson"
,
"互动地图"
);
private
final
String
key
;
private
final
String
label
;
SweetManualPosition
(
String
key
,
String
label
)
{
this
.
key
=
key
;
this
.
label
=
label
;
}
public
String
getKey
()
{
return
key
;
}
public
String
getLabel
()
{
return
label
;
}
public
static
boolean
isValid
(
String
key
)
{
if
(
key
==
null
)
{
return
false
;
}
for
(
SweetManualPosition
position
:
values
())
{
if
(
position
.
key
.
equals
(
key
))
{
return
true
;
}
}
return
false
;
}
public
static
String
getLabel
(
String
key
)
{
for
(
SweetManualPosition
position
:
values
())
{
if
(
position
.
key
.
equals
(
key
))
{
return
position
.
label
;
}
}
return
key
;
}
public
static
List
<
SweetManualSortOptionVo
>
allOptions
()
{
return
Arrays
.
stream
(
values
())
.
map
(
item
->
new
SweetManualSortOptionVo
(
item
.
key
,
item
.
label
))
.
collect
(
Collectors
.
toList
());
}
public
static
List
<
String
>
parsePositions
(
String
showPosition
)
{
if
(
showPosition
==
null
||
showPosition
.
trim
().
isEmpty
())
{
return
new
ArrayList
<>();
}
return
Arrays
.
stream
(
showPosition
.
split
(
","
))
.
map
(
String:
:
trim
)
.
filter
(
item
->
!
item
.
isEmpty
())
.
collect
(
Collectors
.
toList
());
}
public
static
String
normalizeContent
(
String
content
)
{
List
<
String
>
invalidKeys
=
new
ArrayList
<>();
List
<
String
>
positions
=
parsePositions
(
content
).
stream
()
.
filter
(
key
->
{
if
(
isValid
(
key
))
{
return
true
;
}
invalidKeys
.
add
(
key
);
return
false
;
})
.
collect
(
Collectors
.
toList
());
if
(!
invalidKeys
.
isEmpty
())
{
throw
new
IllegalArgumentException
(
"无效的模块标识: "
+
String
.
join
(
","
,
invalidKeys
));
}
return
String
.
join
(
","
,
positions
);
}
}
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/param/SweetManualExtConfigParam.java
0 → 100644
View file @
ed2a981e
package
com
.
liquidnet
.
service
.
sweet
.
param
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
@ApiModel
(
"草莓音乐节手册扩展配置参数"
)
public
class
SweetManualExtConfigParam
implements
Serializable
{
@ApiModelProperty
(
value
=
"电子手册id"
,
required
=
true
)
private
String
manualId
;
@ApiModelProperty
(
"餐饮攻略链接"
)
private
String
foodGuideUrl
;
@ApiModelProperty
(
"相册链接"
)
private
String
albumUrl
;
@ApiModelProperty
(
"失物招领问卷星ID"
)
private
String
lostFoundWjxId
;
@ApiModelProperty
(
"地图GeoJSON数据"
)
private
Object
mapGeojson
;
}
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/param/SweetManualMapGeojsonParam.java
0 → 100644
View file @
ed2a981e
package
com
.
liquidnet
.
service
.
sweet
.
param
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
@ApiModel
(
"手册地图GeoJSON保存参数"
)
public
class
SweetManualMapGeojsonParam
implements
Serializable
{
@ApiModelProperty
(
value
=
"电子手册id"
,
required
=
true
)
private
String
manualId
;
@ApiModelProperty
(
value
=
"地图GeoJSON数据"
,
required
=
true
)
private
Object
mapGeojson
;
}
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/service/ISweetManualExtConfigService.java
0 → 100644
View file @
ed2a981e
package
com
.
liquidnet
.
service
.
sweet
.
service
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.sweet.dto.SweetManualExtConfigDto
;
import
com.liquidnet.service.sweet.param.SweetManualExtConfigParam
;
import
com.liquidnet.service.sweet.param.SweetManualMapGeojsonParam
;
public
interface
ISweetManualExtConfigService
{
ResponseDto
<
SweetManualExtConfigDto
>
get
(
String
manualId
);
ResponseDto
<
Boolean
>
save
(
SweetManualExtConfigParam
param
);
ResponseDto
<
Object
>
getMapGeojson
(
String
manualId
);
ResponseDto
<
Boolean
>
saveMapGeojson
(
SweetManualMapGeojsonParam
param
);
}
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/service/ISweetManualSortService.java
View file @
ed2a981e
...
...
@@ -3,6 +3,10 @@ package com.liquidnet.service.sweet.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.sweet.entity.SweetManualSort
;
import
com.liquidnet.service.sweet.vo.SweetManualSortOptionVo
;
import
com.liquidnet.service.sweet.vo.SweetManualSortVo
;
import
java.util.List
;
/**
* <p>
...
...
@@ -14,8 +18,10 @@ import com.liquidnet.service.sweet.entity.SweetManualSort;
*/
public
interface
ISweetManualSortService
extends
IService
<
SweetManualSort
>
{
ResponseDto
<
SweetManualSort
>
get
(
String
manualId
);
ResponseDto
<
SweetManualSortVo
>
get
(
String
manualId
);
ResponseDto
<
Boolean
>
add
(
String
manualId
,
String
content
);
ResponseDto
<
Boolean
>
add
(
String
manualId
,
String
content
);
ResponseDto
<
List
<
SweetManualSortOptionVo
>>
options
(
);
}
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/vo/SweetManualSortOptionVo.java
0 → 100644
View file @
ed2a981e
package
com
.
liquidnet
.
service
.
sweet
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel
(
"手册显示模块选项"
)
public
class
SweetManualSortOptionVo
implements
Serializable
{
@ApiModelProperty
(
"模块标识"
)
private
String
key
;
@ApiModelProperty
(
"模块名称"
)
private
String
label
;
}
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/vo/SweetManualSortVo.java
0 → 100644
View file @
ed2a981e
package
com
.
liquidnet
.
service
.
sweet
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
java.util.List
;
@Data
@ApiModel
(
"手册显示模块配置"
)
public
class
SweetManualSortVo
implements
Serializable
{
@ApiModelProperty
(
"主键"
)
private
Long
mid
;
@ApiModelProperty
(
"电子手册id"
)
private
String
manualId
;
@ApiModelProperty
(
"已选模块,逗号分隔"
)
private
String
showPosition
;
@ApiModelProperty
(
"已选模块列表(按顺序)"
)
private
List
<
String
>
positions
;
@ApiModelProperty
(
"可选模块列表"
)
private
List
<
SweetManualSortOptionVo
>
options
;
@ApiModelProperty
(
"创建时间"
)
private
LocalDateTime
createdAt
;
@ApiModelProperty
(
"更新时间"
)
private
LocalDateTime
updatedAt
;
}
liquidnet-bus-do/liquidnet-service-sweet-do/src/main/java/com/liquidnet/service/sweet/dto/SweetManualExtConfigDto.java
0 → 100644
View file @
ed2a981e
package
com
.
liquidnet
.
service
.
sweet
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
@ApiModel
(
"草莓音乐节手册扩展配置"
)
public
class
SweetManualExtConfigDto
implements
Serializable
{
@ApiModelProperty
(
"电子手册id"
)
private
String
manualId
;
@ApiModelProperty
(
"餐饮攻略链接"
)
private
String
foodGuideUrl
;
@ApiModelProperty
(
"相册链接"
)
private
String
albumUrl
;
@ApiModelProperty
(
"失物招领问卷星ID"
)
private
String
lostFoundWjxId
;
@ApiModelProperty
(
"地图GeoJSON数据"
)
private
Object
mapGeojson
;
}
liquidnet-bus-do/liquidnet-service-sweet-do/src/main/java/com/liquidnet/service/sweet/entity/SweetManual.java
View file @
ed2a981e
...
...
@@ -50,6 +50,26 @@ public class SweetManual implements Serializable,Cloneable {
*/
private
Integer
isReleaseManual
;
/**
* 餐饮攻略链接
*/
private
String
foodGuideUrl
;
/**
* 相册链接
*/
private
String
albumUrl
;
/**
* 失物招领问卷星ID
*/
private
String
lostFoundWjxId
;
/**
* 地图GeoJSON数据
*/
private
String
mapGeojson
;
/**
* 创建时间
*/
...
...
liquidnet-bus-service/liquidnet-service-sweet/docu/db_20250608_manual_ext_config.sql
0 → 100644
View file @
ed2a981e
use
ln_scene
;
ALTER
TABLE
`sweet_manual`
ADD
COLUMN
`food_guide_url`
varchar
(
500
)
NOT
NULL
DEFAULT
''
COMMENT
'餐饮攻略链接'
AFTER
`is_release_manual`
,
ADD
COLUMN
`album_url`
varchar
(
500
)
NOT
NULL
DEFAULT
''
COMMENT
'相册链接'
AFTER
`food_guide_url`
,
ADD
COLUMN
`lost_found_wjx_id`
varchar
(
200
)
NOT
NULL
DEFAULT
''
COMMENT
'失物招领问卷星ID'
AFTER
`album_url`
,
ADD
COLUMN
`map_geojson`
longtext
NULL
COMMENT
'地图GeoJSON数据'
AFTER
`lost_found_wjx_id`
;
liquidnet-bus-service/liquidnet-service-sweet/docu/db_20250609_manual_geojson_json.sql
0 → 100644
View file @
ed2a981e
use
ln_scene
;
-- 地图GeoJSON由文件地址改为直接存储JSON数据
ALTER
TABLE
`sweet_manual`
CHANGE
COLUMN
`map_geojson_url`
`map_geojson`
longtext
NULL
COMMENT
'地图GeoJSON数据'
;
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/controller/SweetAppletController.java
View file @
ed2a981e
...
...
@@ -5,6 +5,7 @@ import com.liquidnet.service.base.ResponseDto;
import
com.liquidnet.service.sweet.dto.SweetManualAppletDto
;
import
com.liquidnet.service.sweet.dto.SweetManualArtistList2Dto
;
import
com.liquidnet.service.sweet.dto.SweetManualArtistListDto
;
import
com.liquidnet.service.sweet.dto.SweetManualExtConfigDto
;
import
com.liquidnet.service.sweet.dto.SweetPerformArtistTimeListDto
;
import
com.liquidnet.service.sweet.entity.SweetManualNotify
;
import
com.liquidnet.service.sweet.entity.SweetManualShop
;
...
...
@@ -228,6 +229,15 @@ public class SweetAppletController {
return
ResponseDto
.
success
(
redisDataUtils
.
getRichTextRedisData
(
manualId
,
type
));
}
@GetMapping
(
"manualExt"
)
@ApiOperation
(
"草莓音乐节手册扩展配置"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"manualId"
,
value
=
"电子手册id"
,
required
=
true
),
})
public
ResponseDto
<
SweetManualExtConfigDto
>
manualExt
(
@RequestParam
String
manualId
)
{
return
ResponseDto
.
success
(
redisDataUtils
.
getManualExtConfigRedisData
(
manualId
));
}
@PostMapping
(
"artistsWatch"
)
@ApiOperation
(
"艺人-想看"
)
@ApiImplicitParams
({
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/controller/SweetManualExtConfigController.java
0 → 100644
View file @
ed2a981e
package
com
.
liquidnet
.
service
.
sweet
.
controller
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.sweet.dto.SweetManualExtConfigDto
;
import
com.liquidnet.service.sweet.param.SweetManualExtConfigParam
;
import
com.liquidnet.service.sweet.param.SweetManualMapGeojsonParam
;
import
com.liquidnet.service.sweet.service.ISweetManualExtConfigService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
@Api
(
tags
=
"草莓音乐节手册扩展配置"
)
@RestController
@RequestMapping
(
"/sweet-manual-ext"
)
public
class
SweetManualExtConfigController
{
@Autowired
private
ISweetManualExtConfigService
sweetManualExtConfigService
;
@GetMapping
(
"get"
)
@ApiOperation
(
"获取手册扩展配置"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"manualId"
,
value
=
"电子手册id"
,
required
=
true
),
})
public
ResponseDto
<
SweetManualExtConfigDto
>
get
(
@RequestParam
String
manualId
)
{
return
sweetManualExtConfigService
.
get
(
manualId
);
}
@PostMapping
(
"save"
)
@ApiOperation
(
"保存手册扩展配置"
)
public
ResponseDto
<
Boolean
>
save
(
@RequestBody
SweetManualExtConfigParam
param
)
{
return
sweetManualExtConfigService
.
save
(
param
);
}
@GetMapping
(
"mapGeojson"
)
@ApiOperation
(
"获取地图GeoJSON数据"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"manualId"
,
value
=
"电子手册id"
,
required
=
true
),
})
public
ResponseDto
<
Object
>
getMapGeojson
(
@RequestParam
String
manualId
)
{
return
sweetManualExtConfigService
.
getMapGeojson
(
manualId
);
}
@PostMapping
(
"saveMapGeojson"
)
@ApiOperation
(
"保存地图GeoJSON数据"
)
public
ResponseDto
<
Boolean
>
saveMapGeojson
(
@RequestBody
SweetManualMapGeojsonParam
param
)
{
return
sweetManualExtConfigService
.
saveMapGeojson
(
param
);
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/controller/SweetManualSortController.java
View file @
ed2a981e
...
...
@@ -2,8 +2,9 @@ package com.liquidnet.service.sweet.controller;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.sweet.entity.SweetManualSort
;
import
com.liquidnet.service.sweet.service.ISweetManualSortService
;
import
com.liquidnet.service.sweet.vo.SweetManualSortOptionVo
;
import
com.liquidnet.service.sweet.vo.SweetManualSortVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
...
...
@@ -11,6 +12,8 @@ import io.swagger.annotations.ApiOperation;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* <p>
* 电子宣传手册显示内容表 前端控制器
...
...
@@ -29,22 +32,30 @@ public class SweetManualSortController {
@PostMapping
(
"add"
)
@ApiOperation
(
"
操作 电子手册tag
"
)
@ApiOperation
(
"
保存电子手册显示模块
"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"manualId"
,
value
=
"电子手册id"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"content"
,
value
=
"内容 例子(POSITION_1,POSITION_2)"
,
required
=
true
)
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"content"
,
value
=
"模块标识,逗号分隔。可选: artist,signingTime,siteMap,howToReach,officialSupport,audienceNotice,preventionGuidelines,notice,strategy,customerService,foodGuide,album,lostFound,mapGeojson"
,
required
=
true
)
})
public
ResponseDto
<
Boolean
>
changeStatus
(
@RequestParam
()
String
manualId
,
@RequestParam
()
String
content
)
{
public
ResponseDto
<
Boolean
>
save
(
@RequestParam
String
manualId
,
@RequestParam
String
content
)
{
return
sweetManualSortService
.
add
(
manualId
,
content
);
}
@GetMapping
(
"get"
)
@ApiOperation
(
"获取
电子手册tag
"
)
@ApiOperation
(
"获取
电子手册显示模块
"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"manualId"
,
value
=
"电子手册id"
,
required
=
true
)
})
public
ResponseDto
<
SweetManualSort
>
changeStatus
(
@RequestParam
()
String
manualId
)
{
public
ResponseDto
<
SweetManualSort
Vo
>
get
(
@RequestParam
String
manualId
)
{
return
sweetManualSortService
.
get
(
manualId
);
}
@GetMapping
(
"options"
)
@ApiOperation
(
"获取可选显示模块列表"
)
public
ResponseDto
<
List
<
SweetManualSortOptionVo
>>
options
()
{
return
sweetManualSortService
.
options
();
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/service/impl/SweetManualExtConfigServiceImpl.java
0 → 100644
View file @
ed2a981e
package
com
.
liquidnet
.
service
.
sweet
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.commons.lang.util.StringUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.sweet.dto.SweetManualExtConfigDto
;
import
com.liquidnet.service.sweet.entity.SweetManual
;
import
com.liquidnet.service.sweet.mapper.SweetManualMapper
;
import
com.liquidnet.service.sweet.param.SweetManualExtConfigParam
;
import
com.liquidnet.service.sweet.param.SweetManualMapGeojsonParam
;
import
com.liquidnet.service.sweet.service.ISweetManualExtConfigService
;
import
com.liquidnet.service.sweet.utils.RedisDataUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
@Service
public
class
SweetManualExtConfigServiceImpl
implements
ISweetManualExtConfigService
{
@Autowired
private
SweetManualMapper
sweetManualMapper
;
@Autowired
private
RedisDataUtils
redisDataUtils
;
@Override
public
ResponseDto
<
SweetManualExtConfigDto
>
get
(
String
manualId
)
{
SweetManual
manual
=
sweetManualMapper
.
selectOne
(
Wrappers
.
lambdaQuery
(
SweetManual
.
class
).
eq
(
SweetManual:
:
getManualId
,
manualId
));
if
(
manual
==
null
)
{
return
ResponseDto
.
failure
(
"手册不存在"
);
}
return
ResponseDto
.
success
(
toDto
(
manual
));
}
@Override
public
ResponseDto
<
Boolean
>
save
(
SweetManualExtConfigParam
param
)
{
if
(
StringUtil
.
isBlank
(
param
.
getManualId
()))
{
return
ResponseDto
.
failure
(
"手册id不能为空"
);
}
SweetManual
exist
=
sweetManualMapper
.
selectOne
(
Wrappers
.
lambdaQuery
(
SweetManual
.
class
).
eq
(
SweetManual:
:
getManualId
,
param
.
getManualId
()));
if
(
exist
==
null
)
{
return
ResponseDto
.
failure
(
"手册不存在"
);
}
SweetManual
update
=
SweetManual
.
getNew
();
update
.
setFoodGuideUrl
(
nullToEmpty
(
param
.
getFoodGuideUrl
()));
update
.
setAlbumUrl
(
nullToEmpty
(
param
.
getAlbumUrl
()));
update
.
setLostFoundWjxId
(
nullToEmpty
(
param
.
getLostFoundWjxId
()));
if
(
param
.
getMapGeojson
()
!=
null
)
{
update
.
setMapGeojson
(
serializeGeojson
(
param
.
getMapGeojson
()));
}
update
.
setUpdatedAt
(
LocalDateTime
.
now
());
sweetManualMapper
.
update
(
update
,
Wrappers
.
lambdaUpdate
(
SweetManual
.
class
)
.
eq
(
SweetManual:
:
getManualId
,
param
.
getManualId
()));
redisDataUtils
.
setManualExtConfigRedisData
(
param
.
getManualId
(),
toDto
(
exist
,
param
));
return
ResponseDto
.
success
(
true
);
}
@Override
public
ResponseDto
<
Object
>
getMapGeojson
(
String
manualId
)
{
SweetManual
manual
=
sweetManualMapper
.
selectOne
(
Wrappers
.
lambdaQuery
(
SweetManual
.
class
).
eq
(
SweetManual:
:
getManualId
,
manualId
));
if
(
manual
==
null
)
{
return
ResponseDto
.
failure
(
"手册不存在"
);
}
return
ResponseDto
.
success
(
parseGeojson
(
manual
.
getMapGeojson
()));
}
@Override
public
ResponseDto
<
Boolean
>
saveMapGeojson
(
SweetManualMapGeojsonParam
param
)
{
if
(
StringUtil
.
isBlank
(
param
.
getManualId
()))
{
return
ResponseDto
.
failure
(
"手册id不能为空"
);
}
if
(
param
.
getMapGeojson
()
==
null
)
{
return
ResponseDto
.
failure
(
"地图GeoJSON数据不能为空"
);
}
SweetManual
exist
=
sweetManualMapper
.
selectOne
(
Wrappers
.
lambdaQuery
(
SweetManual
.
class
).
eq
(
SweetManual:
:
getManualId
,
param
.
getManualId
()));
if
(
exist
==
null
)
{
return
ResponseDto
.
failure
(
"手册不存在"
);
}
String
geojson
=
serializeGeojson
(
param
.
getMapGeojson
());
SweetManual
update
=
SweetManual
.
getNew
();
update
.
setMapGeojson
(
geojson
);
update
.
setUpdatedAt
(
LocalDateTime
.
now
());
sweetManualMapper
.
update
(
update
,
Wrappers
.
lambdaUpdate
(
SweetManual
.
class
)
.
eq
(
SweetManual:
:
getManualId
,
param
.
getManualId
()));
SweetManualExtConfigDto
cacheDto
=
toDto
(
exist
);
cacheDto
.
setMapGeojson
(
parseGeojson
(
geojson
));
redisDataUtils
.
setManualExtConfigRedisData
(
param
.
getManualId
(),
cacheDto
);
return
ResponseDto
.
success
(
true
);
}
private
SweetManualExtConfigDto
toDto
(
SweetManual
manual
)
{
SweetManualExtConfigDto
dto
=
new
SweetManualExtConfigDto
();
dto
.
setManualId
(
manual
.
getManualId
());
dto
.
setFoodGuideUrl
(
manual
.
getFoodGuideUrl
());
dto
.
setAlbumUrl
(
manual
.
getAlbumUrl
());
dto
.
setLostFoundWjxId
(
manual
.
getLostFoundWjxId
());
dto
.
setMapGeojson
(
parseGeojson
(
manual
.
getMapGeojson
()));
return
dto
;
}
private
SweetManualExtConfigDto
toDto
(
SweetManual
exist
,
SweetManualExtConfigParam
param
)
{
SweetManualExtConfigDto
dto
=
new
SweetManualExtConfigDto
();
dto
.
setManualId
(
param
.
getManualId
());
dto
.
setFoodGuideUrl
(
nullToEmpty
(
param
.
getFoodGuideUrl
()));
dto
.
setAlbumUrl
(
nullToEmpty
(
param
.
getAlbumUrl
()));
dto
.
setLostFoundWjxId
(
nullToEmpty
(
param
.
getLostFoundWjxId
()));
if
(
param
.
getMapGeojson
()
!=
null
)
{
dto
.
setMapGeojson
(
param
.
getMapGeojson
());
}
else
{
dto
.
setMapGeojson
(
parseGeojson
(
exist
.
getMapGeojson
()));
}
return
dto
;
}
private
Object
parseGeojson
(
String
geojson
)
{
if
(
StringUtil
.
isBlank
(
geojson
))
{
return
null
;
}
return
JsonUtils
.
fromJson
(
geojson
,
Object
.
class
);
}
private
String
serializeGeojson
(
Object
geojson
)
{
if
(
geojson
==
null
)
{
return
null
;
}
if
(
geojson
instanceof
String
)
{
String
json
=
((
String
)
geojson
).
trim
();
return
json
.
isEmpty
()
?
null
:
json
;
}
return
JsonUtils
.
toJson
(
geojson
);
}
private
String
nullToEmpty
(
String
value
)
{
return
value
==
null
?
""
:
value
;
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/service/impl/SweetManualSortServiceImpl.java
View file @
ed2a981e
package
com
.
liquidnet
.
service
.
sweet
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.sweet.
entity.SweetManual
;
import
com.liquidnet.service.sweet.
constant.SweetManualPosition
;
import
com.liquidnet.service.sweet.entity.SweetManualSort
;
import
com.liquidnet.service.sweet.mapper.SweetManualSortMapper
;
import
com.liquidnet.service.sweet.service.ISweetManualSortService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.liquidnet.service.sweet.utils.RedisDataUtils
;
import
com.liquidnet.service.sweet.vo.SweetManualSortOptionVo
;
import
com.liquidnet.service.sweet.vo.SweetManualSortVo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.util.List
;
/**
* <p>
...
...
@@ -30,9 +33,11 @@ public class SweetManualSortServiceImpl extends ServiceImpl<SweetManualSortMappe
private
RedisDataUtils
redisDataUtils
;
@Override
public
ResponseDto
<
SweetManualSort
>
get
(
String
manualId
)
{
public
ResponseDto
<
SweetManualSort
Vo
>
get
(
String
manualId
)
{
try
{
return
ResponseDto
.
success
(
sweetManualSortMapper
.
selectOne
(
Wrappers
.
lambdaQuery
(
SweetManualSort
.
class
).
eq
(
SweetManualSort:
:
getManualId
,
manualId
)));
SweetManualSort
sort
=
sweetManualSortMapper
.
selectOne
(
Wrappers
.
lambdaQuery
(
SweetManualSort
.
class
).
eq
(
SweetManualSort:
:
getManualId
,
manualId
));
return
ResponseDto
.
success
(
toVo
(
sort
,
manualId
));
}
catch
(
Exception
e
)
{
return
ResponseDto
.
failure
();
}
...
...
@@ -41,24 +46,50 @@ public class SweetManualSortServiceImpl extends ServiceImpl<SweetManualSortMappe
@Override
public
ResponseDto
<
Boolean
>
add
(
String
manualId
,
String
content
)
{
try
{
int
count
=
sweetManualSortMapper
.
selectCount
(
Wrappers
.
lambdaUpdate
(
SweetManualSort
.
class
).
eq
(
SweetManualSort:
:
getManualId
,
manualId
));
String
normalizedContent
=
SweetManualPosition
.
normalizeContent
(
content
);
int
count
=
sweetManualSortMapper
.
selectCount
(
Wrappers
.
lambdaUpdate
(
SweetManualSort
.
class
).
eq
(
SweetManualSort:
:
getManualId
,
manualId
));
if
(
count
>
0
)
{
SweetManualSort
sweetManualSort
=
SweetManualSort
.
getNew
();
sweetManualSort
.
setManualId
(
manualId
);
sweetManualSort
.
setShowPosition
(
c
ontent
);
sweetManualSort
.
setShowPosition
(
normalizedC
ontent
);
sweetManualSort
.
setUpdatedAt
(
LocalDateTime
.
now
());
sweetManualSortMapper
.
update
(
sweetManualSort
,
Wrappers
.
lambdaUpdate
(
SweetManualSort
.
class
).
eq
(
SweetManualSort:
:
getManualId
,
manualId
));
sweetManualSortMapper
.
update
(
sweetManualSort
,
Wrappers
.
lambdaUpdate
(
SweetManualSort
.
class
).
eq
(
SweetManualSort:
:
getManualId
,
manualId
));
}
else
{
SweetManualSort
sweetManualSort
=
SweetManualSort
.
getNew
();
sweetManualSort
.
setManualId
(
manualId
);
sweetManualSort
.
setShowPosition
(
c
ontent
);
sweetManualSort
.
setShowPosition
(
normalizedC
ontent
);
sweetManualSort
.
setCreatedAt
(
LocalDateTime
.
now
());
sweetManualSortMapper
.
insert
(
sweetManualSort
);
}
redisDataUtils
.
deleteSortRedisData
(
manualId
);
}
catch
(
IllegalArgumentException
e
)
{
return
ResponseDto
.
failure
(
e
.
getMessage
());
}
catch
(
Exception
e
)
{
return
ResponseDto
.
failure
();
}
return
ResponseDto
.
success
();
}
@Override
public
ResponseDto
<
List
<
SweetManualSortOptionVo
>>
options
()
{
return
ResponseDto
.
success
(
SweetManualPosition
.
allOptions
());
}
private
SweetManualSortVo
toVo
(
SweetManualSort
sort
,
String
manualId
)
{
SweetManualSortVo
vo
=
new
SweetManualSortVo
();
vo
.
setManualId
(
manualId
);
vo
.
setOptions
(
SweetManualPosition
.
allOptions
());
if
(
sort
==
null
)
{
vo
.
setPositions
(
SweetManualPosition
.
parsePositions
(
null
));
return
vo
;
}
vo
.
setMid
(
sort
.
getMid
());
vo
.
setShowPosition
(
sort
.
getShowPosition
());
vo
.
setPositions
(
SweetManualPosition
.
parsePositions
(
sort
.
getShowPosition
()));
vo
.
setCreatedAt
(
sort
.
getCreatedAt
());
vo
.
setUpdatedAt
(
sort
.
getUpdatedAt
());
return
vo
;
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/utils/RedisDataUtils.java
View file @
ed2a981e
...
...
@@ -7,7 +7,9 @@ import com.liquidnet.common.cache.redis.util.RedisUtil;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.commons.lang.util.RandomUtil
;
import
com.liquidnet.commons.lang.util.StringUtil
;
import
com.liquidnet.service.base.SqlMapping
;
import
com.liquidnet.service.base.constant.MQConst
;
import
com.liquidnet.service.base.constant.RedisKeyExpireConst
;
...
...
@@ -179,6 +181,47 @@ public class RedisDataUtils {
}
}
public
SweetManualExtConfigDto
setManualExtConfigRedisData
(
String
manualId
,
SweetManualExtConfigDto
content
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_MANUAL_EXT_CONFIG
.
concat
(
manualId
);
SweetManualExtConfigDto
configDto
;
if
(
content
!=
null
)
{
configDto
=
content
;
}
else
{
SweetManual
manual
=
sweetManualMapper
.
selectOne
(
Wrappers
.
lambdaQuery
(
SweetManual
.
class
).
eq
(
SweetManual:
:
getManualId
,
manualId
));
configDto
=
new
SweetManualExtConfigDto
();
if
(
manual
!=
null
)
{
configDto
.
setManualId
(
manual
.
getManualId
());
configDto
.
setFoodGuideUrl
(
manual
.
getFoodGuideUrl
());
configDto
.
setAlbumUrl
(
manual
.
getAlbumUrl
());
configDto
.
setLostFoundWjxId
(
manual
.
getLostFoundWjxId
());
configDto
.
setMapGeojson
(
parseManualMapGeojson
(
manual
.
getMapGeojson
()));
}
}
redisUtil
.
set
(
redisKey
,
configDto
);
return
configDto
;
}
public
SweetManualExtConfigDto
getManualExtConfigRedisData
(
String
manualId
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_MANUAL_EXT_CONFIG
.
concat
(
manualId
);
Object
obj
=
redisUtil
.
get
(
redisKey
);
if
(
obj
==
null
)
{
return
setManualExtConfigRedisData
(
manualId
,
null
);
}
return
(
SweetManualExtConfigDto
)
obj
;
}
public
void
deleteManualExtConfigRedisData
(
String
manualId
)
{
redisUtil
.
del
(
SweetConstant
.
REDIS_KEY_SWEET_MANUAL_EXT_CONFIG
.
concat
(
manualId
));
}
private
Object
parseManualMapGeojson
(
String
geojson
)
{
if
(
StringUtil
.
isBlank
(
geojson
))
{
return
null
;
}
return
JsonUtils
.
fromJson
(
geojson
,
Object
.
class
);
}
public
List
<
String
>
setTagRedisData
(
String
manualId
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_MANUAL_SORT
.
concat
(
manualId
);
SweetManualSort
data
=
sweetManualSortMapper
.
selectOne
(
Wrappers
.
lambdaQuery
(
SweetManualSort
.
class
).
eq
(
SweetManualSort:
:
getManualId
,
manualId
));
...
...
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