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
b7659c08
Commit
b7659c08
authored
Sep 11, 2023
by
shiyu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/quanku_0914' into quanku_0914
parents
1a0ee1aa
75095e66
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
55 deletions
+25
-55
ch-admin-api/src/test/java/com/wwdz/ch/admin/impl/ElasticsearchUtilTest.java
...st/java/com/wwdz/ch/admin/impl/ElasticsearchUtilTest.java
+12
-2
ch-dao/pom.xml
ch-dao/pom.xml
+9
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/config/WebMvcConfiguration.java
.../main/java/com/wwdz/ch/wx/config/WebMvcConfiguration.java
+2
-4
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
...pi/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
+0
-49
ch-wx-api/src/main/java/com/wwdz/ch/wx/interceptor/LoginInterceptor.java
...ain/java/com/wwdz/ch/wx/interceptor/LoginInterceptor.java
+2
-0
No files found.
ch-admin-api/src/test/java/com/wwdz/ch/admin/impl/ElasticsearchUtilTest.java
View file @
b7659c08
...
@@ -56,15 +56,25 @@ public class ElasticsearchUtilTest {
...
@@ -56,15 +56,25 @@ public class ElasticsearchUtilTest {
@Test
@Test
public
void
find
()
{
public
void
find
()
{
EsSearchRequestDto
esSearchRequestDto
=
new
EsSearchRequestDto
();
EsSearchRequestDto
esSearchRequestDto
=
new
EsSearchRequestDto
();
//
esSearchRequestDto.setContent("清代");
//
esSearchRequestDto.setContent("清代");
// esSearchRequestDto.setIncludes(Arrays.asList("id", "source", "name","images","updateTime", "createTime"));
// esSearchRequestDto.setIncludes(Arrays.asList("id", "source", "name","images","updateTime", "createTime"));
esSearchRequestDto
.
setPage
(
1
);
esSearchRequestDto
.
setPage
(
1
);
esSearchRequestDto
.
setSize
(
2
0
);
esSearchRequestDto
.
setSize
(
4
0
);
EsPageInfo
esPageInfo
=
itemEsDao
.
findList
(
esSearchRequestDto
);
EsPageInfo
esPageInfo
=
itemEsDao
.
findList
(
esSearchRequestDto
);
logger
.
info
(
"esPageInfo = {}"
,
esPageInfo
);
logger
.
info
(
"esPageInfo = {}"
,
esPageInfo
);
}
}
@Test
public
void
getCuewords
()
{
EsSearchRequestDto
esSearchRequestDto
=
new
EsSearchRequestDto
();
esSearchRequestDto
.
setContent
(
"清代"
);
esSearchRequestDto
.
setSize
(
20
);
List
<
ItemOfEs
>
itemOfEsList
=
itemEsDao
.
getCuewords
(
esSearchRequestDto
);
logger
.
info
(
"getCuewords = {}"
,
itemOfEsList
);
}
/* @Test
/* @Test
public void find2() throws IOException {
public void find2() throws IOException {
EsSearchRequestDto esSearchRequestDto = new EsSearchRequestDto();
EsSearchRequestDto esSearchRequestDto = new EsSearchRequestDto();
...
...
ch-dao/pom.xml
View file @
b7659c08
...
@@ -214,6 +214,15 @@
...
@@ -214,6 +214,15 @@
</plugin>
</plugin>
</plugins>
</plugins>
<resources>
<resource>
<directory>
src/main/resources
</directory>
<includes>
<include>
**/*.xml
</include>
</includes>
</resource>
</resources>
</build>
</build>
</project>
</project>
ch-wx-api/src/main/java/com/wwdz/ch/wx/config/WebMvcConfiguration.java
View file @
b7659c08
...
@@ -30,9 +30,7 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
...
@@ -30,9 +30,7 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
registry
.
addInterceptor
(
loginInterceptor
())
registry
.
addInterceptor
(
loginInterceptor
())
.
addPathPatterns
(
"/**"
)
.
addPathPatterns
(
"/**"
)
.
excludePathPatterns
(
"/*.html"
,
"/**/*.html"
,
"/**/*.css"
,
"/**/*.js"
.
excludePathPatterns
(
"/*.html"
,
"/**/*.html"
,
"/**/*.css"
,
"/**/*.js"
,
"/wx/user/loginByWx"
,
"/wx/user/loginByMobile"
,
"/wx/user/loginRegCaptcha"
,
"/wx/user/updateRegCaptcha"
,
"/wx/user/login"
,
"/wx/user/fillCode"
);
,
"/wx/user/loginByWx"
,
"/wx/user/loginByMobile"
,
"/wx/user/loginRegCaptcha"
,
"/wx/user/updateRegCaptcha"
,
"/wx/user/login"
,
"/wx/user/fillCode"
// , "/wx/item/page", "/wx/item/info", "/wx/item/findNames"
,
"/wx/queryPrice/**"
);
// , "/wx/favorites/info", "/wx/favorites/itemList"
// , "/wx/keyword/recommend", "/wx/queryPrice/**");
}
}
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
View file @
b7659c08
...
@@ -560,55 +560,6 @@ public class ItemServiceImpl implements ItemService {
...
@@ -560,55 +560,6 @@ public class ItemServiceImpl implements ItemService {
item
.
setUpdateTime
(
now
);
item
.
setUpdateTime
(
now
);
itemDao
.
update
(
item
);
itemDao
.
update
(
item
);
// 更新收藏册
List
<
Long
>
favoritesIds
=
new
ArrayList
<>();
FavoritesItemsRelation
beforeRelation
=
favoritesItemsRelationDao
.
selectByUserIdItemId
(
dto
.
getUserId
(),
dto
.
getId
());
if
(
Objects
.
isNull
(
beforeRelation
))
{
if
(
Objects
.
nonNull
(
dto
.
getFavoritesId
())
&&
!
dto
.
getFavoritesId
().
equals
(
0L
))
{
// 新增藏品和收藏册关联
FavoritesItemsRelation
favoritesItemsRelation
=
new
FavoritesItemsRelation
();
favoritesItemsRelation
.
setUserId
(
dto
.
getUserId
());
favoritesItemsRelation
.
setFavoritesId
(
dto
.
getFavoritesId
());
favoritesItemsRelation
.
setItemId
(
item
.
getId
());
favoritesItemsRelation
.
setAddTime
(
now
);
favoritesItemsRelation
.
setUpdateTime
(
now
);
favoritesItemsRelationDao
.
insert
(
favoritesItemsRelation
);
// 加入更新列表
favoritesIds
.
add
(
dto
.
getFavoritesId
());
}
}
else
{
Long
beforeFavoritesId
=
beforeRelation
.
getFavoritesId
();
if
(
Objects
.
isNull
(
dto
.
getFavoritesId
())
||
dto
.
getFavoritesId
().
equals
(
0L
))
{
// 删除原来藏品和收藏册关联
favoritesItemsRelationDao
.
deleteByUserIdItemId
(
dto
.
getUserId
(),
dto
.
getId
());
// 加入更新列表
favoritesIds
.
add
(
beforeFavoritesId
);
}
else
{
if
(!
beforeRelation
.
getFavoritesId
().
equals
(
dto
.
getFavoritesId
()))
{
// 删除原来藏品和收藏册关联
favoritesItemsRelationDao
.
deleteByUserIdItemId
(
dto
.
getUserId
(),
dto
.
getId
());
// 新增藏品和收藏册关联
FavoritesItemsRelation
favoritesItemsRelation
=
new
FavoritesItemsRelation
();
favoritesItemsRelation
.
setUserId
(
dto
.
getUserId
());
favoritesItemsRelation
.
setFavoritesId
(
dto
.
getFavoritesId
());
favoritesItemsRelation
.
setItemId
(
item
.
getId
());
favoritesItemsRelation
.
setAddTime
(
now
);
favoritesItemsRelation
.
setUpdateTime
(
now
);
favoritesItemsRelationDao
.
insert
(
favoritesItemsRelation
);
// 加入更新列表
favoritesIds
.
add
(
beforeFavoritesId
);
favoritesIds
.
add
(
dto
.
getFavoritesId
());
}
}
}
if
(
CollectionUtils
.
isNotEmpty
(
favoritesIds
))
{
favoritesDao
.
updateTime
(
null
,
favoritesIds
);
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"id"
,
dto
.
getId
());
map
.
put
(
"id"
,
dto
.
getId
());
return
Result
.
success
(
map
);
return
Result
.
success
(
map
);
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/interceptor/LoginInterceptor.java
View file @
b7659c08
...
@@ -44,7 +44,9 @@ public class LoginInterceptor implements HandlerInterceptor {
...
@@ -44,7 +44,9 @@ public class LoginInterceptor implements HandlerInterceptor {
String
token
=
request
.
getHeader
(
"Authorization"
);
String
token
=
request
.
getHeader
(
"Authorization"
);
Switch
switchh
=
switchService
.
findOnly
();
Switch
switchh
=
switchService
.
findOnly
();
boolean
isOpen
=
Objects
.
nonNull
(
switchh
)
&&
switchh
.
getState
()
==
1
;
boolean
isOpen
=
Objects
.
nonNull
(
switchh
)
&&
switchh
.
getState
()
==
1
;
logger
.
info
(
"isOpen:"
+
isOpen
);
String
url
=
request
.
getRequestURI
();
String
url
=
request
.
getRequestURI
();
logger
.
info
(
"url:"
+
url
);
if
(!
isOpen
)
{
if
(!
isOpen
)
{
if
(
Arrays
.
asList
(
excludeUrl
).
contains
(
url
))
{
if
(
Arrays
.
asList
(
excludeUrl
).
contains
(
url
))
{
return
true
;
return
true
;
...
...
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