Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
0ff1459d
Commit
0ff1459d
authored
Aug 11, 2023
by
muhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 小程序藏品
parent
2fb3688d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
10 deletions
+47
-10
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/FavoritesServiceImpl.java
...c/main/java/com/wwdz/ch/wx/impl/FavoritesServiceImpl.java
+4
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
...pi/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
+2
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/interceptor/LoginInterceptor.java
...ain/java/com/wwdz/ch/wx/interceptor/LoginInterceptor.java
+4
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/WxFootprintController.java
...c/main/java/com/wwdz/ch/wx/web/WxFootprintController.java
+37
-10
No files found.
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/FavoritesServiceImpl.java
View file @
0ff1459d
...
@@ -305,6 +305,10 @@ public class FavoritesServiceImpl implements FavoritesService {
...
@@ -305,6 +305,10 @@ public class FavoritesServiceImpl implements FavoritesService {
@Override
@Override
public
Result
addItem
(
ItemRequestDto
dto
)
{
public
Result
addItem
(
ItemRequestDto
dto
)
{
try
{
try
{
if
(
favoritesItemsRelationDao
.
isCollected
(
dto
.
getUserId
(),
dto
.
getId
()))
{
Result
.
failed
(
"您已经收藏过该藏品"
);
}
Favorites
favorites
=
favoritesDao
.
info
(
dto
.
getFavoritesId
());
Favorites
favorites
=
favoritesDao
.
info
(
dto
.
getFavoritesId
());
if
(
Objects
.
isNull
(
favorites
))
{
if
(
Objects
.
isNull
(
favorites
))
{
Result
.
failed
(
"数据异常,收藏册不存在"
);
Result
.
failed
(
"数据异常,收藏册不存在"
);
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
View file @
0ff1459d
...
@@ -72,6 +72,8 @@ public class ItemServiceImpl implements ItemService {
...
@@ -72,6 +72,8 @@ public class ItemServiceImpl implements ItemService {
count
--;
count
--;
}
}
vo
.
setCollectCount
(
count
);
vo
.
setCollectCount
(
count
);
vo
.
setSourceType
(
item
.
getSourceType
());
vo
.
setIsMine
(
0
);
AgentTranceResponseVo
agentTranceResponseVo
=
new
AgentTranceResponseVo
();
AgentTranceResponseVo
agentTranceResponseVo
=
new
AgentTranceResponseVo
();
agentTranceResponseVo
.
setAgentTraceInfo_
(
""
);
agentTranceResponseVo
.
setAgentTraceInfo_
(
""
);
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/interceptor/LoginInterceptor.java
View file @
0ff1459d
...
@@ -29,7 +29,11 @@ public class LoginInterceptor implements HandlerInterceptor {
...
@@ -29,7 +29,11 @@ public class LoginInterceptor implements HandlerInterceptor {
@Override
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
logger
.
info
(
"-------------进入拦截器"
);
logger
.
info
(
"-------------进入拦截器"
);
logger
.
info
(
"请求头名称:"
+
JSON
.
toJSONString
(
request
.
getHeaderNames
()));
String
token
=
request
.
getHeader
(
"kl_token"
);
String
token
=
request
.
getHeader
(
"kl_token"
);
if
(
StringUtils
.
isBlank
(
token
))
{
token
=
request
.
getHeader
(
"kltoken"
);
}
logger
.
info
(
"token的值是:"
+
token
);
logger
.
info
(
"token的值是:"
+
token
);
if
(
StringUtils
.
isBlank
(
token
))
{
if
(
StringUtils
.
isBlank
(
token
))
{
return
true
;
return
true
;
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/WxFootprintController.java
View file @
0ff1459d
...
@@ -11,8 +11,10 @@ import com.wwdz.ch.db.domain.Footprint;
...
@@ -11,8 +11,10 @@ import com.wwdz.ch.db.domain.Footprint;
import
com.wwdz.ch.db.domain.Item
;
import
com.wwdz.ch.db.domain.Item
;
import
com.wwdz.ch.wx.annotation.LoginUser
;
import
com.wwdz.ch.wx.annotation.LoginUser
;
import
com.wwdz.ch.wx.entity.request.FootPrintRequestDto
;
import
com.wwdz.ch.wx.entity.request.FootPrintRequestDto
;
import
com.wwdz.ch.wx.entity.request.KlDataRequestDto
;
import
com.wwdz.ch.wx.service.FootPrintService
;
import
com.wwdz.ch.wx.service.FootPrintService
;
import
org.apache.commons.collections.CollectionUtils
;
import
com.xxdxxs.utils.JsonUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -20,6 +22,7 @@ import org.springframework.validation.annotation.Validated;
...
@@ -20,6 +22,7 @@ import org.springframework.validation.annotation.Validated;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
/**
* 用户访问足迹服务
* 用户访问足迹服务
...
@@ -126,28 +129,52 @@ public class WxFootprintController {
...
@@ -126,28 +129,52 @@ public class WxFootprintController {
}
}
@PostMapping
(
"/page"
)
@PostMapping
(
"/page"
)
public
Result
page
(
@RequestBody
FootPrintRequestDto
dto
)
{
public
Result
page
(
@RequestBody
KlDataRequestDto
klDataRequestDto
)
{
logger
.
info
(
"【请求开始】用户足迹列表查询,请求参数,userId:{}"
,
dto
.
getUserId
());
String
json
=
klDataRequestDto
.
getKl_data
();
if
(
Objects
.
isNull
(
dto
.
getUserId
()))
{
logger
.
info
(
"【请求开始】用户足迹列表查询,请求参数,kl_data:{}"
,
json
);
String
userId
=
JsonUtils
.
getValueByPath
(
json
,
"userId"
);
String
page
=
JsonUtils
.
getValueByPath
(
json
,
"page"
);
String
size
=
JsonUtils
.
getValueByPath
(
json
,
"size"
);
if
(
StringUtils
.
isBlank
(
userId
))
{
return
Result
.
failed
(
"用户id不能为空"
);
return
Result
.
failed
(
"用户id不能为空"
);
}
}
if
(
Objects
.
isNull
(
dto
.
getPage
()
))
{
if
(
StringUtils
.
isBlank
(
page
))
{
return
Result
.
failed
(
"当前页不能为空"
);
return
Result
.
failed
(
"当前页不能为空"
);
}
}
if
(
Objects
.
isNull
(
dto
.
getSize
()
))
{
if
(
StringUtils
.
isBlank
(
size
))
{
return
Result
.
failed
(
"页面大小不能为空"
);
return
Result
.
failed
(
"页面大小不能为空"
);
}
}
if
(
StringUtils
.
isBlank
(
userId
))
{
return
Result
.
failed
(
"用户id不能为空"
);
}
if
(
StringUtils
.
isBlank
(
page
))
{
return
Result
.
failed
(
"当前页不能为空"
);
}
if
(
StringUtils
.
isBlank
(
size
))
{
return
Result
.
failed
(
"页面大小不能为空"
);
}
FootPrintRequestDto
dto
=
new
FootPrintRequestDto
();
dto
.
setUserId
(
Long
.
parseLong
(
userId
));
dto
.
setPage
(
Integer
.
parseInt
(
page
));
dto
.
setSize
(
Integer
.
parseInt
(
size
));
return
footPrintService
.
page
(
dto
);
return
footPrintService
.
page
(
dto
);
}
}
@PostMapping
(
"/del"
)
@PostMapping
(
"/del"
)
public
Result
delete
(
@RequestBody
FootPrintRequestDto
dto
)
{
public
Result
delete
(
@RequestBody
KlDataRequestDto
klDataRequestDto
)
{
logger
.
info
(
"【请求开始】用户足迹删除,请求参数,ids:{}"
,
dto
.
getIds
());
String
json
=
klDataRequestDto
.
getKl_data
();
if
(
CollectionUtils
.
isEmpty
(
dto
.
getIds
()))
{
logger
.
info
(
"【请求开始】收藏册收藏,请求参数,kl_data:{}"
,
json
);
return
Result
.
failed
(
"请选择足迹"
);
String
ids
=
JsonUtils
.
getValueByPath
(
json
,
"ids"
);
if
(
StringUtils
.
isBlank
(
ids
))
{
return
Result
.
failed
(
"收藏册id不能为空"
);
}
}
List
<
Long
>
idss
=
Arrays
.
stream
(
ids
.
substring
(
1
,
ids
.
length
()
-
1
).
split
(
","
))
.
map
(
Long:
:
valueOf
).
collect
(
Collectors
.
toList
());
FootPrintRequestDto
dto
=
new
FootPrintRequestDto
();
dto
.
setIds
(
idss
);
return
footPrintService
.
delete
(
dto
);
return
footPrintService
.
delete
(
dto
);
}
}
...
...
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