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
285d80af
Commit
285d80af
authored
Jun 09, 2021
by
桂前礼
Committed by
桂前礼
Jun 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: [1004882] 小程序优化
parent
c6d5d34c
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
102 additions
and
7 deletions
+102
-7
AppletNotifySendDTO.java
...com/pcloud/book/cultivate/entity/AppletNotifySendDTO.java
+3
-0
CultivateNotifyService.java
...pcloud/book/cultivate/service/CultivateNotifyService.java
+5
-0
CultivateNotifyBiz.java
...ava/com/pcloud/book/cultivate/biz/CultivateNotifyBiz.java
+4
-0
CultivateNotifyBizImpl.java
...cloud/book/cultivate/biz/impl/CultivateNotifyBizImpl.java
+26
-0
CultivateNotifySendDao.java
...com/pcloud/book/cultivate/dao/CultivateNotifySendDao.java
+2
-0
CultivateNotifySendDaoImpl.java
...d/book/cultivate/dao/impl/CultivateNotifySendDaoImpl.java
+5
-0
CultivateNotifyItem.java
...com/pcloud/book/cultivate/entity/CultivateNotifyItem.java
+14
-2
ClearExpireNotifies.java
.../pcloud/book/cultivate/schedules/ClearExpireNotifies.java
+21
-0
CultivateNotifyServiceImpl.java
...ok/cultivate/service/impl/CultivateNotifyServiceImpl.java
+5
-2
CultivateNotifyItem.xml
...c/main/resources/mapper/cultivate/CultivateNotifyItem.xml
+7
-3
CultivateNotifySend.xml
...c/main/resources/mapper/cultivate/CultivateNotifySend.xml
+10
-0
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/cultivate/entity/AppletNotifySendDTO.java
View file @
285d80af
...
...
@@ -24,4 +24,7 @@ public class AppletNotifySendDTO {
@ApiModelProperty
(
"问题id"
)
private
Long
fromId
;
@ApiModelProperty
(
"JSON形式额外信息"
)
private
String
extJson
;
}
pcloud-facade-book/src/main/java/com/pcloud/book/cultivate/service/CultivateNotifyService.java
View file @
285d80af
...
...
@@ -42,4 +42,9 @@ public interface CultivateNotifyService {
@ApiOperation
(
value
=
"小睿互助创建站内信消息"
,
httpMethod
=
"POST"
)
@RequestMapping
(
value
=
"createNotify4Question"
,
method
=
RequestMethod
.
POST
)
ResponseEntity
<
ResponseDto
<
Long
>>
createNotify4Question
(
@RequestBody
AppletNotifySendDTO
newSendDTO
)
throws
BizException
;
@ApiOperation
(
value
=
"应用创建站内信消息"
,
httpMethod
=
"POST"
)
@RequestMapping
(
value
=
"createNotify4App"
,
method
=
RequestMethod
.
POST
)
ResponseEntity
<
ResponseDto
<
Long
>>
createNotify4App
(
@RequestBody
AppletNotifySendDTO
newSendDTO
)
throws
BizException
;
}
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/biz/CultivateNotifyBiz.java
View file @
285d80af
...
...
@@ -40,4 +40,8 @@ public interface CultivateNotifyBiz {
Long
createNotify4Question
(
AppletNotifySendDTO
newSendDTO
);
PageBeanNew
<
CultivateNotifyDTO
>
getLatestNotifyList
(
Long
wechatUserId
,
Integer
currentPage
,
Integer
numPerPage
);
Long
createNotify4App
(
AppletNotifySendDTO
newSendDTO
);
void
clearExpireNotifies
();
}
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/biz/impl/CultivateNotifyBizImpl.java
View file @
285d80af
...
...
@@ -592,4 +592,30 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
fillAppOrProduct4Notify
(
cultivateNotifyItemList
);
return
pageBeanNew
;
}
@Override
public
Long
createNotify4App
(
AppletNotifySendDTO
newSendDTO
)
{
if
(
null
==
newSendDTO
||
null
==
newSendDTO
.
getSendType
()
||
null
==
newSendDTO
.
getMessageType
()
||
StringUtil
.
isEmpty
(
newSendDTO
.
getTitle
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"新建站内信消息参数为空"
);
}
CultivateNotify
cultivateNotify
=
new
CultivateNotify
();
cultivateNotify
.
setMessageType
(
newSendDTO
.
getMessageType
());
cultivateNotify
.
setTitle
(
newSendDTO
.
getTitle
());
cultivateNotify
.
setSendType
(
newSendDTO
.
getSendType
());
cultivateNotify
.
setAgentId
(
0L
);
cultivateNotifyDao
.
insert
(
cultivateNotify
);
CultivateNotifyItem
cultivateNotifyItem
=
new
CultivateNotifyItem
();
cultivateNotifyItem
.
setMessageId
(
cultivateNotify
.
getMessageId
());
cultivateNotifyItem
.
setContentType
(
4
);
cultivateNotifyItem
.
setServeId
(
newSendDTO
.
getFromId
());
cultivateNotifyItem
.
setServeType
(
AppletRecordTypeEnum
.
APP
.
value
);
cultivateNotifyItem
.
setExtJson
(
newSendDTO
.
getExtJson
());
cultivateNotifyItemDao
.
insert
(
Lists
.
newArrayList
(
cultivateNotifyItem
));
return
cultivateNotify
.
getMessageId
();
}
@Override
public
void
clearExpireNotifies
()
{
cultivateNotifySendDao
.
clearExpireNotifies
();
}
}
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/dao/CultivateNotifySendDao.java
View file @
285d80af
...
...
@@ -24,4 +24,6 @@ public interface CultivateNotifySendDao extends BaseDao<CultivateNotifySend> {
List
<
Long
>
getSendUserIds
(
Long
messageId
,
Integer
currentPage
,
Integer
numPerPage
);
Integer
getSendUserCount
(
Long
messageId
);
void
clearExpireNotifies
();
}
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/dao/impl/CultivateNotifySendDaoImpl.java
View file @
285d80af
...
...
@@ -71,4 +71,9 @@ public class CultivateNotifySendDaoImpl extends BaseDaoImpl<CultivateNotifySend>
map
.
put
(
"messageId"
,
messageId
);
return
super
.
getSessionTemplate
().
selectOne
(
getStatement
(
"getSendUserCount"
),
map
);
}
@Override
public
void
clearExpireNotifies
()
{
getSessionTemplate
().
delete
(
getStatement
(
"clearExpireNotifies"
));
}
}
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/entity/CultivateNotifyItem.java
View file @
285d80af
package
com
.
pcloud
.
book
.
cultivate
.
entity
;
import
cn.hutool.core.map.MapUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.pcloud.book.applet.dto.AppletBannerDTO
;
import
com.pcloud.book.applet.dto.AppletNewsDTO
;
import
com.pcloud.book.applet.dto.ServeItemInfoDTO
;
...
...
@@ -13,6 +16,7 @@ import lombok.Data;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.Map
;
@Data
...
...
@@ -88,8 +92,16 @@ public class CultivateNotifyItem extends BaseEntity {
@ApiModelProperty
(
"小睿互助问题"
)
private
AppletQuestion
appletQuestion
;
@ApiModelProperty
(
"JSON格式的额外信息"
)
private
String
extJson
;
@ApiModelProperty
(
"extJson转map"
)
private
Map
<
String
,
Object
>
extMap
;
public
Map
<
String
,
Object
>
getExtMap
()
{
if
(
StrUtil
.
isNotBlank
(
extJson
))
{
return
JSONObject
.
parseObject
(
extJson
);
}
return
MapUtil
.
empty
();
}
}
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/schedules/ClearExpireNotifies.java
0 → 100644
View file @
285d80af
package
com
.
pcloud
.
book
.
cultivate
.
schedules
;
import
com.pcloud.book.cultivate.biz.CultivateNotifyBiz
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
@Component
public
class
ClearExpireNotifies
{
@Autowired
private
CultivateNotifyBiz
cultivateNotifyBiz
;
@Scheduled
(
cron
=
"0 0 1 * * ?"
)
public
void
doJob
(){
cultivateNotifyBiz
.
clearExpireNotifies
();
}
}
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/service/impl/CultivateNotifyServiceImpl.java
View file @
285d80af
...
...
@@ -9,8 +9,6 @@ import com.pcloud.common.exceptions.BizException;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
com.pcloud.common.utils.bean.ResponesUtils
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
...
@@ -49,4 +47,9 @@ public class CultivateNotifyServiceImpl implements CultivateNotifyService {
public
ResponseEntity
<
ResponseDto
<
Long
>>
createNotify4Question
(
@RequestBody
AppletNotifySendDTO
newSendDTO
)
throws
BizException
{
return
ResponseHandleUtil
.
toResponse
(
cultivateNotifyBiz
.
createNotify4Question
(
newSendDTO
));
}
@RequestMapping
(
value
=
"createNotify4App"
,
method
=
RequestMethod
.
POST
)
public
ResponseEntity
<
ResponseDto
<
Long
>>
createNotify4App
(
@RequestBody
AppletNotifySendDTO
newSendDTO
)
throws
BizException
{
return
ResponseHandleUtil
.
toResponse
(
cultivateNotifyBiz
.
createNotify4App
(
newSendDTO
));
}
}
pcloud-service-book/src/main/resources/mapper/cultivate/CultivateNotifyItem.xml
View file @
285d80af
...
...
@@ -14,6 +14,7 @@
<result
column=
"serve_type"
jdbcType=
"TINYINT"
property=
"serveType"
/>
<result
column=
"jump_type"
jdbcType=
"INTEGER"
property=
"jumpType"
/>
<result
column=
"jump_url"
jdbcType=
"VARCHAR"
property=
"jumpUrl"
/>
<result
column=
"ext_json"
jdbcType=
"LONGVARCHAR"
property=
"extJson"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
...
...
@@ -21,7 +22,8 @@
jump_type,
jump_url,
serve_id,
serve_type
serve_type,
ext_json
</sql>
<insert
id=
"batchInsert"
parameterType=
"com.pcloud.book.cultivate.entity.CultivateNotifyItem"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
...
...
@@ -37,7 +39,8 @@
jump_type,
jump_url,
serve_id,
serve_type
serve_type,
ext_json
)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
...
...
@@ -52,7 +55,8 @@
#{item.jumpType},
#{item.jumpUrl},
#{item.serveId},
#{item.serveType}
#{item.serveType},
#{item.extJson}
)
</foreach>
</insert>
...
...
pcloud-service-book/src/main/resources/mapper/cultivate/CultivateNotifySend.xml
View file @
285d80af
...
...
@@ -157,4 +157,13 @@
where message_id=#{messageId}
</select>
<delete
id=
"clearExpireNotifies"
>
DELETE
FROM
`cultivate_notify_send`
WHERE
message_type = 6
AND DATE( create_time )
<
DATE(SUBDATE( NOW(), INTERVAL 1 MONTH ))
</delete>
</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