Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
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
徐少华
midjourney-proxy
Commits
623b7285
Commit
623b7285
authored
Feb 19, 2020
by
阮思源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化用户搜索
parent
da2b727e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
2 deletions
+26
-2
SearchBizImpl.java
...ain/java/com/pcloud/book/book/biz/impl/SearchBizImpl.java
+1
-1
SearchRecordDao.java
...c/main/java/com/pcloud/book/book/dao/SearchRecordDao.java
+2
-0
SearchRecordDaoImpl.java
...va/com/pcloud/book/book/dao/impl/SearchRecordDaoImpl.java
+10
-0
SearchRecord.java
...c/main/java/com/pcloud/book/book/entity/SearchRecord.java
+3
-0
SearchRecord.xml
...vice-book/src/main/resources/mapper/book/SearchRecord.xml
+10
-1
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/SearchBizImpl.java
View file @
623b7285
...
@@ -363,7 +363,7 @@ public class SearchBizImpl implements SearchBiz {
...
@@ -363,7 +363,7 @@ public class SearchBizImpl implements SearchBiz {
if
(
StringUtil
.
isEmpty
(
wxId
)){
if
(
StringUtil
.
isEmpty
(
wxId
)){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数有误!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数有误!"
);
}
}
searchRecordDao
.
deleteByWxId
(
wxId
);
searchRecordDao
.
updateUserDeleteByWxId
(
wxId
,
true
);
}
}
@ParamLog
(
"填充出版社和用户信息"
)
@ParamLog
(
"填充出版社和用户信息"
)
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/dao/SearchRecordDao.java
View file @
623b7285
...
@@ -9,4 +9,6 @@ public interface SearchRecordDao extends BaseDao<SearchRecord> {
...
@@ -9,4 +9,6 @@ public interface SearchRecordDao extends BaseDao<SearchRecord> {
void
deleteByWxId
(
String
wxId
);
void
deleteByWxId
(
String
wxId
);
List
<
String
>
getRecent5WxIds
(
Long
bookId
);
List
<
String
>
getRecent5WxIds
(
Long
bookId
);
void
updateUserDeleteByWxId
(
String
wxId
,
Boolean
userDelete
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/dao/impl/SearchRecordDaoImpl.java
View file @
623b7285
...
@@ -5,7 +5,9 @@ import com.pcloud.book.book.entity.SearchRecord;
...
@@ -5,7 +5,9 @@ import com.pcloud.book.book.entity.SearchRecord;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
@Component
(
"searchRecordDao"
)
@Component
(
"searchRecordDao"
)
public
class
SearchRecordDaoImpl
extends
BaseDaoImpl
<
SearchRecord
>
implements
SearchRecordDao
{
public
class
SearchRecordDaoImpl
extends
BaseDaoImpl
<
SearchRecord
>
implements
SearchRecordDao
{
...
@@ -19,4 +21,12 @@ public class SearchRecordDaoImpl extends BaseDaoImpl<SearchRecord> implements Se
...
@@ -19,4 +21,12 @@ public class SearchRecordDaoImpl extends BaseDaoImpl<SearchRecord> implements Se
public
List
<
String
>
getRecent5WxIds
(
Long
bookId
)
{
public
List
<
String
>
getRecent5WxIds
(
Long
bookId
)
{
return
super
.
getSqlSession
().
selectList
(
super
.
getStatement
(
"getRecent5WxIds"
),
bookId
);
return
super
.
getSqlSession
().
selectList
(
super
.
getStatement
(
"getRecent5WxIds"
),
bookId
);
}
}
@Override
public
void
updateUserDeleteByWxId
(
String
wxId
,
Boolean
userDelete
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"wxId"
,
wxId
);
map
.
put
(
"userDelete"
,
userDelete
);
super
.
getSqlSession
().
update
(
super
.
getStatement
(
"updateUserDeleteByWxId"
),
map
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/entity/SearchRecord.java
View file @
623b7285
...
@@ -39,4 +39,7 @@ public class SearchRecord extends BaseEntity {
...
@@ -39,4 +39,7 @@ public class SearchRecord extends BaseEntity {
@ApiModelProperty
(
"热门关键词id"
)
@ApiModelProperty
(
"热门关键词id"
)
private
Long
hotBookId
;
private
Long
hotBookId
;
@ApiModelProperty
(
"用户是否删除"
)
private
Boolean
userDelete
;
}
}
pcloud-service-book/src/main/resources/mapper/book/SearchRecord.xml
View file @
623b7285
...
@@ -9,11 +9,12 @@
...
@@ -9,11 +9,12 @@
<result
column=
"agent_id"
property=
"agentId"
jdbcType=
"BIGINT"
/>
<result
column=
"agent_id"
property=
"agentId"
jdbcType=
"BIGINT"
/>
<result
column=
"wx_id"
property=
"wxId"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_id"
property=
"wxId"
jdbcType=
"VARCHAR"
/>
<result
column=
"hot_book_id"
property=
"hotBookId"
jdbcType=
"BIGINT"
/>
<result
column=
"hot_book_id"
property=
"hotBookId"
jdbcType=
"BIGINT"
/>
<result
column=
"user_delete"
property=
"userDelete"
jdbcType=
"BOOLEAN"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"INTEGER"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id,content,book_id,agent_id,wx_id,hot_book_id,create_time
id,content,book_id,agent_id,wx_id,hot_book_id,
user_delete,
create_time
</sql>
</sql>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.book.entity.SearchRecord"
useGeneratedKeys=
"true"
<insert
id=
"insert"
parameterType=
"com.pcloud.book.book.entity.SearchRecord"
useGeneratedKeys=
"true"
...
@@ -68,6 +69,7 @@
...
@@ -68,6 +69,7 @@
select
<include
refid=
"Base_Column_List"
/>
select
<include
refid=
"Base_Column_List"
/>
from search_record
from search_record
where wx_id=#{wxId}
where wx_id=#{wxId}
and user_delete=0
group by content
group by content
order by create_time desc
order by create_time desc
</select>
</select>
...
@@ -84,4 +86,10 @@
...
@@ -84,4 +86,10 @@
limit 5
limit 5
</select>
</select>
<update
id=
"updateUserDeleteByWxId"
parameterType=
"map"
>
update search_record
set user_delete=#{userDelete}
where wx_id=#{wxId}
</update>
</mapper>
</mapper>
\ No newline at end of file
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