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
783ae2a0
Commit
783ae2a0
authored
Nov 25, 2020
by
吴博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:[1003871] 小程序站内信
parent
f1862198
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
119 additions
and
14 deletions
+119
-14
SearchRecordDao.java
...c/main/java/com/pcloud/book/book/dao/SearchRecordDao.java
+1
-1
SearchRecordDaoImpl.java
...va/com/pcloud/book/book/dao/impl/SearchRecordDaoImpl.java
+2
-2
ReaderConsr.java
...ain/java/com/pcloud/book/consumer/reader/ReaderConsr.java
+37
-0
CultivateNotifyBizImpl.java
...cloud/book/cultivate/biz/impl/CultivateNotifyBizImpl.java
+0
-0
NotifyParamCheck.java
...ava/com/pcloud/book/cultivate/check/NotifyParamCheck.java
+1
-1
CultivateNotifyDTO.java
...ava/com/pcloud/book/cultivate/dto/CultivateNotifyDTO.java
+14
-1
CultivateNotifyPageDTO.java
...com/pcloud/book/cultivate/dto/CultivateNotifyPageDTO.java
+1
-1
SearchSendUserDTO.java
...java/com/pcloud/book/cultivate/dto/SearchSendUserDTO.java
+2
-0
CultivateNotifyItem.java
...com/pcloud/book/cultivate/entity/CultivateNotifyItem.java
+29
-1
NotifySendTypeEnum.java
...a/com/pcloud/book/cultivate/enums/NotifySendTypeEnum.java
+5
-1
CultivateNotifyFacade.java
...m/pcloud/book/cultivate/facade/CultivateNotifyFacade.java
+2
-2
SearchRecord.xml
...vice-book/src/main/resources/mapper/book/SearchRecord.xml
+6
-1
CultivateNotifyItem.xml
...c/main/resources/mapper/cultivate/CultivateNotifyItem.xml
+19
-3
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/book/dao/SearchRecordDao.java
View file @
783ae2a0
...
...
@@ -22,5 +22,5 @@ public interface SearchRecordDao extends BaseDao<SearchRecord> {
List
<
AdviserBookInfoDTO
>
getBookSearchIds
(
String
keyword
,
Integer
currentPage
,
Integer
numPerPage
);
List
<
Long
>
getWechatUserIds
(
L
ong
bookId
);
List
<
Long
>
getWechatUserIds
(
L
ist
<
Long
>
bookIds
);
}
pcloud-service-book/src/main/java/com/pcloud/book/book/dao/impl/SearchRecordDaoImpl.java
View file @
783ae2a0
...
...
@@ -64,9 +64,9 @@ public class SearchRecordDaoImpl extends BaseDaoImpl<SearchRecord> implements Se
}
@Override
public
List
<
Long
>
getWechatUserIds
(
L
ong
bookId
)
{
public
List
<
Long
>
getWechatUserIds
(
L
ist
<
Long
>
bookIds
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"bookId
"
,
bookId
);
map
.
put
(
"bookId
s"
,
bookIds
);
return
super
.
getSqlSession
().
selectList
(
super
.
getStatement
(
"getWechatUserIds"
),
map
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/consumer/reader/ReaderConsr.java
View file @
783ae2a0
...
...
@@ -5,6 +5,7 @@ import com.pcloud.book.applet.dto.SpecialBookDTO;
import
com.pcloud.channelcenter.base.exceptions.ChannelBizException
;
import
com.pcloud.readercenter.wechat.dto.NickNameAndOpenIdDto
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -271,6 +272,42 @@ public class ReaderConsr {
}
return
wechatUserIds
;
}
public
List
<
Long
>
getWechatUserIdsByUserProfile
(
String
cityCode
,
String
startTime
,
String
endTime
)
{
LOGGER
.
info
(
"根据名称或id获取用户id"
);
List
<
Long
>
wechatUserIds
=
new
ArrayList
<>();
try
{
wechatUserIds
=
ResponseHandleUtil
.
parseList
(
wechatUserService
.
getWechatUserIdsByUserProfile
(
cityCode
,
startTime
,
endTime
),
Long
.
class
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"根据用户画像获取用户id.[getWechatUserByNameOrId]失败"
+
e
.
getMessage
(),
e
);
}
return
wechatUserIds
;
}
public
List
<
MiniUserDto
>
getSendUserInfo
(
List
<
Long
>
wechatUserIds
)
{
if
(
ListUtils
.
isEmpty
(
wechatUserIds
)){
return
new
ArrayList
<>();
}
List
<
MiniUserDto
>
result
=
new
ArrayList
<>();
try
{
ResponseEntity
<
ResponseDto
<
List
<
MiniUserDto
>>>
sendUserRobotInfo
=
wechatUserService
.
getSendUserInfo
(
wechatUserIds
);
result
=
ResponseHandleUtil
.
parseList
(
sendUserRobotInfo
,
MiniUserDto
.
class
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"获取小程序和小睿关系失败:"
+
e
.
getMessage
(),
e
);
}
return
result
;
}
public
List
<
Long
>
getMiniUsersByBookIds
(
List
<
Long
>
bookIds
)
{
LOGGER
.
info
(
"根据名称或id获取用户id"
);
List
<
Long
>
wechatUserIds
=
new
ArrayList
<>();
try
{
wechatUserIds
=
ResponseHandleUtil
.
parseList
(
wechatUserService
.
getMiniUsersByBookIds
(
bookIds
),
Long
.
class
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"根据用户画像获取用户id.[getWechatUserByNameOrId]失败"
+
e
.
getMessage
(),
e
);
}
return
wechatUserIds
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/biz/impl/CultivateNotifyBizImpl.java
View file @
783ae2a0
This diff is collapsed.
Click to expand it.
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/check/NotifyParamCheck.java
View file @
783ae2a0
...
...
@@ -40,7 +40,7 @@ public class NotifyParamCheck {
}
}
if
(
NotifySendTypeEnum
.
BOOK_USER
.
value
.
equals
(
cultivateNotifyDTO
.
getSendType
()))
{
if
(
null
==
cultivateNotifyDTO
.
getBookId
(
))
{
if
(
ListUtils
.
isEmpty
(
cultivateNotifyDTO
.
getBookIds
()
))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"bookId缺失!"
);
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/dto/CultivateNotifyDTO.java
View file @
783ae2a0
...
...
@@ -28,7 +28,10 @@ public class CultivateNotifyDTO {
@ApiModelProperty
(
"bookId"
)
private
Long
bookId
;
@ApiModelProperty
(
"发送类型(1-指定用户,2-分类用户,3-按书籍查询,4-全局公告消息)"
)
@ApiModelProperty
(
"bookIds"
)
private
List
<
Long
>
bookIds
;
@ApiModelProperty
(
"发送类型(1-指定用户,2-分类用户,3-按书籍查询,4-全局公告消息 5- 用户画像)"
)
private
Integer
sendType
;
@JsonFormat
(
...
...
@@ -45,4 +48,14 @@ public class CultivateNotifyDTO {
@ApiModelProperty
(
"出版社id"
)
private
Long
agentId
;
@ApiModelProperty
(
"城市编码"
)
private
String
cityCode
;
@ApiModelProperty
(
"注册开始时间"
)
private
String
startTime
;
@ApiModelProperty
(
"注册结束时间"
)
private
String
endTime
;
}
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/dto/CultivateNotifyPageDTO.java
View file @
783ae2a0
...
...
@@ -27,7 +27,7 @@ public class CultivateNotifyPageDTO {
private
List
<
CultivateNotifyItem
>
cultivateNotifyItems
;
@ApiModelProperty
(
"发送时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
,
timezone
=
"GMT+8"
)
private
Date
sendTime
;
}
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/dto/SearchSendUserDTO.java
View file @
783ae2a0
...
...
@@ -12,4 +12,6 @@ public class SearchSendUserDTO{
private
Integer
numPerPage
;
private
String
keyword
;
private
Long
agentId
;
}
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/entity/CultivateNotifyItem.java
View file @
783ae2a0
package
com
.
pcloud
.
book
.
cultivate
.
entity
;
import
com.pcloud.book.applet.dto.AppletBannerDTO
;
import
com.pcloud.book.applet.dto.AppletNewsDTO
;
import
com.pcloud.book.applet.dto.ServeItemInfoDTO
;
import
com.pcloud.common.entity.BaseEntity
;
import
com.pcloud.contentcenter.resource.dto.ResourceOfficeItemDTO
;
import
com.pcloud.contentcenter.resource.dto.ResourcePdfItemDTO
;
...
...
@@ -18,7 +21,7 @@ public class CultivateNotifyItem extends BaseEntity {
@ApiModelProperty
(
"消息id"
)
private
Long
messageId
;
@ApiModelProperty
(
"发送内容(1-文本,2-图片,3-音频)"
)
@ApiModelProperty
(
"发送内容(1-文本,2-图片,3-音频
, 4-链接
)"
)
private
Integer
contentType
;
@ApiModelProperty
(
"文字内容"
)
...
...
@@ -60,4 +63,29 @@ public class CultivateNotifyItem extends BaseEntity {
@ApiModelProperty
(
"音频时长"
)
private
BigDecimal
duration
;
@ApiModelProperty
(
"站内信发送选择活动类型时的资源"
)
private
AppletBannerDTO
sendServe
;
@ApiModelProperty
(
"跳转类型 1指定页面, 2web页面, 3资讯, 4应用作品"
)
private
Integer
jumpType
;
@ApiModelProperty
(
"跳转地址"
)
private
String
jumpUrl
;
@ApiModelProperty
(
"作品/应用/咨询的ID"
)
private
Long
serveId
;
@ApiModelProperty
(
"作品5/应用6/咨询的类型1"
)
private
Integer
serveType
;
@ApiModelProperty
(
"咨询具体信息"
)
private
AppletNewsDTO
newsItem
;
@ApiModelProperty
(
"咨询具体信息"
)
private
ServeItemInfoDTO
appItem
;
}
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/enums/NotifySendTypeEnum.java
View file @
783ae2a0
...
...
@@ -17,7 +17,11 @@ public enum NotifySendTypeEnum {
/**
* 全局公告消息
*/
ALL_USER
(
4
);
ALL_USER
(
4
),
/**
*用户画像
*/
USER_PROFILE
(
5
);
public
final
Integer
value
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/facade/CultivateNotifyFacade.java
View file @
783ae2a0
...
...
@@ -79,9 +79,9 @@ public class CultivateNotifyFacade {
@ApiOperation
(
"首条未读消息详情"
)
@GetMapping
(
"/getFirstNoReadNotify"
)
public
ResponseDto
<?>
getFirstNoReadNotify
(
@CookieValue
(
value
=
"userInfo"
,
required
=
false
)
String
userInfo
)
{
public
ResponseDto
<?>
getFirstNoReadNotify
(
@CookieValue
(
value
=
"userInfo"
,
required
=
false
)
String
userInfo
)
{
Long
wechatUserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
if
(!
NumberUtil
.
isNumber
(
wechatUserId
))
{
if
(!
NumberUtil
.
isNumber
(
wechatUserId
))
{
throw
new
BizException
(
BizException
.
PARAM_IS_NULL
.
getCode
(),
"wechatUserId 不能为空"
);
}
return
new
ResponseDto
<>(
cultivateNotifyBiz
.
getFirstNoReadNotify
(
wechatUserId
));
...
...
pcloud-service-book/src/main/resources/mapper/book/SearchRecord.xml
View file @
783ae2a0
...
...
@@ -155,7 +155,11 @@
<select
id=
"getWechatUserIds"
parameterType=
"map"
resultType=
"Long"
>
select distinct wechat_user_id
from search_record
where book_id=#{bookId}
where
book_id in
<foreach
collection=
"bookIds"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
and wechat_user_id>0
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/cultivate/CultivateNotifyItem.xml
View file @
783ae2a0
...
...
@@ -10,10 +10,18 @@
<result
column=
"resource_id"
property=
"resourceId"
jdbcType=
"BIGINT"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"serve_id"
jdbcType=
"BIGINT"
property=
"serveId"
/>
<result
column=
"serve_type"
jdbcType=
"TINYINT"
property=
"serveType"
/>
<result
column=
"jump_type"
jdbcType=
"INTEGER"
property=
"jumpType"
/>
<result
column=
"jump_url"
jdbcType=
"VARCHAR"
property=
"jumpUrl"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id,message_id, content_type, content,pic_url,resource_id, create_time,update_time
id,message_id, content_type, content,pic_url,resource_id, create_time,update_time,
jump_type,
jump_url,
serve_id,
serve_type
</sql>
<insert
id=
"batchInsert"
parameterType=
"com.pcloud.book.cultivate.entity.CultivateNotifyItem"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
...
...
@@ -25,7 +33,11 @@
pic_url,
resource_id,
create_time,
update_time
update_time,
jump_type,
jump_url,
serve_id,
serve_type
)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
...
...
@@ -36,7 +48,11 @@
#{item.picUrl},
#{item.resourceId},
NOW(),
NOW()
NOW(),
#{item.jumpType},
#{item.jumpUrl},
#{item.serveId},
#{item.serveType}
)
</foreach>
</insert>
...
...
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