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
75c1bfb7
Commit
75c1bfb7
authored
Mar 20, 2020
by
曾迫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qq机器人发送欢迎语
parent
1afa0d1c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
129 additions
and
27 deletions
+129
-27
pom.xml
pcloud-service-book/pom.xml
+5
-0
WechatGroupConsr.java
...om/pcloud/book/consumer/wechatgroup/WechatGroupConsr.java
+10
-0
BookGuideBizImpl.java
...a/com/pcloud/book/keywords/biz/impl/BookGuideBizImpl.java
+0
-0
PcloudRobotBiz.java
...ava/com/pcloud/book/pcloudkeyword/biz/PcloudRobotBiz.java
+2
-0
PcloudRobotClassifyBiz.java
...pcloud/book/pcloudkeyword/biz/PcloudRobotClassifyBiz.java
+1
-1
PcloudRobotBizImpl.java
...cloud/book/pcloudkeyword/biz/impl/PcloudRobotBizImpl.java
+56
-4
PcloudRobotClassifyBizImpl.java
...ok/pcloudkeyword/biz/impl/PcloudRobotClassifyBizImpl.java
+11
-7
PcloudRobotWelcomeDao.java
.../pcloud/book/pcloudkeyword/dao/PcloudRobotWelcomeDao.java
+2
-2
PcloudRobotWelcomeDaoImpl.java
...ook/pcloudkeyword/dao/impl/PcloudRobotWelcomeDaoImpl.java
+12
-4
ClassifyWelcomeDTO.java
...com/pcloud/book/pcloudkeyword/dto/ClassifyWelcomeDTO.java
+3
-0
PcloudRobotWelcome.java
.../pcloud/book/pcloudkeyword/entity/PcloudRobotWelcome.java
+8
-0
PcloudRobotClassifyFacade.java
.../book/pcloudkeyword/facade/PcloudRobotClassifyFacade.java
+2
-2
PcloudRobotWelcome.Mapper.xml
...ources/mapper/pcloudkeyword/PcloudRobotWelcome.Mapper.xml
+17
-7
No files found.
pcloud-service-book/pom.xml
View file @
75c1bfb7
...
@@ -30,6 +30,11 @@
...
@@ -30,6 +30,11 @@
<!--内部调用依赖-->
<!--内部调用依赖-->
<dependency>
<dependency>
<groupId>
com.dcg
</groupId>
<artifactId>
CoolQSDK
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.pcloud.common
</groupId>
<groupId>
com.pcloud.common
</groupId>
<artifactId>
pcloud-common
</artifactId>
<artifactId>
pcloud-common
</artifactId>
<version>
${pcloud-common.version}
</version>
<version>
${pcloud-common.version}
</version>
...
...
pcloud-service-book/src/main/java/com/pcloud/book/consumer/wechatgroup/WechatGroupConsr.java
View file @
75c1bfb7
package
com
.
pcloud
.
book
.
consumer
.
wechatgroup
;
package
com
.
pcloud
.
book
.
consumer
.
wechatgroup
;
import
com.dcg.coolq.sdk.CoolQSDK
;
import
com.dcg.coolq.sdk.message.vos.send.PrivateMsgSendVO
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.aspect.ParamLog
;
...
@@ -70,6 +72,14 @@ public class WechatGroupConsr {
...
@@ -70,6 +72,14 @@ public class WechatGroupConsr {
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_RES_ERROR
,
"服务内部错误,请稍后重试"
);
}
}
}
}
@ParamLog
(
"qq机器人发送消息"
)
public
void
sendMessage4QQ
(
PrivateMsgSendVO
privateMsgSendVO
)
{
try
{
CoolQSDK
.
sendPrivateMsg
(
privateMsgSendVO
);
}
catch
(
Exception
e
)
{
log
.
error
(
"qq机器人给用户发送消息失败.[sendMessage]:"
+
e
.
getMessage
(),
e
);
}
}
@ParamLog
(
"是否群机器人"
)
@ParamLog
(
"是否群机器人"
)
public
Boolean
isGroupRobot
(
String
robotWxId
)
{
public
Boolean
isGroupRobot
(
String
robotWxId
)
{
...
...
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/impl/BookGuideBizImpl.java
View file @
75c1bfb7
This diff is collapsed.
Click to expand it.
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/biz/PcloudRobotBiz.java
View file @
75c1bfb7
...
@@ -109,4 +109,6 @@ public interface PcloudRobotBiz {
...
@@ -109,4 +109,6 @@ public interface PcloudRobotBiz {
List
<
String
>
getPcloudRobotByRobotType
(
Integer
classifyId
,
Integer
groupRobotType
);
List
<
String
>
getPcloudRobotByRobotType
(
Integer
classifyId
,
Integer
groupRobotType
);
void
handleMiniAppQr
();
void
handleMiniAppQr
();
void
sendQQWelcomeReply
(
Long
receiverId
,
Long
userId
,
List
<
PcloudRobotWelcome
>
robotWelcomeListByPcloudClassifyId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/biz/PcloudRobotClassifyBiz.java
View file @
75c1bfb7
...
@@ -35,7 +35,7 @@ public interface PcloudRobotClassifyBiz {
...
@@ -35,7 +35,7 @@ public interface PcloudRobotClassifyBiz {
*/
*/
PageBeanNew
<
PcloudRobotClassifyResponseVO
>
listClassifyByPage
(
Integer
currentPage
,
Integer
numPerPage
);
PageBeanNew
<
PcloudRobotClassifyResponseVO
>
listClassifyByPage
(
Integer
currentPage
,
Integer
numPerPage
);
ClassifyWelcomeDTO
getClassifyWelcome
(
Long
classifyId
);
ClassifyWelcomeDTO
getClassifyWelcome
(
Long
classifyId
,
Integer
robotType
);
void
updateClassifyWelcome
(
ClassifyWelcomeDTO
classifyWelcomeDTO
);
void
updateClassifyWelcome
(
ClassifyWelcomeDTO
classifyWelcomeDTO
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/biz/impl/PcloudRobotBizImpl.java
View file @
75c1bfb7
package
com
.
pcloud
.
book
.
pcloudkeyword
.
biz
.
impl
;
package
com
.
pcloud
.
book
.
pcloudkeyword
.
biz
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.dcg.coolq.sdk.message.MessageBuilder
;
import
com.dcg.coolq.sdk.message.components.ComponentImage
;
import
com.dcg.coolq.sdk.message.components.ComponentRecord
;
import
com.dcg.coolq.sdk.message.components.ComponentText
;
import
com.dcg.coolq.sdk.message.vos.send.PrivateMsgSendVO
;
import
com.pcloud.appcenter.app.dto.AppDto
;
import
com.pcloud.appcenter.app.dto.AppDto
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.book.dao.BookDao
;
import
com.pcloud.book.book.dao.BookDao
;
...
@@ -44,6 +49,7 @@ import com.pcloud.book.pcloudkeyword.set.PcloudRobotSet;
...
@@ -44,6 +49,7 @@ import com.pcloud.book.pcloudkeyword.set.PcloudRobotSet;
import
com.pcloud.book.push.biz.SelfPushBiz
;
import
com.pcloud.book.push.biz.SelfPushBiz
;
import
com.pcloud.book.push.dao.PersonalAppletsDao
;
import
com.pcloud.book.push.dao.PersonalAppletsDao
;
import
com.pcloud.book.push.entity.PersonalApplets
;
import
com.pcloud.book.push.entity.PersonalApplets
;
import
com.pcloud.book.push.enums.ItemTypeEnum
;
import
com.pcloud.book.skill.biz.PcloudSkillBiz
;
import
com.pcloud.book.skill.biz.PcloudSkillBiz
;
import
com.pcloud.book.skill.entity.PcloudSkill
;
import
com.pcloud.book.skill.entity.PcloudSkill
;
import
com.pcloud.book.util.common.ThreadPoolUtils
;
import
com.pcloud.book.util.common.ThreadPoolUtils
;
...
@@ -302,14 +308,16 @@ public class PcloudRobotBizImpl implements PcloudRobotBiz {
...
@@ -302,14 +308,16 @@ public class PcloudRobotBizImpl implements PcloudRobotBiz {
map
.
put
(
"robotWxId"
,
robotWxId
);
map
.
put
(
"robotWxId"
,
robotWxId
);
PcloudRobot
pcloudRobot
=
(
PcloudRobot
)
pcloudRobotDao
.
getBy
(
map
,
"getByRobotWxId"
);
PcloudRobot
pcloudRobot
=
(
PcloudRobot
)
pcloudRobotDao
.
getBy
(
map
,
"getByRobotWxId"
);
PcloudRobotClassify
robotClassify
=
new
PcloudRobotClassify
();
PcloudRobotClassify
robotClassify
=
new
PcloudRobotClassify
();
Integer
isOpenH5
=
0
;
if
(
pcloudRobot
!=
null
)
{
if
(
pcloudRobot
!=
null
)
{
if
(
pcloudRobot
.
getRobotType
()
!=
null
)
{
if
(
pcloudRobot
.
getRobotType
()
!=
null
)
{
Integer
welcomeDuration
=
3
;
Integer
welcomeDuration
=
3
;
robotClassify
=
pcloudRobotClassifyBiz
.
getClassifyById
(
pcloudRobot
.
getRobotType
().
longValue
());
robotClassify
=
pcloudRobotClassifyBiz
.
getClassifyById
(
pcloudRobot
.
getRobotType
().
longValue
());
if
(
robotClassify
!=
null
&&
robotClassify
.
getWelcomeDuration
()
!=
null
)
{
List
<
PcloudRobotWelcome
>
robotWelcomeList
=
pcloudRobotWelcomeDao
.
getRobotWelcomeListByPcloudClassifyId
(
pcloudRobot
.
getRobotType
().
longValue
(),
1
);
welcomeDuration
=
robotClassify
.
getWelcomeDuration
();
if
(
robotWelcomeList
!=
null
&&
robotWelcomeList
.
size
()>
0
){
welcomeDuration
=
robotWelcomeList
.
get
(
0
).
getWelcomeDuration
();
isOpenH5
=
robotWelcomeList
.
get
(
0
).
getIsOpenPushH5url
();
}
}
List
<
PcloudRobotWelcome
>
robotWelcomeList
=
pcloudRobotWelcomeDao
.
getRobotWelcomeListByPcloudClassifyId
(
pcloudRobot
.
getRobotType
().
longValue
());
pcloudRobotSet
.
fillRobotWelcome
(
robotWelcomeList
);
pcloudRobotSet
.
fillRobotWelcome
(
robotWelcomeList
);
Integer
count
=
robotWelcomeList
.
size
();
Integer
count
=
robotWelcomeList
.
size
();
String
messageGroup
=
UUID
.
randomUUID
().
toString
();
String
messageGroup
=
UUID
.
randomUUID
().
toString
();
...
@@ -414,7 +422,7 @@ public class PcloudRobotBizImpl implements PcloudRobotBiz {
...
@@ -414,7 +422,7 @@ public class PcloudRobotBizImpl implements PcloudRobotBiz {
index
++;
index
++;
}
}
}
}
if
(
robotClassify
!=
null
&&
robotClassify
.
getIsOpenPushH5url
()
!=
null
&&
robotClassify
.
getIsOpenPushH5url
()
==
1
)
{
if
(
isOpenH5
==
1
)
{
//发送H5链接
//发送H5链接
String
endUrl
=
wechatLinkPrefix
+
"/dialog"
+
"?book_group_id="
+
0
+
"&wxId="
+
userWxId
+
"&robotWxId="
+
robotWxId
;
String
endUrl
=
wechatLinkPrefix
+
"/dialog"
+
"?book_group_id="
+
0
+
"&wxId="
+
userWxId
+
"&robotWxId="
+
robotWxId
;
String
resultUrl
=
UrlUtils
.
getShortUrl4Own
(
endUrl
);
String
resultUrl
=
UrlUtils
.
getShortUrl4Own
(
endUrl
);
...
@@ -916,4 +924,48 @@ wechatGroupConsr.sendMessage(JSON.toJSONString(sendFileVO));
...
@@ -916,4 +924,48 @@ wechatGroupConsr.sendMessage(JSON.toJSONString(sendFileVO));
});
});
}
}
}
}
@Override
public
void
sendQQWelcomeReply
(
Long
receiverId
,
Long
userId
,
List
<
PcloudRobotWelcome
>
robotWelcomeListByPcloudClassifyId
)
{
if
(
StringUtil
.
isEmpty
(
userId
.
toString
())
||
StringUtil
.
isEmpty
(
receiverId
.
toString
())){
return
;
}
if
(
getUserTdState
(
receiverId
.
toString
(),
userId
.
toString
())
==
1
)
{
return
;
}
for
(
PcloudRobotWelcome
pcloudRobotWelcome:
robotWelcomeListByPcloudClassifyId
)
{
PrivateMsgSendVO
privateMsgSendVO
=
new
PrivateMsgSendVO
();
privateMsgSendVO
.
setSenderQQCode
(
Long
.
valueOf
(
receiverId
));
privateMsgSendVO
.
setReceiverQQCode
(
Long
.
valueOf
(
userId
));
if
(
WelcomeReplyTypeEnum
.
TEXT
.
value
.
equals
(
pcloudRobotWelcome
.
getReplyType
()))
{
// 构造一个文本消息
String
message
=
new
MessageBuilder
().
add
(
new
ComponentText
(
pcloudRobotWelcome
.
getContent
())).
toString
();
// 文本消息
privateMsgSendVO
.
setMessage
(
message
);
wechatGroupConsr
.
sendMessage4QQ
(
privateMsgSendVO
);
return
;
}
if
(
WelcomeReplyTypeEnum
.
IMAGE
.
value
.
equals
(
pcloudRobotWelcome
.
getReplyType
()))
{
// 构造一个图片消息
String
message
=
new
MessageBuilder
().
add
(
new
ComponentImage
(
pcloudRobotWelcome
.
getPicUrl
()))
.
toString
();
// 图片消息
privateMsgSendVO
.
setMessage
(
message
);
wechatGroupConsr
.
sendMessage4QQ
(
privateMsgSendVO
);
return
;
}
if
(
WelcomeReplyTypeEnum
.
AUDIO
.
value
.
equals
(
pcloudRobotWelcome
.
getReplyType
()))
{
// 构造一个图片消息
String
message
=
new
MessageBuilder
().
add
(
new
ComponentRecord
(
pcloudRobotWelcome
.
getResourceUrl
(),
false
)).
toString
();
// 音频消息
privateMsgSendVO
.
setMessage
(
message
);
wechatGroupConsr
.
sendMessage4QQ
(
privateMsgSendVO
);
return
;
}
if
(
WelcomeReplyTypeEnum
.
RESOURCE
.
value
.
equals
(
pcloudRobotWelcome
.
getReplyType
()))
{
// 构造一个图片消息
String
message
=
new
MessageBuilder
().
add
(
new
ComponentRecord
(
pcloudRobotWelcome
.
getResourceId
().
toString
(),
false
)).
toString
();
// 资源文件消息
privateMsgSendVO
.
setMessage
(
message
);
wechatGroupConsr
.
sendMessage4QQ
(
privateMsgSendVO
);
return
;
}
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/biz/impl/PcloudRobotClassifyBizImpl.java
View file @
75c1bfb7
...
@@ -124,12 +124,13 @@ public class PcloudRobotClassifyBizImpl implements PcloudRobotClassifyBiz {
...
@@ -124,12 +124,13 @@ public class PcloudRobotClassifyBizImpl implements PcloudRobotClassifyBiz {
}
}
@Override
@Override
public
ClassifyWelcomeDTO
getClassifyWelcome
(
Long
classifyId
)
{
public
ClassifyWelcomeDTO
getClassifyWelcome
(
Long
classifyId
,
Integer
robotType
)
{
ClassifyWelcomeDTO
classifyWelcomeDTO
=
new
ClassifyWelcomeDTO
();
ClassifyWelcomeDTO
classifyWelcomeDTO
=
new
ClassifyWelcomeDTO
();
PcloudRobotClassify
robotClassify
=
pcloudRobotClassifyDao
.
getById
(
classifyId
);
List
<
PcloudRobotWelcome
>
pcloudRobotWelcomeList
=
pcloudRobotWelcomeDao
.
getRobotWelcomeListByPcloudClassifyId
(
classifyId
,
robotType
);
classifyWelcomeDTO
.
setIsOpenPushH5url
(
robotClassify
.
getIsOpenPushH5url
());
if
(
pcloudRobotWelcomeList
!=
null
&&
pcloudRobotWelcomeList
.
size
()>
0
){
classifyWelcomeDTO
.
setWelcomeDuration
(
robotClassify
.
getWelcomeDuration
());
classifyWelcomeDTO
.
setIsOpenPushH5url
(
pcloudRobotWelcomeList
.
get
(
0
).
getIsOpenPushH5url
());
List
<
PcloudRobotWelcome
>
pcloudRobotWelcomeList
=
pcloudRobotWelcomeDao
.
getRobotWelcomeListByPcloudClassifyId
(
classifyId
);
classifyWelcomeDTO
.
setWelcomeDuration
(
pcloudRobotWelcomeList
.
get
(
0
).
getWelcomeDuration
());
}
pcloudRobotSet
.
fillRobotWelcome
(
pcloudRobotWelcomeList
);
pcloudRobotSet
.
fillRobotWelcome
(
pcloudRobotWelcomeList
);
classifyWelcomeDTO
.
setPcloudRobotWelcomeList
(
pcloudRobotWelcomeList
);
classifyWelcomeDTO
.
setPcloudRobotWelcomeList
(
pcloudRobotWelcomeList
);
return
classifyWelcomeDTO
;
return
classifyWelcomeDTO
;
...
@@ -137,12 +138,15 @@ public class PcloudRobotClassifyBizImpl implements PcloudRobotClassifyBiz {
...
@@ -137,12 +138,15 @@ public class PcloudRobotClassifyBizImpl implements PcloudRobotClassifyBiz {
@Override
@Override
public
void
updateClassifyWelcome
(
ClassifyWelcomeDTO
classifyWelcomeDTO
)
{
public
void
updateClassifyWelcome
(
ClassifyWelcomeDTO
classifyWelcomeDTO
)
{
pcloudRobotClassifyDao
.
updateWelcomeDuration
(
classifyWelcomeDTO
.
getPcloudClassifyId
(),
classifyWelcomeDTO
.
getWelcomeDuration
(),
classifyWelcomeDTO
.
getIsOpenPushH5url
());
//
pcloudRobotClassifyDao.updateWelcomeDuration(classifyWelcomeDTO.getPcloudClassifyId(), classifyWelcomeDTO.getWelcomeDuration(),classifyWelcomeDTO.getIsOpenPushH5url());
List
<
PcloudRobotWelcome
>
robotWelcomeList
=
classifyWelcomeDTO
.
getPcloudRobotWelcomeList
();
List
<
PcloudRobotWelcome
>
robotWelcomeList
=
classifyWelcomeDTO
.
getPcloudRobotWelcomeList
();
pcloudRobotWelcomeDao
.
deleteByPcloudClassifyId
(
classifyWelcomeDTO
.
getPcloudClassifyId
());
pcloudRobotWelcomeDao
.
deleteByPcloudClassifyId
(
classifyWelcomeDTO
.
getPcloudClassifyId
()
,
classifyWelcomeDTO
.
getRobotType
()
);
if
(
ListUtils
.
isEmpty
(
robotWelcomeList
))
{
if
(
ListUtils
.
isEmpty
(
robotWelcomeList
))
{
return
;
return
;
}
}
for
(
PcloudRobotWelcome
robotWelcome:
robotWelcomeList
)
{
robotWelcome
.
setRobotType
(
classifyWelcomeDTO
.
getRobotType
());
}
pcloudRobotWelcomeDao
.
batchInsert
(
robotWelcomeList
);
pcloudRobotWelcomeDao
.
batchInsert
(
robotWelcomeList
);
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/dao/PcloudRobotWelcomeDao.java
View file @
75c1bfb7
...
@@ -13,7 +13,7 @@ public interface PcloudRobotWelcomeDao extends BaseDao<PcloudRobotWelcome> {
...
@@ -13,7 +13,7 @@ public interface PcloudRobotWelcomeDao extends BaseDao<PcloudRobotWelcome> {
void
batchInsert
(
List
<
PcloudRobotWelcome
>
robotWelcomeList
);
void
batchInsert
(
List
<
PcloudRobotWelcome
>
robotWelcomeList
);
List
<
PcloudRobotWelcome
>
getRobotWelcomeListByPcloudClassifyId
(
Long
pcloudClassifyId
);
List
<
PcloudRobotWelcome
>
getRobotWelcomeListByPcloudClassifyId
(
Long
pcloudClassifyId
,
Integer
robotType
);
void
deleteByPcloudClassifyId
(
Long
pcloudClassifyId
);
void
deleteByPcloudClassifyId
(
Long
pcloudClassifyId
,
Integer
robotType
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/dao/impl/PcloudRobotWelcomeDaoImpl.java
View file @
75c1bfb7
...
@@ -5,7 +5,9 @@ import com.pcloud.book.pcloudkeyword.entity.PcloudRobotWelcome;
...
@@ -5,7 +5,9 @@ import com.pcloud.book.pcloudkeyword.entity.PcloudRobotWelcome;
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
(
"pcloudRobotWelcomeDao"
)
@Component
(
"pcloudRobotWelcomeDao"
)
public
class
PcloudRobotWelcomeDaoImpl
extends
BaseDaoImpl
<
PcloudRobotWelcome
>
implements
PcloudRobotWelcomeDao
{
public
class
PcloudRobotWelcomeDaoImpl
extends
BaseDaoImpl
<
PcloudRobotWelcome
>
implements
PcloudRobotWelcomeDao
{
...
@@ -26,13 +28,19 @@ public class PcloudRobotWelcomeDaoImpl extends BaseDaoImpl<PcloudRobotWelcome> i
...
@@ -26,13 +28,19 @@ public class PcloudRobotWelcomeDaoImpl extends BaseDaoImpl<PcloudRobotWelcome> i
}
}
@Override
@Override
public
List
<
PcloudRobotWelcome
>
getRobotWelcomeListByPcloudClassifyId
(
Long
pcloudClassifyId
)
{
public
List
<
PcloudRobotWelcome
>
getRobotWelcomeListByPcloudClassifyId
(
Long
pcloudClassifyId
,
Integer
robotType
)
{
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getRobotWelcomeListByPcloudClassifyId"
),
pcloudClassifyId
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"pcloudClassifyId"
,
pcloudClassifyId
);
map
.
put
(
"robotType"
,
robotType
);
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getRobotWelcomeListByPcloudClassifyId"
),
map
);
}
}
@Override
@Override
public
void
deleteByPcloudClassifyId
(
Long
pcloudClassifyId
)
{
public
void
deleteByPcloudClassifyId
(
Long
pcloudClassifyId
,
Integer
robotType
)
{
super
.
getSqlSession
().
delete
(
getStatement
(
"deleteByPcloudClassifyId"
),
pcloudClassifyId
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"pcloudClassifyId"
,
pcloudClassifyId
);
map
.
put
(
"robotType"
,
robotType
);
super
.
getSqlSession
().
delete
(
getStatement
(
"deleteByPcloudClassifyId"
),
map
);
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/dto/ClassifyWelcomeDTO.java
View file @
75c1bfb7
...
@@ -21,4 +21,7 @@ public class ClassifyWelcomeDTO extends BaseDTO {
...
@@ -21,4 +21,7 @@ public class ClassifyWelcomeDTO extends BaseDTO {
private
List
<
PcloudRobotWelcome
>
pcloudRobotWelcomeList
;
private
List
<
PcloudRobotWelcome
>
pcloudRobotWelcomeList
;
@ApiModelProperty
(
"机器人分类 1微信机器人 2qq机器人"
)
private
Integer
robotType
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/entity/PcloudRobotWelcome.java
View file @
75c1bfb7
...
@@ -70,6 +70,14 @@ public class PcloudRobotWelcome extends BaseEntity {
...
@@ -70,6 +70,14 @@ public class PcloudRobotWelcome extends BaseEntity {
@ApiModelProperty
(
"小程序宣传图片"
)
@ApiModelProperty
(
"小程序宣传图片"
)
private
String
sloganImgUrl
;
private
String
sloganImgUrl
;
@ApiModelProperty
(
"机器人分类 1微信机器人 2qq机器人"
)
private
Integer
robotType
;
@ApiModelProperty
(
"欢迎语间隔时长"
)
private
Integer
welcomeDuration
;
@ApiModelProperty
(
"是否开启h5页面链接推送"
)
private
Integer
isOpenPushH5url
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/facade/PcloudRobotClassifyFacade.java
View file @
75c1bfb7
...
@@ -64,9 +64,9 @@ public class PcloudRobotClassifyFacade {
...
@@ -64,9 +64,9 @@ public class PcloudRobotClassifyFacade {
@GetMapping
(
"getClassifyWelcome"
)
@GetMapping
(
"getClassifyWelcome"
)
public
ResponseDto
<?>
getClassifyWelcome
(
public
ResponseDto
<?>
getClassifyWelcome
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
"classifyId"
)
@ApiParam
(
"分类ID"
)
Long
classifyId
)
throws
BizException
,
PermissionException
{
@RequestParam
(
"classifyId"
)
@ApiParam
(
"分类ID"
)
Long
classifyId
,
@RequestParam
(
"robotType"
)
@ApiParam
(
"分类ID"
)
Integer
robotType
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
return
new
ResponseDto
<>(
pcloudRobotClassifyBiz
.
getClassifyWelcome
(
classifyId
));
return
new
ResponseDto
<>(
pcloudRobotClassifyBiz
.
getClassifyWelcome
(
classifyId
,
robotType
));
}
}
@PostMapping
(
"updateClassifyWelcome"
)
@PostMapping
(
"updateClassifyWelcome"
)
...
...
pcloud-service-book/src/main/resources/mapper/pcloudkeyword/PcloudRobotWelcome.Mapper.xml
View file @
75c1bfb7
...
@@ -15,11 +15,14 @@
...
@@ -15,11 +15,14 @@
<result
column=
"resource_id"
property=
"resourceId"
jdbcType=
"INTEGER"
/>
<result
column=
"resource_id"
property=
"resourceId"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"personal_applets_id"
property=
"personalAppletsId"
jdbcType=
"BIGINT"
/>
<result
column=
"personal_applets_id"
property=
"personalAppletsId"
jdbcType=
"BIGINT"
/>
<result
column=
"robot_type"
property=
"robotType"
jdbcType=
"INTEGER"
/>
<result
column=
"welcome_duration"
property=
"welcomeDuration"
jdbcType=
"INTEGER"
/>
<result
column=
"is_open_push_h5url"
property=
"isOpenPushH5url"
jdbcType=
"INTEGER"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, pcloud_robot_id, pcloud_classify_id, reply_type, content, pic_url, file_name, file_type, file_url,
id, pcloud_robot_id, pcloud_classify_id, reply_type, content, pic_url, file_name, file_type, file_url,
file_size, resource_id, create_time,personal_applets_id
file_size, resource_id, create_time,personal_applets_id
,robot_type,welcome_duration,is_open_push_h5url
</sql>
</sql>
<!--批量插入-->
<!--批量插入-->
...
@@ -36,7 +39,10 @@
...
@@ -36,7 +39,10 @@
file_size,
file_size,
resource_id,
resource_id,
create_time,
create_time,
personal_applets_id
personal_applets_id,
robot_type,
welcome_duration,
is_open_push_h5url
) values
) values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(
(
...
@@ -51,7 +57,10 @@
...
@@ -51,7 +57,10 @@
#{item.fileSize,jdbcType=BIGINT},
#{item.fileSize,jdbcType=BIGINT},
#{item.resourceId,jdbcType=BIGINT},
#{item.resourceId,jdbcType=BIGINT},
NOW(),
NOW(),
#{item.personalAppletsId,jdbcType=BIGINT}
#{item.personalAppletsId,jdbcType=BIGINT},
#{item.robotType,jdbcType=INTEGER},
#{item.welcomeDuration,jdbcType=INTEGER},
#{item.isOpenPushH5url,jdbcType=INTEGER}
)
)
</foreach>
</foreach>
</insert>
</insert>
...
@@ -61,9 +70,9 @@
...
@@ -61,9 +70,9 @@
where pcloud_robot_id = #{pcloudRobotId}
where pcloud_robot_id = #{pcloudRobotId}
</delete>
</delete>
<delete
id=
"deleteByPcloudClassifyId"
parameterType=
"
long
"
>
<delete
id=
"deleteByPcloudClassifyId"
parameterType=
"
map
"
>
delete from pcloud_robot_welcome
delete from pcloud_robot_welcome
where pcloud_classify_id = #{pcloudClassifyId}
where pcloud_classify_id = #{pcloudClassifyId}
and robot_type=#{robotType}
</delete>
</delete>
<select
id=
"getRobotWelcomeListByPcloudRobotId"
parameterType=
"long"
resultMap=
"BaseResultMap"
>
<select
id=
"getRobotWelcomeListByPcloudRobotId"
parameterType=
"long"
resultMap=
"BaseResultMap"
>
...
@@ -72,9 +81,9 @@
...
@@ -72,9 +81,9 @@
where pcloud_robot_id = #{pcloudRobotId}
where pcloud_robot_id = #{pcloudRobotId}
</select>
</select>
<select
id=
"getRobotWelcomeListByPcloudClassifyId"
parameterType=
"
long
"
resultMap=
"BaseResultMap"
>
<select
id=
"getRobotWelcomeListByPcloudClassifyId"
parameterType=
"
map
"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
select
<include
refid=
"Base_Column_List"
/>
from pcloud_robot_welcome
from pcloud_robot_welcome
where pcloud_classify_id = #{pcloudClassifyId}
where pcloud_classify_id = #{pcloudClassifyId}
and robot_type=#{robotType}
</select>
</select>
</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