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
59cf09ff
Commit
59cf09ff
authored
Aug 30, 2019
by
郑永强
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://192.168.89.173/rays/pcloud-common-parent
into zyq
parents
90b7924f
bd57671b
Show whitespace changes
Inline
Side-by-side
Showing
44 changed files
with
1769 additions
and
259 deletions
+1769
-259
public_system.properties
...n-config/src/main/resources.prod/public_system.properties
+8
-0
public_system.properties
...on-config/src/main/resources.uat/public_system.properties
+10
-0
KnowledgeUseQueueBiz.java
...java/com/pcloud/common/core/biz/KnowledgeUseQueueBiz.java
+22
-0
TranscodeQueueBiz.java
...in/java/com/pcloud/common/core/biz/TranscodeQueueBiz.java
+1
-1
KnowledgeUseQueueBizImpl.java
...pcloud/common/core/biz/impl/KnowledgeUseQueueBizImpl.java
+38
-0
ConvertEnum.java
...ain/java/com/pcloud/common/core/constant/ConvertEnum.java
+5
-1
MQQueueConstant.java
...java/com/pcloud/common/core/constant/MQQueueConstant.java
+9
-0
MQTopicProducer.java
...java/com/pcloud/common/core/constant/MQTopicProducer.java
+24
-0
ProductTypeConstant.java
.../com/pcloud/common/core/constant/ProductTypeConstant.java
+7
-1
WXKeywordOperationConstant.java
...loud/common/core/constant/WXKeywordOperationConstant.java
+5
-0
ExapiMessageContentDto.java
...va/com/pcloud/common/core/dto/ExapiMessageContentDto.java
+33
-0
KnowledgeUseMQDTO.java
...in/java/com/pcloud/common/core/dto/KnowledgeUseMQDTO.java
+35
-0
SendMessageDto.java
.../main/java/com/pcloud/common/core/dto/SendMessageDto.java
+14
-0
AppProductTypeEnum.java
...java/com/pcloud/common/core/enums/AppProductTypeEnum.java
+10
-5
TempletCodeEnum.java
...in/java/com/pcloud/common/core/enums/TempletCodeEnum.java
+17
-11
Application.java
...n/src/main/java/com/pcloud/common/config/Application.java
+22
-0
AppTypeConstant.java
...main/java/com/pcloud/common/constant/AppTypeConstant.java
+42
-0
CacheConstant.java
...c/main/java/com/pcloud/common/constant/CacheConstant.java
+5
-0
FilePathConstant.java
...ain/java/com/pcloud/common/constant/FilePathConstant.java
+69
-0
ResponseDto.java
...mmon/src/main/java/com/pcloud/common/dto/ResponseDto.java
+56
-3
StoreFlowInfoDto.java
...src/main/java/com/pcloud/common/dto/StoreFlowInfoDto.java
+221
-0
StoreMyPayDto.java
...on/src/main/java/com/pcloud/common/dto/StoreMyPayDto.java
+270
-0
AppRouteEnum.java
...n/src/main/java/com/pcloud/common/enums/AppRouteEnum.java
+186
-0
AppTypeEnum.java
...on/src/main/java/com/pcloud/common/enums/AppTypeEnum.java
+81
-57
ParamCheck.java
...rc/main/java/com/pcloud/common/exceptions/ParamCheck.java
+15
-0
QueueNameConstant.java
...java/com/pcloud/common/mq/constant/QueueNameConstant.java
+14
-0
ServerLinkDTO.java
...src/main/java/com/pcloud/common/mq/dto/ServerLinkDTO.java
+65
-0
ServerLinkQueue.java
...main/java/com/pcloud/common/mq/queue/ServerLinkQueue.java
+54
-0
FileUtils.java
...mmon/src/main/java/com/pcloud/common/utils/FileUtils.java
+6
-6
ImageUtils.java
...mon/src/main/java/com/pcloud/common/utils/ImageUtils.java
+38
-84
LocalDateUtils.java
...src/main/java/com/pcloud/common/utils/LocalDateUtils.java
+140
-4
PictureUtil.java
...on/src/main/java/com/pcloud/common/utils/PictureUtil.java
+0
-4
ResponseHandleUtil.java
...main/java/com/pcloud/common/utils/ResponseHandleUtil.java
+122
-14
SessionUtil.java
...on/src/main/java/com/pcloud/common/utils/SessionUtil.java
+25
-4
ThreadUtil.java
...mon/src/main/java/com/pcloud/common/utils/ThreadUtil.java
+8
-1
UUIDUitl.java
...ommon/src/main/java/com/pcloud/common/utils/UUIDUitl.java
+44
-27
OssUtils.java
...rc/main/java/com/pcloud/common/utils/aliyun/OssUtils.java
+3
-3
UrlUtils.java
...ain/java/com/pcloud/common/utils/httpclient/UrlUtils.java
+2
-18
PdfUtils.java
...n/src/main/java/com/pcloud/common/utils/pdf/PdfUtils.java
+5
-7
StringUtil.java
.../main/java/com/pcloud/common/utils/string/StringUtil.java
+15
-0
WordNewUtils.java
.../main/java/com/pcloud/common/utils/word/WordNewUtils.java
+3
-3
WordUtils.java
...src/main/java/com/pcloud/common/utils/word/WordUtils.java
+4
-4
SolrDto.java
pcloud-solr/src/main/java/com/pcloud/solr/SolrDto.java
+15
-0
SolrQueryParam.java
...ud-solr/src/main/java/com/pcloud/solr/SolrQueryParam.java
+1
-1
No files found.
pcloud-common-config/src/main/resources.prod/public_system.properties
View file @
59cf09ff
...
@@ -103,3 +103,11 @@ papercut.domain = papercut.5rs.me
...
@@ -103,3 +103,11 @@ papercut.domain = papercut.5rs.me
## \u5C0F\u7A0B\u5E8F\u57DF\u540D
## \u5C0F\u7A0B\u5E8F\u57DF\u540D
app.domain
=
app.5rs.me
app.domain
=
app.5rs.me
adviser.product.search.excluding.supermerchants
=
1000022269,1000022270
our_manager_account_id
=
2
group.luck.url
=
https://app.5rs.me/luck/W23/C2/A0/groupluck
manage_official_id
=
22
pcloud-common-config/src/main/resources.uat/public_system.properties
View file @
59cf09ff
...
@@ -105,3 +105,13 @@ papercut.domain = papercut.raysyun.com
...
@@ -105,3 +105,13 @@ papercut.domain = papercut.raysyun.com
## \u5C0F\u7A0B\u5E8F\u57DF\u540D
## \u5C0F\u7A0B\u5E8F\u57DF\u540D
app.domain
=
app.raysyun.com
app.domain
=
app.raysyun.com
adviser.product.search.excluding.supermerchants
=
7,1000233
our_manager_account_id
=
12829
group.luck.url
=
https://app10035515.raysyun.com/luck/W35515/C35515/A0/groupluck
manage_official_id
=
22
pcloud-common-core/src/main/java/com/pcloud/common/core/biz/KnowledgeUseQueueBiz.java
0 → 100644
View file @
59cf09ff
/**
*
*/
package
com
.
pcloud
.
common
.
core
.
biz
;
import
com.pcloud.common.core.dto.KnowledgeUseMQDTO
;
import
com.pcloud.common.exceptions.BizException
;
/**
* @author:songx
* @date:2019/6/20,11:38
*/
public
interface
KnowledgeUseQueueBiz
{
/**
* 发送消息
*
* @param knowledgeUseMQDTO
*/
void
send
(
KnowledgeUseMQDTO
knowledgeUseMQDTO
)
throws
BizException
;
}
pcloud-common-core/src/main/java/com/pcloud/common/core/biz/TranscodeQueueBiz.java
View file @
59cf09ff
...
@@ -17,7 +17,7 @@ public interface TranscodeQueueBiz {
...
@@ -17,7 +17,7 @@ public interface TranscodeQueueBiz {
/**
/**
* 发送消息
* 发送消息
*
*
* @param
messageQueueDto
* @param
transcodeMQDTO
*/
*/
void
sendTranscodeQueue
(
TranscodeMQDTO
transcodeMQDTO
)
throws
BizException
;
void
sendTranscodeQueue
(
TranscodeMQDTO
transcodeMQDTO
)
throws
BizException
;
...
...
pcloud-common-core/src/main/java/com/pcloud/common/core/biz/impl/KnowledgeUseQueueBizImpl.java
0 → 100644
View file @
59cf09ff
/**
*
*/
package
com
.
pcloud
.
common
.
core
.
biz
.
impl
;
import
org.springframework.amqp.core.AmqpTemplate
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.biz.KnowledgeUseQueueBiz
;
import
com.pcloud.common.core.constant.MQQueueConstant
;
import
com.pcloud.common.core.dto.KnowledgeUseMQDTO
;
import
com.pcloud.common.exceptions.BizException
;
/**
* @author:songx
* @date:2019/6/20,11:37
*/
@Component
public
class
KnowledgeUseQueueBizImpl
implements
KnowledgeUseQueueBiz
{
@Autowired
private
AmqpTemplate
amqpTemplate
;
/**
* 知识点标签使用QUEUE
*/
@Override
@ParamLog
(
"知识点标签使用QUEUE"
)
public
void
send
(
KnowledgeUseMQDTO
knowledgeUseMQDTO
)
throws
BizException
{
if
(
knowledgeUseMQDTO
==
null
)
{
throw
BizException
.
PARAM_IS_NULL
;
}
amqpTemplate
.
convertAndSend
(
MQQueueConstant
.
KNOWLEDGE_USE
,
knowledgeUseMQDTO
);
}
}
pcloud-common-core/src/main/java/com/pcloud/common/core/constant/ConvertEnum.java
View file @
59cf09ff
...
@@ -98,7 +98,11 @@ public enum ConvertEnum {
...
@@ -98,7 +98,11 @@ public enum ConvertEnum {
/**
/**
* 场景化应用
* 场景化应用
*/
*/
SCENARIZED_APP
(
"SCENARIZED_APP"
);
SCENARIZED_APP
(
"SCENARIZED_APP"
),
/**
* BOOK
*/
BOOK
(
"BOOK"
);
/**
/**
* 值
* 值
...
...
pcloud-common-core/src/main/java/com/pcloud/common/core/constant/MQQueueConstant.java
View file @
59cf09ff
...
@@ -11,6 +11,11 @@ package com.pcloud.common.core.constant;
...
@@ -11,6 +11,11 @@ package com.pcloud.common.core.constant;
public
class
MQQueueConstant
{
public
class
MQQueueConstant
{
/**
/**
* 知识点标签使用
*/
public
static
final
String
KNOWLEDGE_USE
=
"knowledgeUse"
;
/**
* 模板消息
* 模板消息
*/
*/
public
static
final
String
TEMPLATE
=
"templateQueue"
;
public
static
final
String
TEMPLATE
=
"templateQueue"
;
...
@@ -98,6 +103,10 @@ public class MQQueueConstant {
...
@@ -98,6 +103,10 @@ public class MQQueueConstant {
* 文件转码结束(音视频)->场景化应用
* 文件转码结束(音视频)->场景化应用
*/
*/
public
static
final
String
CONVERT_TO_SCENARIZEDAPP
=
"convert2ScenarizedAppQueue"
;
public
static
final
String
CONVERT_TO_SCENARIZEDAPP
=
"convert2ScenarizedAppQueue"
;
/**
* 文件转码结束(音视频)->BOOK
*/
public
static
final
String
CONVERT_TO_BOOK
=
"convert2BookQueue"
;
/**
/**
* 数据埋点
* 数据埋点
...
...
pcloud-common-core/src/main/java/com/pcloud/common/core/constant/MQTopicProducer.java
View file @
59cf09ff
...
@@ -344,4 +344,28 @@ public class MQTopicProducer {
...
@@ -344,4 +344,28 @@ public class MQTopicProducer {
* 微信群用户绑定TOPIC
* 微信群用户绑定TOPIC
*/
*/
public
static
final
String
WXGROUP_USER_BIND
=
"topic.wXGroupUserBind"
;
public
static
final
String
WXGROUP_USER_BIND
=
"topic.wXGroupUserBind"
;
/**
* 商品创建
*/
public
static
final
String
PRODUCT_CREATE
=
"topic.productCreate"
;
/**
* 代理商删除TOPIC
*/
public
static
final
String
DELETE_PROMOTER
=
"topic.deletePromoter"
;
/**
* 社群书群分类删除
*/
public
static
final
String
GROUP_CLASSIFY_DELETE
=
"topic.groupClassifyDelete"
;
/**
* 微信群学习报告
*/
public
static
final
String
WXGROUP_LEARNING_REPORT
=
"topic.wxGroupLearningReport"
;
/**
* 同意加好友
*/
public
static
final
String
WX_AGREE_ADD_USER
=
"topic.wxAgreeAddUser"
;
}
}
pcloud-common-core/src/main/java/com/pcloud/common/core/constant/ProductTypeConstant.java
View file @
59cf09ff
...
@@ -347,7 +347,7 @@ public class ProductTypeConstant {
...
@@ -347,7 +347,7 @@ public class ProductTypeConstant {
* 资源型作品(免费即可体验)
* 资源型作品(免费即可体验)
*/
*/
public
static
final
String
[]
RESOURCE_PRODUCT
=
{
AUDIO
,
VIDEO
,
PDF
,
EBOOK
,
ALBUM
,
PRETEST
,
QANEWS
,
public
static
final
String
[]
RESOURCE_PRODUCT
=
{
AUDIO
,
VIDEO
,
PDF
,
EBOOK
,
ALBUM
,
PRETEST
,
QANEWS
,
FORMAT
,
WORD
,
ARTICLE
,
LISTEN
,
SCHEDULE
,
PBMUSIC
,
TUTORIAL
,
VIDEO_SCHEDULE
,
AUDIO_SCHEDULE
,
LINK
};
FORMAT
,
WORD
,
ARTICLE
,
LISTEN
,
SCHEDULE
,
PBMUSIC
,
TUTORIAL
,
VIDEO_SCHEDULE
,
AUDIO_SCHEDULE
,
LINK
,
AUDIOAPP
,
SUBJECTNOTE
};
/**
/**
* 参与促销激励作品
* 参与促销激励作品
...
@@ -378,4 +378,10 @@ public class ProductTypeConstant {
...
@@ -378,4 +378,10 @@ public class ProductTypeConstant {
* 作品下资源来源于content中心的作品
* 作品下资源来源于content中心的作品
*/
*/
public
static
final
String
[]
RESOURCE_CONTENT_PRODUCT
=
{
AUDIO
,
VIDEO
,
BOOK
,
LISTEN
,
PDF
,
ALBUM
,
FORMAT
,
EBOOK
};
public
static
final
String
[]
RESOURCE_CONTENT_PRODUCT
=
{
AUDIO
,
VIDEO
,
BOOK
,
LISTEN
,
PDF
,
ALBUM
,
FORMAT
,
EBOOK
};
/**
* 自建码支持的作品类型
*/
public
static
final
String
[]
IS_ALI_TYPE_PRODUCT
=
{
AUDIO
,
VIDEO
,
PDF
,
SCHEDULE
,
VIDEO_SCHEDULE
,
AUDIO_SCHEDULE
,
LINK
,
SUBJECTNOTE
,
ARTICLE
,
EBOOK
,
ALBUM
,
NUMBER
,
PRETEST
,
LISTEN
,
FORMAT
,
WORD
,
ARTICLE
,
PBMUSIC
};
}
}
pcloud-common-core/src/main/java/com/pcloud/common/core/constant/WXKeywordOperationConstant.java
View file @
59cf09ff
...
@@ -18,4 +18,9 @@ public class WXKeywordOperationConstant {
...
@@ -18,4 +18,9 @@ public class WXKeywordOperationConstant {
public
static
final
String
SEND_ATTENDANCE_RECORD
=
"SEND_ATTENDANCE_RECORD"
;
public
static
final
String
SEND_ATTENDANCE_RECORD
=
"SEND_ATTENDANCE_RECORD"
;
/**
* 打卡作品/应用--加入且打卡
*/
public
static
final
String
JOIN_AND_SEND_RECORD
=
"JOIN_AND_SEND_RECORD"
;
}
}
pcloud-common-core/src/main/java/com/pcloud/common/core/dto/ExapiMessageContentDto.java
View file @
59cf09ff
...
@@ -28,6 +28,12 @@ public class ExapiMessageContentDto implements Serializable{
...
@@ -28,6 +28,12 @@ public class ExapiMessageContentDto implements Serializable{
String
agentName
;
String
agentName
;
@ApiModelProperty
(
"商品名称"
)
@ApiModelProperty
(
"商品名称"
)
String
productName
;
String
productName
;
@ApiModelProperty
(
"扫码名称"
)
String
sceneName
;
@ApiModelProperty
(
"书籍名称"
)
String
bookName
;
@ApiModelProperty
(
"公众号名称名称"
)
String
officialAccountName
;
public
Long
getCustomerId
()
{
public
Long
getCustomerId
()
{
return
customerId
;
return
customerId
;
...
@@ -101,6 +107,30 @@ public class ExapiMessageContentDto implements Serializable{
...
@@ -101,6 +107,30 @@ public class ExapiMessageContentDto implements Serializable{
this
.
productName
=
productName
;
this
.
productName
=
productName
;
}
}
public
String
getSceneName
()
{
return
sceneName
;
}
public
void
setSceneName
(
String
sceneName
)
{
this
.
sceneName
=
sceneName
;
}
public
String
getBookName
()
{
return
bookName
;
}
public
void
setBookName
(
String
bookName
)
{
this
.
bookName
=
bookName
;
}
public
String
getOfficialAccountName
()
{
return
officialAccountName
;
}
public
void
setOfficialAccountName
(
String
officialAccountName
)
{
this
.
officialAccountName
=
officialAccountName
;
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"ExapiMessageContentDto{"
+
return
"ExapiMessageContentDto{"
+
...
@@ -113,6 +143,9 @@ public class ExapiMessageContentDto implements Serializable{
...
@@ -113,6 +143,9 @@ public class ExapiMessageContentDto implements Serializable{
", actionTime='"
+
actionTime
+
'\''
+
", actionTime='"
+
actionTime
+
'\''
+
", agentName='"
+
agentName
+
'\''
+
", agentName='"
+
agentName
+
'\''
+
", productName='"
+
productName
+
'\''
+
", productName='"
+
productName
+
'\''
+
", sceneName='"
+
sceneName
+
'\''
+
", bookName='"
+
bookName
+
'\''
+
", officialAccountName='"
+
officialAccountName
+
'\''
+
'}'
;
'}'
;
}
}
}
}
pcloud-common-core/src/main/java/com/pcloud/common/core/dto/KnowledgeUseMQDTO.java
0 → 100644
View file @
59cf09ff
/**
*
*/
package
com
.
pcloud
.
common
.
core
.
dto
;
import
java.io.Serializable
;
import
java.util.List
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.ToString
;
/**
* @author:songx
* @date:2018年5月17日,下午4:27:26
*/
@Getter
@Setter
@ToString
(
callSuper
=
true
)
public
class
KnowledgeUseMQDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
6111501255761694004L
;
/**
* 知识点标签
*/
private
List
<
Long
>
knowledgeIds
;
public
KnowledgeUseMQDTO
()
{
}
public
KnowledgeUseMQDTO
(
List
<
Long
>
knowledgeIds
)
{
this
.
knowledgeIds
=
knowledgeIds
;
}
}
pcloud-common-core/src/main/java/com/pcloud/common/core/dto/SendMessageDto.java
View file @
59cf09ff
...
@@ -30,6 +30,11 @@ public class SendMessageDto implements Serializable{
...
@@ -30,6 +30,11 @@ public class SendMessageDto implements Serializable{
*/
*/
private
Map
<
String
,
String
>
paramKeyMap
;
private
Map
<
String
,
String
>
paramKeyMap
;
/**
* 区号
*/
private
String
phoneAreaCode
;
public
String
getSmsTemplateCode
()
{
public
String
getSmsTemplateCode
()
{
return
smsTemplateCode
;
return
smsTemplateCode
;
}
}
...
@@ -49,12 +54,21 @@ public class SendMessageDto implements Serializable{
...
@@ -49,12 +54,21 @@ public class SendMessageDto implements Serializable{
this
.
paramKeyMap
=
paramKeyMap
;
this
.
paramKeyMap
=
paramKeyMap
;
}
}
public
String
getPhoneAreaCode
()
{
return
phoneAreaCode
;
}
public
void
setPhoneAreaCode
(
String
phoneAreaCode
)
{
this
.
phoneAreaCode
=
phoneAreaCode
;
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"SendMessageDto{"
+
return
"SendMessageDto{"
+
"smsTemplateCode='"
+
smsTemplateCode
+
'\''
+
"smsTemplateCode='"
+
smsTemplateCode
+
'\''
+
", phoneNumber='"
+
phoneNumber
+
'\''
+
", phoneNumber='"
+
phoneNumber
+
'\''
+
", paramKeyMap="
+
paramKeyMap
+
", paramKeyMap="
+
paramKeyMap
+
", phoneAreaCode='"
+
phoneAreaCode
+
'\''
+
'}'
;
'}'
;
}
}
...
...
pcloud-common-core/src/main/java/com/pcloud/common/core/enums/AppProductTypeEnum.java
View file @
59cf09ff
...
@@ -2,10 +2,10 @@ package com.pcloud.common.core.enums;
...
@@ -2,10 +2,10 @@ package com.pcloud.common.core.enums;
import
com.pcloud.common.core.constant.ProductTypeConstant
;
import
com.pcloud.common.core.constant.ProductTypeConstant
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.enums.AppTypeEnum
;
/**
/**
* Description 应用作品类型关联枚举
* Description 应用作品类型关联枚举 Created by PENG on 2019/3/27.
* Created by PENG on 2019/3/27.
*/
*/
public
enum
AppProductTypeEnum
{
public
enum
AppProductTypeEnum
{
...
@@ -50,6 +50,7 @@ public enum AppProductTypeEnum {
...
@@ -50,6 +50,7 @@ public enum AppProductTypeEnum {
/**
/**
* 根据应用类型编码获取作品类型编码
* 根据应用类型编码获取作品类型编码
*
* @param appTypeCode 应用类型编码
* @param appTypeCode 应用类型编码
* @return
* @return
*/
*/
...
@@ -70,6 +71,7 @@ public enum AppProductTypeEnum {
...
@@ -70,6 +71,7 @@ public enum AppProductTypeEnum {
/**
/**
* 根据作品类型编码获取应用类型编码
* 根据作品类型编码获取应用类型编码
*
* @param productTypeCode 作品类型编码
* @param productTypeCode 作品类型编码
* @return
* @return
*/
*/
...
@@ -91,12 +93,15 @@ public enum AppProductTypeEnum {
...
@@ -91,12 +93,15 @@ public enum AppProductTypeEnum {
/**
/**
* 会员应用可设置会员免费的作品类型
* 会员应用可设置会员免费的作品类型
*/
*/
public
static
final
String
[]
MEMBER_INCLUDE_PRODUCT_TYPE
=
{
ProductTypeConstant
.
PDF
,
ProductTypeConstant
.
AUDIO
,
ProductTypeConstant
.
VIDEO
,
ProductTypeConstant
.
PRETEST
,
ProductTypeConstant
.
ARTICLE
,
public
static
final
String
[]
MEMBER_INCLUDE_PRODUCT_TYPE
=
{
ProductTypeConstant
.
PDF
,
ProductTypeConstant
.
AUDIO
,
ProductTypeConstant
.
FORMAT
,
ProductTypeConstant
.
ALBUM
,
ProductTypeConstant
.
BOOK
,
ProductTypeConstant
.
EBOOK
,
ProductTypeConstant
.
VIDEO_SCHEDULE
};
ProductTypeConstant
.
VIDEO
,
ProductTypeConstant
.
PRETEST
,
ProductTypeConstant
.
ARTICLE
,
ProductTypeConstant
.
FORMAT
,
ProductTypeConstant
.
ALBUM
,
ProductTypeConstant
.
BOOK
,
ProductTypeConstant
.
EBOOK
,
ProductTypeConstant
.
VIDEO_SCHEDULE
};
/**
/**
* 会员应用可设置会员免费的应用类型
* 会员应用可设置会员免费的应用类型
*/
*/
public
static
final
String
[]
MEMBER_INCLUDE_APP_TYPE
=
{
AppTypeEnum
.
ANSWER
.
value
,
AppTypeEnum
.
ITEM_BANK
.
value
,
AppTypeEnum
.
EBOOK
.
value
,
AppTypeEnum
.
TEACH_RESOURCE
.
value
,
AppTypeEnum
.
COURSE_WARE
.
value
,
public
static
final
String
[]
MEMBER_INCLUDE_APP_TYPE
=
{
AppTypeEnum
.
ANSWER
.
value
,
AppTypeEnum
.
ITEM_BANK
.
value
,
AppTypeEnum
.
EBOOK
.
value
,
AppTypeEnum
.
TEACH_RESOURCE
.
value
,
AppTypeEnum
.
COURSE_WARE
.
value
,
AppTypeEnum
.
TEST_PAPER
.
value
};
AppTypeEnum
.
TEST_PAPER
.
value
};
}
}
pcloud-common-core/src/main/java/com/pcloud/common/core/enums/TempletCodeEnum.java
View file @
59cf09ff
package
com
.
pcloud
.
common
.
core
.
enums
;
package
com
.
pcloud
.
common
.
core
.
enums
;
import
com.pcloud.common.enums.AppTypeEnum
;
/**
/**
* @描述:
* @描述:
* @作者:songx
*
* @创建时间:20"1"7年"1"0月3"1"日,上午"1""1":45:58
* @作者:songx @创建时间:20"1"7年"1"0月3"1"日,上午"1""1":45:58 @版本:"1".0
* @版本:"1".0
*/
*/
public
enum
TempletCodeEnum
{
public
enum
TempletCodeEnum
{
K12
(
"K12教辅(试卷类)"
,
new
String
[][]
{
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
GROUP
.
name
(),
"1"
},
K12
(
"K12教辅(试卷类)"
,
new
String
[][]
{
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
GROUP
.
name
(),
"1"
},
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
ZSCORE
.
name
(),
"1"
},
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
ZSCORE
.
name
(),
"1"
},
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
QA
.
name
(),
"1"
},
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
QA
.
name
(),
"1"
},
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
PDF
.
name
(),
"1"
}
}),
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
PDF
.
name
(),
"1"
}
}),
PUBLIC_PROSE
(
"大众类散文随笔诗歌"
,
new
String
[][]
{
PUBLIC_PROSE
(
"大众类散文随笔诗歌"
,
new
String
[][]
{
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
GROUP
.
name
(),
"1"
}
}),
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
GROUP
.
name
(),
"1"
}
}),
PUBLIC_JOURNAL
(
"大众类期刊"
,
new
String
[][]
{
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
FORMAT
.
name
(),
"1"
},
PUBLIC_JOURNAL
(
"大众类期刊"
,
new
String
[][]
{
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
FORMAT
.
name
(),
"1"
},
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
GROUP
.
name
(),
"1"
}
}),
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
GROUP
.
name
(),
"1"
}
}),
...
@@ -25,7 +26,8 @@ public enum TempletCodeEnum {
...
@@ -25,7 +26,8 @@ public enum TempletCodeEnum {
SINOLOGY
(
"国学类图书(18+)"
,
new
String
[][]
{
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
GROUP
.
name
(),
"1"
},
SINOLOGY
(
"国学类图书(18+)"
,
new
String
[][]
{
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
GROUP
.
name
(),
"1"
},
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
PDF
.
name
(),
"1"
}
}),
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
PDF
.
name
(),
"1"
}
}),
VACATION
(
"假期作业"
,
new
String
[][]
{
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
GROUP
.
name
(),
"1"
},
VACATION
(
"假期作业"
,
new
String
[][]
{
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
GROUP
.
name
(),
"1"
},
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
SPECIAL
.
name
(),
"1"
},
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
SPECIAL
.
name
(),
"1"
},
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
PDF
.
name
(),
"1"
},
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
PDF
.
name
(),
"1"
},
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
PRETEST
.
name
(),
"1"
}
}),
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
PRETEST
.
name
(),
"1"
}
}),
...
@@ -33,15 +35,18 @@ public enum TempletCodeEnum {
...
@@ -33,15 +35,18 @@ public enum TempletCodeEnum {
MILITARY
(
"军事历史类图书"
,
new
String
[][]
{
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
GROUP
.
name
(),
"1"
},
MILITARY
(
"军事历史类图书"
,
new
String
[][]
{
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
GROUP
.
name
(),
"1"
},
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
AUDIO
.
name
(),
"1"
}
}),
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
AUDIO
.
name
(),
"1"
}
}),
IMPORTED_HIGER
(
"教材教辅类(高中)图书"
,
new
String
[][]
{
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
GROUP
.
name
(),
"1"
},
IMPORTED_HIGER
(
"教材教辅类(高中)图书"
,
new
String
[][]
{
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
GROUP
.
name
(),
"1"
},
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
PDF
.
name
(),
"1"
},
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
PDF
.
name
(),
"1"
},
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
PDF
.
name
(),
"2"
}
}),
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
PDF
.
name
(),
"2"
}
}),
IMPORTED_SMALL
(
"教材教辅类(小学初中)图书"
,
new
String
[][]
{
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
GROUP
.
name
(),
"1"
},
IMPORTED_SMALL
(
"教材教辅类(小学初中)图书"
,
new
String
[][]
{
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
GROUP
.
name
(),
"1"
},
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
PDF
.
name
(),
"1"
},
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
PDF
.
name
(),
"1"
},
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
PDF
.
name
(),
"2"
}
}),
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
PDF
.
name
(),
"2"
}
}),
GERIATRIC
(
"老年大学教材"
,
new
String
[][]
{
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
GROUP
.
name
(),
"1"
},
GERIATRIC
(
"老年大学教材"
,
new
String
[][]
{
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
GROUP
.
name
(),
"1"
},
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
AUDIO
.
name
(),
"1"
},
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
AUDIO
.
name
(),
"1"
},
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
VIDEO
.
name
(),
"1"
}
}),
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
VIDEO
.
name
(),
"1"
}
}),
...
@@ -51,7 +56,8 @@ public enum TempletCodeEnum {
...
@@ -51,7 +56,8 @@ public enum TempletCodeEnum {
CELEBRITY
(
"名人传记类图书"
,
new
String
[][]
{
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
GROUP
.
name
(),
"1"
},
CELEBRITY
(
"名人传记类图书"
,
new
String
[][]
{
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
GROUP
.
name
(),
"1"
},
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
ALBUM
.
name
(),
"1"
}
}),
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
ALBUM
.
name
(),
"1"
}
}),
CHILD_PUFFIN
(
"少儿读物类图书"
,
new
String
[][]
{
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
GROUP
.
name
(),
"1"
},
CHILD_PUFFIN
(
"少儿读物类图书"
,
new
String
[][]
{
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
GROUP
.
name
(),
"1"
},
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
AUDIO
.
name
(),
"1"
},
{
PcloudTypeEnum
.
PRODUCT
.
name
(),
ProductTypeEnum
.
AUDIO
.
name
(),
"1"
},
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
KK
.
name
(),
"1"
}
}),
{
PcloudTypeEnum
.
APP
.
name
(),
AppTypeEnum
.
KK
.
name
(),
"1"
}
}),
...
...
pcloud-common/src/main/java/com/pcloud/common/config/Application.java
0 → 100644
View file @
59cf09ff
package
com
.
pcloud
.
common
.
config
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
/**
* @Author: songx
* @Date: 2019年07月11日, 14:11
*/
@Component
public
class
Application
{
/**
* 应用名称
*/
public
static
String
APP_NAME
;
@Value
(
"${spring.application.name}"
)
public
void
setAppName
(
String
appName
)
{
this
.
APP_NAME
=
appName
;
}
}
pcloud-common/src/main/java/com/pcloud/common/constant/AppTypeConstant.java
0 → 100644
View file @
59cf09ff
/**
*
*/
package
com
.
pcloud
.
common
.
constant
;
import
com.pcloud.common.enums.AppTypeEnum
;
/**
*
*
* @author:songx
* @date:2018年1月10日,下午2:58:42
*/
public
class
AppTypeConstant
{
/**
* 含有销售价的应用(创建修改同步操作资源中心)
*/
public
static
final
String
[]
PRICE_APP
=
{
AppTypeEnum
.
TEACH_RESOURCE
.
value
,
AppTypeEnum
.
COURSE_WARE
.
value
,
AppTypeEnum
.
STROKE_ORDER
.
value
,
AppTypeEnum
.
IMAGE
.
value
,
AppTypeEnum
.
RECITE_WORD
.
value
};
/**
* 其它服务的含有销售价的应用
*/
public
static
final
String
[]
REMOTE_PRICE_APP
=
{
AppTypeEnum
.
MATCH_LISTEN
.
value
,
AppTypeEnum
.
WORD_DICTATION
.
value
,
AppTypeEnum
.
ARTICLE_READING
.
value
,
AppTypeEnum
.
ENGLISH_WALKMAN
.
value
,
AppTypeEnum
.
ORAL_EVALUATION
.
value
,
AppTypeEnum
.
PBSTORY
.
value
};
/**
* 自建码包含的应用类型
*/
public
static
final
String
[]
IS_ALI_TYPE_APP
=
{
AppTypeEnum
.
ANSWER
.
value
,
AppTypeEnum
.
TEACH_RESOURCE
.
value
,
AppTypeEnum
.
COURSE_WARE
.
value
,
AppTypeEnum
.
PDF
.
value
,
AppTypeEnum
.
TEST_PAPER
.
value
,
AppTypeEnum
.
SUBJECTNOTE
.
value
,
AppTypeEnum
.
STROKE_ORDER
.
value
,
AppTypeEnum
.
EBOOK
.
value
,
AppTypeEnum
.
IMAGE
.
value
,
AppTypeEnum
.
ARTICLE
.
value
,
AppTypeEnum
.
BOOK
.
value
,
AppTypeEnum
.
LIVE_TIMETABLE
.
value
,
AppTypeEnum
.
AUDIO
.
value
,
AppTypeEnum
.
VIDEO
.
value
,
AppTypeEnum
.
MATCH_LISTEN
.
value
,
AppTypeEnum
.
WORD_DICTATION
.
value
,
AppTypeEnum
.
GROUP
.
value
,
AppTypeEnum
.
ITEM_BANK
.
value
,
AppTypeEnum
.
DRAW
.
value
};
}
pcloud-common/src/main/java/com/pcloud/common/constant/CacheConstant.java
View file @
59cf09ff
...
@@ -152,4 +152,9 @@ public class CacheConstant {
...
@@ -152,4 +152,9 @@ public class CacheConstant {
*/
*/
public
static
final
String
EDUCATIONFORM
=
"EDUCATIONFORM:"
;
public
static
final
String
EDUCATIONFORM
=
"EDUCATIONFORM:"
;
/**
* 微信群
*/
public
static
final
String
WECHAT_GROUP
=
"WECHATGROUP:"
;
}
}
pcloud-common/src/main/java/com/pcloud/common/constant/FilePathConstant.java
0 → 100644
View file @
59cf09ff
/*
* 武汉理工数字传播工程有限公司源代码,版权归武汉理工数字传播工程有限公司所有.
* 项目名称 : pcloud-common
* 创建日期 : 2017年3月3日
* 修改历史 :
* 1. [2017年3月3日]创建文件 by xnxqs
*/
package
com
.
pcloud
.
common
.
constant
;
/**
*
*
* @Author: songx
* @Date: 2019/7/29,14:11
*/
public
class
FilePathConstant
{
/**
* 视频剪切文件夹
*/
public
final
static
String
CUT
=
getFolder
(
"cut"
);
/**
* 下载文件夹
*/
public
final
static
String
DOWNLOAD
=
getFolder
(
"download"
);
/**
* 生成图片地址
*/
public
final
static
String
IMAGE
=
getFolder
(
"image"
);
/**
* 生成带水印文件夹
*/
public
final
static
String
IMAGE_WATERMARK
=
getFolder
(
"image/watermark"
);
/**
* 生成音频文件夹
*/
public
final
static
String
AUDIO
=
getFolder
(
"audio"
);
/**
* 生成PDF文件夹
*/
public
final
static
String
PDF
=
getFolder
(
"pdf"
);
/**
* 生成WORD文件夹
*/
public
final
static
String
WORD
=
getFolder
(
"word"
);
/**
* 生成TEXT文件夹
*/
public
final
static
String
TEXT
=
getFolder
(
"text"
);
/**
* 组装文件夹路径
*
* @param folderName
* @return
*/
private
static
String
getFolder
(
String
folderName
)
{
return
OSConstant
.
USERDIR
+
OSConstant
.
SEPARATOR
+
"files"
+
folderName
+
OSConstant
.
SEPARATOR
;
}
}
pcloud-common/src/main/java/com/pcloud/common/dto/ResponseDto.java
View file @
59cf09ff
package
com
.
pcloud
.
common
.
dto
;
package
com
.
pcloud
.
common
.
dto
;
import
java.io.Serializable
;
import
com.alibaba.fastjson.JSON
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonInclude.Include
;
import
com.fasterxml.jackson.annotation.JsonInclude.Include
;
import
java.io.Serializable
;
/**
/**
* @描述:服务响应实体类
* @描述:服务响应实体类
* @作者:shichunshan
* @作者:shichunshan
...
@@ -44,6 +45,26 @@ public class ResponseDto<T> implements Serializable {
...
@@ -44,6 +45,26 @@ public class ResponseDto<T> implements Serializable {
private
T
data
;
private
T
data
;
/**
/**
* 生产者名称
*/
private
String
produceAppName
;
/**
* 生产者IP
*/
private
String
produceIp
;
/**
* 生产者类名
*/
private
String
produceClassName
;
/**
* 生产者方法名
*/
private
String
produceMethodName
;
/**
* 默认成功
* 默认成功
*/
*/
public
ResponseDto
()
{
public
ResponseDto
()
{
...
@@ -110,9 +131,41 @@ public class ResponseDto<T> implements Serializable {
...
@@ -110,9 +131,41 @@ public class ResponseDto<T> implements Serializable {
this
.
data
=
data
;
this
.
data
=
data
;
}
}
public
String
getProduceAppName
()
{
return
produceAppName
;
}
public
void
setProduceAppName
(
String
produceAppName
)
{
this
.
produceAppName
=
produceAppName
;
}
public
String
getProduceClassName
()
{
return
produceClassName
;
}
public
void
setProduceClassName
(
String
produceClassName
)
{
this
.
produceClassName
=
produceClassName
;
}
public
String
getProduceMethodName
()
{
return
produceMethodName
;
}
public
void
setProduceMethodName
(
String
produceMethodName
)
{
this
.
produceMethodName
=
produceMethodName
;
}
public
String
getProduceIp
()
{
return
produceIp
;
}
public
void
setProduceIp
(
String
produceIp
)
{
this
.
produceIp
=
produceIp
;
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"ResponseDto [errCode="
+
errCode
+
", message="
+
message
+
", data="
+
data
+
"]"
;
return
"ResponseDto -> "
+
JSON
.
toJSONString
(
this
)
;
}
}
}
}
pcloud-common/src/main/java/com/pcloud/common/dto/StoreFlowInfoDto.java
0 → 100644
View file @
59cf09ff
package
com
.
pcloud
.
common
.
dto
;
import
java.math.BigDecimal
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @Describe: TODO
* @Author: zhangdongwei
* @Date: Create on 11:35 2019/7/24 0024
*/
@ApiModel
(
"商城信息流信息dto"
)
public
class
StoreFlowInfoDto
extends
BaseDto
{
/**
* 标识(appId/productId/bookGroupId)
*/
@ApiModelProperty
(
"标识(appId/productId/bookGroupId)"
)
private
Long
originId
;
/**
* 类型(APP/PRODUCT/BOOK_GROUP)
*/
@ApiModelProperty
(
"类型(APP/PRODUCT/BOOK_GROUP)"
)
private
String
originType
;
/**
* 具体类型编码
*/
@ApiModelProperty
(
"具体类型"
)
private
String
typeCode
;
/**
* 具体类型名称
*/
private
String
typeName
;
/**
* 标题
*/
@ApiModelProperty
(
"标题"
)
private
String
title
;
/**
* 封面图片
*/
@ApiModelProperty
(
"封面图片"
)
private
String
coverImg
;
/**
* 大图
*/
@ApiModelProperty
(
"大图"
)
private
String
bigImg
;
/**
* 价格
*/
@ApiModelProperty
(
"价格"
)
private
BigDecimal
price
;
/**
* 最早开始时间(MM-dd)
*/
@ApiModelProperty
(
"开始时间(MM-dd)"
)
private
String
startDateBegin
;
/**
* 最晚开始时间(MM-dd)
*/
@ApiModelProperty
(
"最晚开始时间(MM-dd)"
)
private
String
startDateEnd
;
/**
* 数量(应用、作品下的资源数量, 社群书的群数量,等)
*/
@ApiModelProperty
(
"数量(应用、作品下的资源数量, 社群书的群数量,等)"
)
private
Integer
resourceNum
;
/**
* 数量(资源的item数量,群的成员数量,等)
*/
@ApiModelProperty
(
"数量(资源的item数量,群的成员数量,等)"
)
private
Integer
resourceItemNum
;
/**
* 讲师
*/
@ApiModelProperty
(
"讲师"
)
private
String
lecturer
;
/**
* 讲师头像
*/
@ApiModelProperty
(
"讲师头像"
)
private
String
lecturerImg
;
public
Long
getOriginId
()
{
return
originId
;
}
public
void
setOriginId
(
Long
originId
)
{
this
.
originId
=
originId
;
}
public
String
getOriginType
()
{
return
originType
;
}
public
void
setOriginType
(
String
originType
)
{
this
.
originType
=
originType
;
}
public
String
getTypeCode
()
{
return
typeCode
;
}
public
void
setTypeCode
(
String
typeCode
)
{
this
.
typeCode
=
typeCode
;
}
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getCoverImg
()
{
return
coverImg
;
}
public
void
setCoverImg
(
String
coverImg
)
{
this
.
coverImg
=
coverImg
;
}
public
String
getBigImg
()
{
return
bigImg
;
}
public
void
setBigImg
(
String
bigImg
)
{
this
.
bigImg
=
bigImg
;
}
public
BigDecimal
getPrice
()
{
return
price
;
}
public
void
setPrice
(
BigDecimal
price
)
{
this
.
price
=
price
;
}
public
Integer
getResourceNum
()
{
return
resourceNum
;
}
public
void
setResourceNum
(
Integer
resourceNum
)
{
this
.
resourceNum
=
resourceNum
;
}
public
Integer
getResourceItemNum
()
{
return
resourceItemNum
;
}
public
void
setResourceItemNum
(
Integer
resourceItemNum
)
{
this
.
resourceItemNum
=
resourceItemNum
;
}
public
String
getLecturer
()
{
return
lecturer
;
}
public
void
setLecturer
(
String
lecturer
)
{
this
.
lecturer
=
lecturer
;
}
public
String
getTypeName
()
{
return
typeName
;
}
public
void
setTypeName
(
String
typeName
)
{
this
.
typeName
=
typeName
;
}
public
String
getLecturerImg
()
{
return
lecturerImg
;
}
public
void
setLecturerImg
(
String
lecturerImg
)
{
this
.
lecturerImg
=
lecturerImg
;
}
public
String
getStartDateBegin
()
{
return
startDateBegin
;
}
public
void
setStartDateBegin
(
String
startDateBegin
)
{
this
.
startDateBegin
=
startDateBegin
;
}
public
String
getStartDateEnd
()
{
return
startDateEnd
;
}
public
void
setStartDateEnd
(
String
startDateEnd
)
{
this
.
startDateEnd
=
startDateEnd
;
}
@Override
public
String
toString
()
{
return
"StoreFlowInfoDto{"
+
"originId="
+
originId
+
", originType='"
+
originType
+
'\''
+
", typeCode='"
+
typeCode
+
'\''
+
", typeName='"
+
typeName
+
'\''
+
", title='"
+
title
+
'\''
+
", coverImg='"
+
coverImg
+
'\''
+
", bigImg='"
+
bigImg
+
'\''
+
", price="
+
price
+
", startDateBegin='"
+
startDateBegin
+
'\''
+
", startDateEnd='"
+
startDateEnd
+
'\''
+
", resourceNum="
+
resourceNum
+
", resourceItemNum="
+
resourceItemNum
+
", lecturer='"
+
lecturer
+
'\''
+
", lecturerImg='"
+
lecturerImg
+
'\''
+
'}'
;
}
}
pcloud-common/src/main/java/com/pcloud/common/dto/StoreMyPayDto.java
0 → 100644
View file @
59cf09ff
package
com
.
pcloud
.
common
.
dto
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @Describe: 商城用户已购买的应用或作品dto
* @Author: zhangdongwei
* @Date: Create on 18:16 2019/8/7 0007
*/
@ApiModel
(
"商城用户已购买的应用或作品dto"
)
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
StoreMyPayDto
{
/**
* 标识(appId/productId/bookGroupId)
*/
@ApiModelProperty
(
"标识(appId/productId/bookGroupId)"
)
private
Long
originId
;
/**
* 类型(APP/PRODUCT/BOOK_GROUP)
*/
@ApiModelProperty
(
"类型(APP/PRODUCT/BOOK_GROUP)"
)
private
String
originType
;
/**
* 具体类型编码
*/
@ApiModelProperty
(
"具体类型"
)
private
String
typeCode
;
/**
* 具体类型名称
*/
private
String
typeName
;
/**
* 标题
*/
@ApiModelProperty
(
"标题"
)
private
String
originName
;
/**
* 封面图片
*/
@ApiModelProperty
(
"封面图片"
)
private
String
coverImg
;
/**
* 简介
*/
@ApiModelProperty
(
"简介"
)
private
String
description
;
/**
* 价格
*/
@ApiModelProperty
(
"价格"
)
private
BigDecimal
price
;
/**
* 是否支持单节购买
*/
@ApiModelProperty
(
"是否支持单节购买"
)
private
Integer
isSaleOne
;
/**
* 已经购买的资源数量
*/
@ApiModelProperty
(
"已经购买的资源数量"
)
private
Integer
resourceNum
;
/**
* 购买时间
*/
@ApiModelProperty
(
"购买时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
payTime
;
/**
*总课时数
*/
@ApiModelProperty
(
"总课时数"
)
private
Integer
totalCourseNum
;
/**
* 已开课节数
*/
@ApiModelProperty
(
"已开课节数"
)
private
Integer
openCourseNum
;
/**
* 用户已打卡天数
*/
@ApiModelProperty
(
"用户已打卡天数"
)
private
Integer
clockDayNum
;
@ApiModelProperty
(
"会员有效期天数"
)
private
Long
overDay
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"开始时间"
)
private
Date
createTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
"结束时间"
)
private
Date
endTime
;
public
Long
getOriginId
()
{
return
originId
;
}
public
void
setOriginId
(
Long
originId
)
{
this
.
originId
=
originId
;
}
public
String
getOriginType
()
{
return
originType
;
}
public
void
setOriginType
(
String
originType
)
{
this
.
originType
=
originType
;
}
public
String
getTypeCode
()
{
return
typeCode
;
}
public
void
setTypeCode
(
String
typeCode
)
{
this
.
typeCode
=
typeCode
;
}
public
String
getTypeName
()
{
return
typeName
;
}
public
void
setTypeName
(
String
typeName
)
{
this
.
typeName
=
typeName
;
}
public
String
getOriginName
()
{
return
originName
;
}
public
void
setOriginName
(
String
originName
)
{
this
.
originName
=
originName
;
}
public
String
getCoverImg
()
{
return
coverImg
;
}
public
void
setCoverImg
(
String
coverImg
)
{
this
.
coverImg
=
coverImg
;
}
public
BigDecimal
getPrice
()
{
return
price
;
}
public
void
setPrice
(
BigDecimal
price
)
{
this
.
price
=
price
;
}
public
Integer
getIsSaleOne
()
{
return
isSaleOne
;
}
public
void
setIsSaleOne
(
Integer
isSaleOne
)
{
this
.
isSaleOne
=
isSaleOne
;
}
public
Integer
getResourceNum
()
{
return
resourceNum
;
}
public
void
setResourceNum
(
Integer
resourceNum
)
{
this
.
resourceNum
=
resourceNum
;
}
public
Date
getPayTime
()
{
return
payTime
;
}
public
void
setPayTime
(
Date
payTime
)
{
this
.
payTime
=
payTime
;
}
public
Integer
getTotalCourseNum
()
{
return
totalCourseNum
;
}
public
void
setTotalCourseNum
(
Integer
totalCourseNum
)
{
this
.
totalCourseNum
=
totalCourseNum
;
}
public
Integer
getOpenCourseNum
()
{
return
openCourseNum
;
}
public
void
setOpenCourseNum
(
Integer
openCourseNum
)
{
this
.
openCourseNum
=
openCourseNum
;
}
public
Integer
getClockDayNum
()
{
return
clockDayNum
;
}
public
void
setClockDayNum
(
Integer
clockDayNum
)
{
this
.
clockDayNum
=
clockDayNum
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
Long
getOverDay
()
{
return
overDay
;
}
public
void
setOverDay
(
Long
overDay
)
{
this
.
overDay
=
overDay
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getEndTime
()
{
return
endTime
;
}
public
void
setEndTime
(
Date
endTime
)
{
this
.
endTime
=
endTime
;
}
@Override
public
String
toString
()
{
return
"StoreMyPayDto{"
+
"originId="
+
originId
+
", originType='"
+
originType
+
'\''
+
", typeCode='"
+
typeCode
+
'\''
+
", typeName='"
+
typeName
+
'\''
+
", originName='"
+
originName
+
'\''
+
", coverImg='"
+
coverImg
+
'\''
+
", description='"
+
description
+
'\''
+
", price="
+
price
+
", isSaleOne="
+
isSaleOne
+
", resourceNum="
+
resourceNum
+
", payTime="
+
payTime
+
", totalCourseNum="
+
totalCourseNum
+
", openCourseNum="
+
openCourseNum
+
", clockDayNum="
+
clockDayNum
+
", overDay="
+
overDay
+
", createTime="
+
createTime
+
", endTime="
+
endTime
+
'}'
;
}
}
pcloud-common/src/main/java/com/pcloud/common/enums/AppRouteEnum.java
0 → 100644
View file @
59cf09ff
package
com
.
pcloud
.
common
.
enums
;
/**
* 应用类型路由
*
* @Author: songx
* @Date: 2019/7/2,10:15
*/
public
enum
AppRouteEnum
{
/**
* 一对一辅导
*/
CC
(
"cc"
,
AppTypeEnum
.
TUTOR
.
value
),
/**
* 圈子
*/
GROUP
(
"group"
,
AppTypeEnum
.
GROUP
.
value
),
/**
* 扫扫看
*/
KK
(
"kk"
,
AppTypeEnum
.
KK
.
value
),
/**
* 专题
*/
ST
(
"st"
,
AppTypeEnum
.
SPECIAL
.
value
),
/**
* 背单词
*/
WD
(
"wd"
,
AppTypeEnum
.
RECITE_WORD
.
value
),
/**
* 数据采集/问卷调查
*/
QN
(
"qn"
,
AppTypeEnum
.
DA
.
value
),
/**
* 报名
*/
REPLY_SCENE
(
"mt"
,
AppTypeEnum
.
BM
.
value
),
/**
* 投票
*/
VT
(
"vt"
,
AppTypeEnum
.
VOTE
.
value
),
/**
* 题库
*/
PRETEST
(
"pretest"
,
AppTypeEnum
.
ITEM_BANK
.
value
),
/**
* 标准分
*/
ZSCORE
(
"zscore"
,
AppTypeEnum
.
ZSCORE
.
value
),
/**
* 读书卡片
*/
BOOKCARD
(
"card"
,
AppTypeEnum
.
BOOKCARD
.
value
),
/**
* 教育表格
*/
TB
(
"tb"
,
AppTypeEnum
.
EF
.
value
),
/**
* 直播
*/
LIVE
(
"live"
,
AppTypeEnum
.
LIVE_TIMETABLE
.
value
),
/**
* 打卡
*/
CLOCK
(
"clock"
,
AppTypeEnum
.
CLOCK
.
value
),
/**
* 伴读魔法箱
*/
AUDIO_MAGIC
(
"magic"
,
AppTypeEnum
.
AUDIO_MAGIC
.
value
),
/**
* 课件
*/
COURSE_WARE
(
"cw"
,
AppTypeEnum
.
COURSE_WARE
.
value
),
/**
* 读者反馈
*/
NAIRE
(
"qn"
,
AppTypeEnum
.
NAIRE
.
value
),
/**
* 互动墙
*/
INTERACT
(
"interact"
,
AppTypeEnum
.
INTERACT
.
value
),
/**
* 抽奖
*/
DRAW
(
"luck"
,
AppTypeEnum
.
DRAW
.
value
),
/**
* 教辅资料包
*/
TEACH_RESOURCE
(
"tr"
,
AppTypeEnum
.
TEACH_RESOURCE
.
value
),
/**
* 测试工具
*/
TEST
(
"tt"
,
AppTypeEnum
.
TEST
.
value
),
/**
* 愿望单
*/
WISH
(
"wish"
,
AppTypeEnum
.
WISH
.
value
),
/**
* 笔顺动图
*/
STROKE_ORDER
(
"pen"
,
AppTypeEnum
.
STROKE_ORDER
.
value
),
/**
* 生词听写
*/
WORD_DICTATION
(
"dictation"
,
AppTypeEnum
.
WORD_DICTATION
.
value
),
/**
* 配套听力
*/
MATCH_LISTEN
(
"mv"
,
AppTypeEnum
.
MATCH_LISTEN
.
value
),
/**
* 开通会员
*/
MEMBER
(
"member"
,
AppTypeEnum
.
MEMBER
.
value
),
/**
* 课文诵读
*/
ARTICLE_READING
(
"ar"
,
AppTypeEnum
.
ARTICLE_READING
.
value
),
/**
* 英语随身听
*/
ENGLISH_WALKMAN
(
"wm"
,
AppTypeEnum
.
ENGLISH_WALKMAN
.
value
),
/**
* 口语评测
*/
ORAL_EVALUATION
(
"speak"
,
AppTypeEnum
.
ORAL_EVALUATION
.
value
),
/**
* 绘本故事
*/
PBSTORY
(
"pbstory"
,
AppTypeEnum
.
PBSTORY
.
value
),
/**
* 错题本
*/
SUBJECTNOTE
(
"subject"
,
AppTypeEnum
.
SUBJECTNOTE
.
value
);
/**
* 值
*/
public
final
String
value
;
/**
* 对应的类型编码
*/
public
String
typeCode
;
/**
* 构造
*
* @param value
*/
private
AppRouteEnum
(
String
value
,
String
typeCode
)
{
this
.
value
=
value
;
this
.
typeCode
=
typeCode
;
}
}
pcloud-common/src/main/java/com/pcloud/common/enums/AppTypeEnum.java
View file @
59cf09ff
...
@@ -15,64 +15,78 @@ import com.google.common.collect.Maps;
...
@@ -15,64 +15,78 @@ import com.google.common.collect.Maps;
*/
*/
public
enum
AppTypeEnum
{
public
enum
AppTypeEnum
{
MASTER
(
"MASTER"
),
// 主应用
/**
RECOMMEND
(
"RECOMMEND"
),
// 推荐应用
* 应用分类
CHARGE
(
"CHARGE"
),
// 付费应用
*/
MASTER
(
"MASTER"
,
"主应用"
),
RECOMMEND
(
"RECOMMEND"
,
"推荐应用"
),
CHARGE
(
"CHARGE"
,
"付费应用"
),
ARTICLE
(
"ARTICLE"
),
// 文章
ARTICLE
(
"ARTICLE"
,
"文章"
),
KK
(
"KK"
),
// 看一看
KK
(
"KK"
,
" 看一看"
),
LIVE
(
"LIVE"
),
// 直播
LIVE
(
"LIVE"
,
"直播"
),
VOTE
(
"VOTE"
),
// 投票
VOTE
(
"VOTE"
,
"投票"
),
ENROLL
(
"ENROLL"
),
// 编创赛报名
ENROLL
(
"ENROLL"
,
"编创赛报名"
),
BM
(
"BM"
),
// 报名
BM
(
"BM"
,
"报名"
),
NAIRE
(
"NAIRE"
),
// 问卷调查
NAIRE
(
"NAIRE"
,
"问卷调查"
),
DA
(
"DA"
),
// 数据采集
BOOKCARD
(
"BOOKCARD"
,
"读书卡片"
),
BOOKCARD
(
"BOOKCARD"
),
// 读书卡片
TUTOR
(
"TUTOR"
,
"一对一辅导"
),
TUTOR
(
"TUTOR"
),
// 一对一辅导
GROUP
(
"GROUP"
),
// 与你同行(圈子)(add by gaop at 2017-6-13 16:52:07)
/**
ITEM_BANK
(
"ITEM_BANK"
),
// 题库
* 该类型应用已删除
VOICE_MSG
(
"VOICE_MSG"
),
// 语音留言
*/
AUDIO
(
"AUDIO"
),
// 音频
DA
(
"DA"
,
"数据采集"
),
VIDEO
(
"VIDEO"
),
// 视频
IMAGE
(
"IMAGE"
),
// 图片
PDF
(
"PDF"
),
// PDF
BOOK
(
"BOOK"
),
// 图书
EF
(
"EF"
),
// 教育表格
QA
(
"QA"
),
// 问答
LISTEN
(
"LISTEN"
),
// 听力
ANSWER
(
"ANSWER"
),
// 答案
ACTIVITY
(
"ACTIVITY"
),
// 分享互动
ZSCORE
(
"ZSCORE"
),
// 标准分
RECITE_WORD
(
"RECITE_WORD"
),
// 背单词
INTERACT
(
"INTERACT"
),
// 互动墙
SPECIAL
(
"SPECIAL"
),
// 专题
CLOCK
(
"CLOCK"
),
// 打卡
TEST
(
"TEST"
),
// 趣味测试(测试工具)
EBOOK
(
"EBOOK"
),
// 电子书
LIVE_TIMETABLE
(
"LIVE_TIMETABLE"
),
// 直播课表
DRAW
(
"DRAW"
),
// 抽奖
WISH
(
"WISH"
),
// 愿望单
LIVEAPP
(
"LIVEAPP"
),
//直播3.0
TASTETEST
(
"TASTETEST"
),
//趣味测试
VIDEO_CLASSIC
(
"VIDEO_CLASSIC"
),
//经典版视频
AUDIO_MAGIC
(
"AUDIO_MAGIC"
),
//音频伴读魔法箱
TEACH_RESOURCE
(
"TEACH_RESOURCE"
),
//教辅资料包
COURSE_WARE
(
"COURSE_WARE"
),
//课件
TEST_PAPER
(
"TEST_PAPER"
),
//试卷
MATCH_LISTEN
(
"MATCH_LISTEN"
),
//配套听力
WORD_DICTATION
(
"WORD_DICTATION"
),
//生词听写
STROKE_ORDER
(
"STROKE_ORDER"
),
//笔顺动图
ARTICLE_READING
(
"ARTICLE_READING"
),
//课文诵读
ENGLISH_WALKMAN
(
"ENGLISH_WALKMAN"
),
//英语随身听
WECHAT_STUDY_GROUP
(
"WECHAT_STUDY_GROUP"
),
// 微信学习交流圈
TASK_CLOCK
(
"TASK_CLOCK"
),
//任务打卡
REWARD_CLOCK
(
"REWARD_CLOCK"
),
//奖励打卡
CUSTOM_CLOCK
(
"CUSTOM_CLOCK"
),
//自定义打卡
MEMBER
(
"MEMBER"
),
//开通会员
ORAL_EVALUATION
(
"ORAL_EVALUATION"
),
//口语评测
PBSTORY
(
"PBSTORY"
),
//绘本故事
SUBJECTNOTE
(
"SUBJECTNOTE"
);
// 错题本
/**
* add by gaop at 2017-6-13 16:52:07
*/
GROUP
(
"GROUP"
,
"与你同行(圈子)"
),
ITEM_BANK
(
"ITEM_BANK"
,
"题库"
),
VOICE_MSG
(
"VOICE_MSG"
,
"语音留言"
),
AUDIO
(
"AUDIO"
,
"音频"
),
VIDEO
(
"VIDEO"
,
"视频"
),
IMAGE
(
"IMAGE"
,
"图片"
),
PDF
(
"PDF"
,
"PDF"
),
BOOK
(
"BOOK"
,
"图书"
),
EF
(
"EF"
,
"教育表格"
),
QA
(
"QA"
,
"问答"
),
LISTEN
(
"LISTEN"
,
"听力"
),
ANSWER
(
"ANSWER"
,
"答案"
),
ACTIVITY
(
"ACTIVITY"
,
"分享互动"
),
ZSCORE
(
"ZSCORE"
,
"标准分"
),
RECITE_WORD
(
"RECITE_WORD"
,
"背单词"
),
INTERACT
(
"INTERACT"
,
"互动墙"
),
SPECIAL
(
"SPECIAL"
,
"专题"
),
CLOCK
(
"CLOCK"
,
"打卡"
),
TEST
(
"TEST"
,
"趣味测试(测试工具)"
),
EBOOK
(
"EBOOK"
,
"电子书"
),
LIVE_TIMETABLE
(
"LIVE_TIMETABLE"
,
"直播课表"
),
DRAW
(
"DRAW"
,
"抽奖"
),
WISH
(
"WISH"
,
"愿望单"
),
LIVEAPP
(
"LIVEAPP"
,
"直播3.0"
),
TASTETEST
(
"TASTETEST"
,
"趣味测试"
),
VIDEO_CLASSIC
(
"VIDEO_CLASSIC"
,
"经典版视频"
),
AUDIO_MAGIC
(
"AUDIO_MAGIC"
,
"音频伴读魔法箱"
),
TEACH_RESOURCE
(
"TEACH_RESOURCE"
,
"教辅资料包"
),
COURSE_WARE
(
"COURSE_WARE"
,
"课件"
),
TEST_PAPER
(
"TEST_PAPER"
,
"试卷"
),
MATCH_LISTEN
(
"MATCH_LISTEN"
,
"配套听力"
),
WORD_DICTATION
(
"WORD_DICTATION"
,
"生词听写"
),
STROKE_ORDER
(
"STROKE_ORDER"
,
"笔顺动图"
),
ARTICLE_READING
(
"ARTICLE_READING"
,
"课文诵读"
),
ENGLISH_WALKMAN
(
"ENGLISH_WALKMAN"
,
"英语随身听"
),
WECHAT_STUDY_GROUP
(
"WECHAT_STUDY_GROUP"
,
"微信学习交流圈"
),
TASK_CLOCK
(
"TASK_CLOCK"
,
"任务打卡"
),
REWARD_CLOCK
(
"REWARD_CLOCK"
,
"奖励打卡"
),
CUSTOM_CLOCK
(
"CUSTOM_CLOCK"
,
"自定义打卡"
),
MEMBER
(
"MEMBER"
,
"开通会员"
),
ORAL_EVALUATION
(
"ORAL_EVALUATION"
,
"口语评测"
),
PBSTORY
(
"PBSTORY"
,
"绘本故事"
),
/**
* add by songx at 2019-5-25 16:52:07
*/
SUBJECTNOTE
(
"SUBJECTNOTE"
,
"错题本"
);
/**
/**
* 枚举转换
* 枚举转换
...
@@ -91,12 +105,22 @@ public enum AppTypeEnum {
...
@@ -91,12 +105,22 @@ public enum AppTypeEnum {
public
final
String
value
;
public
final
String
value
;
/**
/**
* 名称
*/
public
final
String
name
;
/**
* 构造
* 构造
*
*
* @param value
* @param value
*/
*/
private
AppTypeEnum
(
String
value
)
{
private
AppTypeEnum
(
String
value
,
String
name
)
{
this
.
value
=
value
;
this
.
value
=
value
;
this
.
name
=
name
;
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
AppTypeEnum
.
valueOf
(
"SUBJECTNOTE"
));
}
}
}
}
pcloud-common/src/main/java/com/pcloud/common/exceptions/ParamCheck.java
View file @
59cf09ff
...
@@ -91,6 +91,21 @@ public class ParamCheck {
...
@@ -91,6 +91,21 @@ public class ParamCheck {
}
}
/**
/**
* check bety[] is null
*
* @param bts
* @param msg
* @throws BizException
* @author songx
* @date 2019年4月23日, 下午3:07:37
*/
public
static
void
isEmpty
(
byte
[]
bts
,
String
msg
)
throws
BizException
{
if
(
bts
==
null
||
bts
.
length
==
0
)
{
throw
new
BizException
(
BizException
.
PARAM_IS_NULL
.
getCode
(),
msg
);
}
}
/**
* 校验分页参数校验分页参数
* 校验分页参数校验分页参数
*
*
* @param basePageVO
* @param basePageVO
...
...
pcloud-common/src/main/java/com/pcloud/common/mq/constant/QueueNameConstant.java
0 → 100644
View file @
59cf09ff
package
com
.
pcloud
.
common
.
mq
.
constant
;
/**
* @Author: songx
* @Date: 2019年07月11日, 14:48
*/
public
class
QueueNameConstant
{
/**
* 服务调用链路
*/
public
static
final
String
SERVER_LINK
=
"serverLinkQueue"
;
}
pcloud-common/src/main/java/com/pcloud/common/mq/dto/ServerLinkDTO.java
0 → 100644
View file @
59cf09ff
package
com
.
pcloud
.
common
.
mq
.
dto
;
import
com.pcloud.common.dto.BaseDto
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.ToString
;
/**
* @Author: songx
* @Date: 2019年07月11日, 14:52
*/
@Getter
@Setter
@ToString
(
callSuper
=
true
)
public
class
ServerLinkDTO
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
2029227731936018946L
;
/**
* 消费者服务名称
*/
private
String
consumerAppName
;
/**
* 消费者IP
*/
private
String
consumerIp
;
/**
* 消费者类名
*/
private
String
consumerClassName
;
/**
* 消费者方法名
*/
private
String
consumerMethodName
;
/**
* 生产者服务名称
*/
private
String
produceAppName
;
/**
* 生产者IP
*/
private
String
produceIp
;
/**
* 生产者类名
*/
private
String
produceClassName
;
/**
* 生产者方法名
*/
private
String
produceMethodName
;
/**
* 完整的调用链路
*/
private
String
links
;
}
pcloud-common/src/main/java/com/pcloud/common/mq/queue/ServerLinkQueue.java
0 → 100644
View file @
59cf09ff
/**
*
*/
package
com
.
pcloud
.
common
.
mq
.
queue
;
import
org.springframework.amqp.core.AmqpTemplate
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.mq.constant.QueueNameConstant
;
import
com.pcloud.common.mq.dto.ServerLinkDTO
;
import
lombok.extern.slf4j.Slf4j
;
/**
* @author:songx
* @date:2019/6/20,11:37
*/
@Slf4j
@Component
public
class
ServerLinkQueue
{
/**
* 服务调用链路QUEUE
*/
public
static
void
send
(
ServerLinkDTO
serverLinkDTO
)
throws
BizException
{
log
.
info
(
"【QUEUE】服务调用链路.[serverLinkDTO]->"
+
serverLinkDTO
);
if
(
serverLinkDTO
==
null
)
{
throw
BizException
.
PARAM_IS_NULL
;
}
getAmqpTemplate
().
convertAndSend
(
QueueNameConstant
.
SERVER_LINK
,
serverLinkDTO
);
}
/**
* 获取实例
*
* @return
*/
public
static
AmqpTemplate
getAmqpTemplate
()
{
return
SingletonInstance
.
amqpTemplate
;
}
@Component
public
static
class
SingletonInstance
{
private
static
AmqpTemplate
amqpTemplate
;
public
SingletonInstance
(
@Autowired
AmqpTemplate
amqpTemplate
)
{
this
.
amqpTemplate
=
amqpTemplate
;
}
}
}
pcloud-common/src/main/java/com/pcloud/common/utils/FileUtils.java
View file @
59cf09ff
...
@@ -29,7 +29,7 @@ import org.slf4j.Logger;
...
@@ -29,7 +29,7 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
com.pcloud.common.constant.AliyunConstant
;
import
com.pcloud.common.constant.AliyunConstant
;
import
com.pcloud.common.constant.FilePathConst
;
import
com.pcloud.common.constant.FilePathConst
ant
;
import
com.pcloud.common.constant.OSConstant
;
import
com.pcloud.common.constant.OSConstant
;
import
com.pcloud.common.entity.UploadResultInfo
;
import
com.pcloud.common.entity.UploadResultInfo
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
...
@@ -215,7 +215,7 @@ public class FileUtils {
...
@@ -215,7 +215,7 @@ public class FileUtils {
/**
/**
* 传入文件夹路径,该方法能够实现创建整个路径
* 传入文件夹路径,该方法能够实现创建整个路径
*
*
* @param
p
ath
* @param
fileP
ath
* 文件夹路径,不包含文件名称及后缀名
* 文件夹路径,不包含文件名称及后缀名
*/
*/
public
static
boolean
isDir
(
String
filePath
)
{
public
static
boolean
isDir
(
String
filePath
)
{
...
@@ -882,7 +882,7 @@ public class FileUtils {
...
@@ -882,7 +882,7 @@ public class FileUtils {
String
fileType
=
getFileType
(
url
);
String
fileType
=
getFileType
(
url
);
String
localFilePath
=
url
;
String
localFilePath
=
url
;
if
(
url
.
startsWith
(
"http"
))
{
if
(
url
.
startsWith
(
"http"
))
{
localFilePath
=
FilePathConst
.
TEXT_PATH
+
UUIDUitl
.
taskName
()
+
"."
+
fileType
;
localFilePath
=
FilePathConst
ant
.
TEXT
+
UUIDUitl
.
taskName
()
+
"."
+
fileType
;
downloadFileFromUrl
(
url
,
localFilePath
);
downloadFileFromUrl
(
url
,
localFilePath
);
}
}
try
{
try
{
...
@@ -919,7 +919,7 @@ public class FileUtils {
...
@@ -919,7 +919,7 @@ public class FileUtils {
return
null
;
return
null
;
}
}
// 下载文件
// 下载文件
String
downloadPath
=
FilePathConst
.
DOWNLOAD_PATH
+
UUIDUitl
.
generateString
(
32
)
+
"."
+
fileType
;
String
downloadPath
=
FilePathConst
ant
.
DOWNLOAD
+
UUIDUitl
.
generateString
(
32
)
+
"."
+
fileType
;
FileUtils
.
downloadFileFromUrl
(
url
,
downloadPath
);
FileUtils
.
downloadFileFromUrl
(
url
,
downloadPath
);
// 剪切文件
// 剪切文件
String
cutPath
=
clipByPercent
(
new
File
(
downloadPath
),
percent
);
String
cutPath
=
clipByPercent
(
new
File
(
downloadPath
),
percent
);
...
@@ -969,7 +969,7 @@ public class FileUtils {
...
@@ -969,7 +969,7 @@ public class FileUtils {
throw
new
FileException
(
FileException
.
FILE_READ_FAILURE
,
"剪切的文件必须大于1KB"
);
throw
new
FileException
(
FileException
.
FILE_READ_FAILURE
,
"剪切的文件必须大于1KB"
);
}
}
// 输出文件路径
// 输出文件路径
String
outFilePath
=
FilePathConst
.
CUT_PATH
+
UUIDUitl
.
generateString
(
12
)
+
"_"
+
inputFile
.
getName
();
String
outFilePath
=
FilePathConst
ant
.
CUT
+
UUIDUitl
.
generateString
(
12
)
+
"_"
+
inputFile
.
getName
();
creatFiles
(
outFilePath
);
creatFiles
(
outFilePath
);
// 剪切长度
// 剪切长度
cutLength
=
cutLength
>
inputFile
.
length
()
?
inputFile
.
length
()
:
cutLength
;
cutLength
=
cutLength
>
inputFile
.
length
()
?
inputFile
.
length
()
:
cutLength
;
...
@@ -1043,7 +1043,7 @@ public class FileUtils {
...
@@ -1043,7 +1043,7 @@ public class FileUtils {
OutputStream
out
=
null
;
OutputStream
out
=
null
;
try
{
try
{
// Base64解码
// Base64解码
byte
[]
b
=
Base64
.
decodeBase64
(
targetPath
);
byte
[]
b
=
Base64
.
decodeBase64
(
base64Code
);
for
(
int
i
=
0
;
i
<
b
.
length
;
++
i
)
{
for
(
int
i
=
0
;
i
<
b
.
length
;
++
i
)
{
if
(
b
[
i
]
<
0
)
{
// 调整异常数据
if
(
b
[
i
]
<
0
)
{
// 调整异常数据
b
[
i
]
+=
256
;
b
[
i
]
+=
256
;
...
...
pcloud-common/src/main/java/com/pcloud/common/utils/ImageUtils.java
View file @
59cf09ff
...
@@ -11,16 +11,12 @@ import java.math.BigDecimal;
...
@@ -11,16 +11,12 @@ import java.math.BigDecimal;
import
javax.imageio.ImageIO
;
import
javax.imageio.ImageIO
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
com.itextpdf.text.Image
;
import
com.itextpdf.text.Image
;
import
com.pcloud.common.constant.AliyunConstant
;
import
com.pcloud.common.constant.AliyunConstant
;
import
com.pcloud.common.constant.FilePathConst
;
import
com.pcloud.common.constant.ImageConstant
;
import
com.pcloud.common.constant.ImageConstant
;
import
com.pcloud.common.entity.UploadResultInfo
;
import
com.pcloud.common.enums.ImageEnum
;
import
com.pcloud.common.enums.ImageEnum
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.FileException
;
import
com.pcloud.common.exceptions.FileException
;
...
@@ -738,37 +734,32 @@ public class ImageUtils {
...
@@ -738,37 +734,32 @@ public class ImageUtils {
* @param fileUrl
* @param fileUrl
* @return
* @return
*/
*/
// public static UploadResultInfo transcodeToWebp(String fileUrl, int quality) {
// public static UploadResultInfo transcodeToWebp(String fileUrl, int quality) {
// LOGGER.info("【IMAGE API】image transcode to webp.<START>.[fileUrl]=" + fileUrl
// LOGGER.info("【IMAGE API】image transcode to webp.<START>.[fileUrl]=" + fileUrl + ",[quality]=" + quality);
// + ",[quality]=" + quality);
// String fileNameAll = FileUtils.getFileNameAll(fileUrl);
// String fileNameAll = FileUtils.getFileNameAll(fileUrl);
// String localFilePath = FilePathConstant.DOWNLOAD_PATH + fileNameAll;
// String localFilePath = FilePathConst.DOWNLOAD_PATH + fileNameAll;
// FileUtils.downloadFileFromUrl(fileUrl, localFilePath);
// FileUtils.downloadFileFromUrl(fileUrl, localFilePath);
// String outputFilePath = FilePathConstant.IMAGE_PATH + "webp/" + fileNameAll + ".webp";
// String outputFilePath = FilePathConst.IMAGE_PATH + "webp/" + fileNameAll +
// FileUtils.creatFiles(outputFilePath);
// ".webp";
// UploadResultInfo uploadResultInfo = null;
// FileUtils.creatFiles(outputFilePath);
// try {
// UploadResultInfo uploadResultInfo = null;
// String os = System.getProperty("os.name");
// try {
// if (os.toLowerCase().startsWith("win")) {
// String os = System.getProperty("os.name");
// executeCwebp4Win(localFilePath, outputFilePath, quality);
// if (os.toLowerCase().startsWith("win")) {
// } else {
// executeCwebp4Win(localFilePath, outputFilePath, quality);
// executeCwebp4Linux(localFilePath, outputFilePath, quality);
// } else {
// }
// executeCwebp4Linux(localFilePath, outputFilePath, quality);
// uploadResultInfo = OssUtils.uploadLocalFile4Child(outputFilePath, fileUrl);
// }
// } catch (Exception e) {
// uploadResultInfo = OssUtils.uploadLocalFile4Child(outputFilePath, fileUrl);
// LOGGER.error("An error happend when convert to webp. Img is: " + e.getMessage(), e);
// } catch (Exception e) {
// throw new FileException(FileException.FILE_CONVERT_FAIL, "transcode to webp is fail!");
// LOGGER.error("An error happend when convert to webp. Img is: " +
// } finally {
// e.getMessage(), e);
// FileUtils.deleteFile(localFilePath);
// throw new FileException(FileException.FILE_CONVERT_FAIL, "transcode to webp
// FileUtils.deleteFile(outputFilePath);
// is fail!");
// }
// } finally {
// LOGGER.info("【IMAGE API】image transcode to webp.<START>.[uploadResultInfo]=" + uploadResultInfo);
// FileUtils.deleteFile(localFilePath);
// return uploadResultInfo;
// FileUtils.deleteFile(outputFilePath);
// }
// }
// LOGGER.info("【IMAGE API】image transcode to webp.<START>.[uploadResultInfo]="
// + uploadResultInfo);
// return uploadResultInfo;
// }
/**
/**
* execute cwebp command:cwebp [options] input_file -o output_file.webp
* execute cwebp command:cwebp [options] input_file -o output_file.webp
...
@@ -778,15 +769,13 @@ public class ImageUtils {
...
@@ -778,15 +769,13 @@ public class ImageUtils {
* @param quality
* @param quality
* @throws Exception
* @throws Exception
*/
*/
// private static void executeCwebp4Win(String inputFilePath, String
// private static void executeCwebp4Win(String inputFilePath, String outputFilePath, int quality) throws Exception {
// outputFilePath, int quality) throws Exception {
// Process process = new ProcessBuilder("cwebp", "-q", (quality == 0 ? 80 : quality) + "", inputFilePath, "-o",
// Process process = new ProcessBuilder("cwebp", "-q", (quality == 0 ? 80 :
// outputFilePath).redirectErrorStream(true).start();
// quality) + "", inputFilePath, "-o",
// if (0 != process.waitFor()) {
// outputFilePath).redirectErrorStream(true).start();
// throw new Exception("process wait for fail!");
// if (0 != process.waitFor()) {
// }
// throw new Exception("process wait for fail!");
// }
// }
// }
/**
/**
* execute cwebp command:cwebp [options] input_file -o output_file.webp
* execute cwebp command:cwebp [options] input_file -o output_file.webp
...
@@ -796,47 +785,12 @@ public class ImageUtils {
...
@@ -796,47 +785,12 @@ public class ImageUtils {
* @param quality
* @param quality
* @throws Exception
* @throws Exception
*/
*/
// private static void executeCwebp4Linux(String inputFilePath, String
// private static void executeCwebp4Linux(String inputFilePath, String outputFilePath, int quality) throws Exception {
// outputFilePath, int quality) throws Exception {
// Process process = new ProcessBuilder("/usr/local/bin/cwebp", "-q", (quality == 0 ? 80 : quality) + "",
// Process process = new ProcessBuilder("/usr/local/bin/cwebp", "-q", (quality
// inputFilePath, "-o", outputFilePath).redirectErrorStream(true).start();
// == 0 ? 80 : quality) + "",
// if (0 != process.waitFor()) {
// inputFilePath, "-o", outputFilePath).redirectErrorStream(true).start();
// throw new Exception("process wait for fail!");
// if (0 != process.waitFor()) {
// throw new Exception("process wait for fail!");
// }
// }
/**
* 上传的图片转换成webpO
*
* @param localFilePath
* 源文件的本地路径
* @param httpUrl
* 源文件上传后的路径,主要用于子文件上传时对应http文件路径
*/
public
static
UploadResultInfo
toWebp
(
String
fileUrl
)
{
// String fileNameAll = FileUtils.getFileNameAll(fileUrl);
// String localFilePath = FilePathConst.DOWNLOAD_PATH + fileNameAll;
// FileUtils.downloadFileFromUrl(fileUrl, localFilePath);
// String tragetPath = null;
// try {
// tragetPath = com.dcg.util.ImageUtils.transcodeToWebp(localFilePath, 80);
// } catch (Exception e) {
// LOGGER.error("【IMAGE】图片转换成webp失败:" + e.getMessage(), e);
// return null;
// }
// }
// if (StringUtils.isEmpty(tragetPath)) {
// return null;
// }
// try {
// return OssUtils.uploadLocalFile4Child(tragetPath, fileUrl);
// } catch (Exception e) {
// LOGGER.error("【IMAGE】图片转换成webp,上传失败:" + e.getMessage(), e);
// } finally {
// FileUtils.deleteFile(localFilePath);
// FileUtils.deleteFile(tragetPath);
// }
// }
return
null
;
}
}
}
pcloud-common/src/main/java/com/pcloud/common/utils/LocalDateUtils.java
View file @
59cf09ff
...
@@ -9,7 +9,13 @@ import java.time.LocalDate;
...
@@ -9,7 +9,13 @@ import java.time.LocalDate;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.ZoneId
;
import
java.time.ZoneId
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
import
java.time.temporal.ChronoUnit
;
import
java.time.temporal.TemporalAdjusters
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
...
@@ -116,9 +122,23 @@ public class LocalDateUtils {
...
@@ -116,9 +122,23 @@ public class LocalDateUtils {
}
}
/**
/**
* 获取指定日前多少天以前的日期
*
* @param date
* @param days
* @return
*/
public
static
LocalDate
getMinusDays
(
LocalDate
date
,
long
days
)
{
if
(
date
==
null
)
{
throw
new
IllegalArgumentException
(
"date is null"
);
}
return
date
.
minusDays
(
days
);
}
/**
* 获取当前日前多少小时以前的日期
* 获取当前日前多少小时以前的日期
*
*
* @param minute
s
* @param hour
s
* @return
* @return
*/
*/
public
static
LocalDateTime
getMinusHours
(
long
hours
)
{
public
static
LocalDateTime
getMinusHours
(
long
hours
)
{
...
@@ -150,13 +170,30 @@ public class LocalDateUtils {
...
@@ -150,13 +170,30 @@ public class LocalDateUtils {
}
}
/**
/**
* String转换为localDate
*
* @param date
* @return
*/
public
static
LocalDate
convertDate
(
String
date
)
{
if
(
StringUtil
.
isEmpty
(
date
))
{
return
null
;
}
return
LocalDate
.
parse
(
date
);
}
/**
* Date转换为localDate
* Date转换为localDate
*
*
* @param date
* @param date
* @return
* @return
*/
*/
public
static
LocalDate
convertDate
(
Date
date
)
{
public
static
LocalDate
convertDate
(
Date
date
)
{
return
convertDateTime
(
date
).
toLocalDate
();
LocalDateTime
localDateTime
=
convertDateTime
(
date
);
if
(
localDateTime
==
null
)
{
return
null
;
}
return
localDateTime
.
toLocalDate
();
}
}
/**
/**
...
@@ -394,7 +431,7 @@ public class LocalDateUtils {
...
@@ -394,7 +431,7 @@ public class LocalDateUtils {
long
hour
=
duration
.
toHours
()
-
day
*
24
;
long
hour
=
duration
.
toHours
()
-
day
*
24
;
// 计算差多少分钟
// 计算差多少分钟
long
min
=
duration
.
toMinutes
()
-
duration
.
toHours
()
*
60
;
long
min
=
duration
.
toMinutes
()
-
duration
.
toHours
()
*
60
;
return
new
long
[]
{
day
,
hour
,
min
};
return
new
long
[]{
day
,
hour
,
min
};
}
}
/**
/**
...
@@ -445,10 +482,109 @@ public class LocalDateUtils {
...
@@ -445,10 +482,109 @@ public class LocalDateUtils {
*/
*/
public
static
long
getDayPoor
(
LocalDateTime
dateTime
)
{
public
static
long
getDayPoor
(
LocalDateTime
dateTime
)
{
if
(
dateTime
==
null
)
{
if
(
dateTime
==
null
)
{
return
-
1
;
throw
new
IllegalArgumentException
(
"dateTime is null"
)
;
}
}
Duration
duration
=
Duration
.
between
(
dateTime
,
LocalDateTime
.
now
());
Duration
duration
=
Duration
.
between
(
dateTime
,
LocalDateTime
.
now
());
return
duration
.
toDays
();
return
duration
.
toDays
();
}
}
/**
* 获取指定时间相差多少天
*
* @param startDate 格式:2017-01-01
* @param endDate 格式:2017-02-01
* @return
*/
public
static
long
getDayPoor
(
String
startDate
,
String
endDate
)
{
if
(
StringUtil
.
isEmpty
(
startDate
)
||
StringUtil
.
isEmpty
(
endDate
))
{
throw
new
IllegalArgumentException
(
"startDate or endDate is null"
);
}
return
getDayPoor
(
convertDate
(
startDate
),
convertDate
(
endDate
));
}
/**
* 获取指定时间相差多少天
*
* @param startDate
* @param endDate
* @return
*/
public
static
long
getDayPoor
(
LocalDate
startDate
,
LocalDate
endDate
)
{
if
(
startDate
==
null
||
endDate
==
null
)
{
throw
new
IllegalArgumentException
(
"startDate or endDate is null"
);
}
return
startDate
.
until
(
endDate
,
ChronoUnit
.
DAYS
);
}
/**
* 获取月份
*
* @param dateTime 时间格式:2019-01-01 00:00:00
* @return
*/
public
static
int
getMonth
(
String
dateTime
)
{
if
(
StringUtil
.
isEmpty
(
dateTime
))
{
return
0
;
}
return
convertDateTime
(
dateTime
).
getMonthValue
();
}
/**
* 获取当月第一天
*
* @param date
* @return
*/
public
static
LocalDate
firstDay
(
LocalDate
date
)
{
if
(
date
==
null
)
{
throw
new
IllegalArgumentException
(
"date is null"
);
}
return
date
.
with
(
TemporalAdjusters
.
firstDayOfMonth
());
}
/**
* 获取当月最后一天
*
* @param date
* @return
*/
public
static
LocalDate
lastDay
(
LocalDate
date
)
{
if
(
date
==
null
)
{
throw
new
IllegalArgumentException
(
"date is null"
);
}
return
date
.
with
(
TemporalAdjusters
.
lastDayOfMonth
());
}
/**
* 获取指定日期和天数以前的日期时间集合(不含指定日期)
*
* @param date
* @return
*/
public
static
List
<
LocalDate
>
getBeforeDays
(
LocalDate
date
,
long
days
)
{
if
(
date
==
null
)
{
throw
new
IllegalArgumentException
(
"date is null"
);
}
List
<
LocalDate
>
localDates
=
new
ArrayList
<>();
for
(
long
i
=
days
;
i
>
0
;
i
--)
{
localDates
.
add
(
getMinusDays
(
date
,
i
));
}
return
localDates
;
}
/**
* 获取指定日期之间的日期集合(含指定日期)
*
* @param startdate
* @param endDate
* @return
*/
public
static
List
<
LocalDate
>
getDates
(
LocalDate
startdate
,
LocalDate
endDate
)
{
if
(
startdate
==
null
||
endDate
==
null
)
{
throw
new
IllegalArgumentException
(
"date is null"
);
}
return
Stream
.
iterate
(
startdate
,
date
->
date
.
plusDays
(
1
))
.
limit
(
ChronoUnit
.
DAYS
.
between
(
startdate
,
endDate
)
+
1
).
collect
(
Collectors
.
toList
());
}
}
}
pcloud-common/src/main/java/com/pcloud/common/utils/PictureUtil.java
View file @
59cf09ff
...
@@ -68,10 +68,6 @@ public class PictureUtil {
...
@@ -68,10 +68,6 @@ public class PictureUtil {
list
.
add
(
R
+
"-"
+
G
+
"-"
+
B
);
list
.
add
(
R
+
"-"
+
G
+
"-"
+
B
);
}
}
}
}
// R = R/sum;
// G = G/sum;
// B = B/sum;
// return new Color(R,G,B);
return
getMaxCount
(
list
);
return
getMaxCount
(
list
);
}
}
...
...
pcloud-common/src/main/java/com/pcloud/common/utils/ResponseHandleUtil.java
View file @
59cf09ff
...
@@ -4,16 +4,22 @@ import java.math.BigDecimal;
...
@@ -4,16 +4,22 @@ import java.math.BigDecimal;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.pcloud.common.config.Application
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.mq.dto.ServerLinkDTO
;
import
com.pcloud.common.mq.queue.ServerLinkQueue
;
import
com.pcloud.common.utils.nginx.NginxUtils
;
/**
/**
* Created by zengqiang on 17-12-14.
* Created by zengqiang on 17-12-14.
...
@@ -25,10 +31,8 @@ public class ResponseHandleUtil {
...
@@ -25,10 +31,8 @@ public class ResponseHandleUtil {
/**
/**
* 解析一层list包装泛型数据
* 解析一层list包装泛型数据
*
*
* @param obj
* @param obj 需要解析的数据对象
* 需要解析的数据对象
* @param clazz list内元素类型
* @param clazz
* list内元素类型
* @param <T>
* @param <T>
* @return
* @return
*/
*/
...
@@ -39,6 +43,14 @@ public class ResponseHandleUtil {
...
@@ -39,6 +43,14 @@ public class ResponseHandleUtil {
return
JSON
.
parseArray
(
JSON
.
toJSONString
(
obj
),
clazz
);
return
JSON
.
parseArray
(
JSON
.
toJSONString
(
obj
),
clazz
);
}
}
/**
* @param obj
* @param clazzK
* @param clazzV
* @param <K>
* @param <V>
* @return
*/
public
static
<
K
,
V
>
Map
<
K
,
V
>
getMapData
(
Object
obj
,
Class
<
K
>
clazzK
,
Class
<
V
>
clazzV
)
{
public
static
<
K
,
V
>
Map
<
K
,
V
>
getMapData
(
Object
obj
,
Class
<
K
>
clazzK
,
Class
<
V
>
clazzV
)
{
if
(
null
==
obj
)
{
if
(
null
==
obj
)
{
return
null
;
return
null
;
...
@@ -54,6 +66,7 @@ public class ResponseHandleUtil {
...
@@ -54,6 +66,7 @@ public class ResponseHandleUtil {
/**
/**
* 解析map的value是list的泛型数据
* 解析map的value是list的泛型数据
*
* @param obj 需要解析的数据对象
* @param obj 需要解析的数据对象
* @param clazzK key元素类型
* @param clazzK key元素类型
* @param clazzT value中list元素类型
* @param clazzT value中list元素类型
...
@@ -72,6 +85,12 @@ public class ResponseHandleUtil {
...
@@ -72,6 +85,12 @@ public class ResponseHandleUtil {
return
resultMap
;
return
resultMap
;
}
}
/**
* @param entity
* @param clazz
* @param <T>
* @return
*/
public
static
<
T
>
T
parseResponse
(
ResponseEntity
<?>
entity
,
Class
<
T
>
clazz
)
{
public
static
<
T
>
T
parseResponse
(
ResponseEntity
<?>
entity
,
Class
<
T
>
clazz
)
{
Object
obj
=
parseResponse
(
entity
);
Object
obj
=
parseResponse
(
entity
);
if
(
null
==
obj
)
{
if
(
null
==
obj
)
{
...
@@ -120,8 +139,7 @@ public class ResponseHandleUtil {
...
@@ -120,8 +139,7 @@ public class ResponseHandleUtil {
*
*
* @param entity
* @param entity
* @param clazz
* @param clazz
* @param <T>
* @param <T> List元素类型
* List元素类型
* @return
* @return
*/
*/
public
static
<
T
>
List
<
T
>
parseListResponse
(
ResponseEntity
<?>
entity
,
Class
<
T
>
clazz
)
{
public
static
<
T
>
List
<
T
>
parseListResponse
(
ResponseEntity
<?>
entity
,
Class
<
T
>
clazz
)
{
...
@@ -129,17 +147,13 @@ public class ResponseHandleUtil {
...
@@ -129,17 +147,13 @@ public class ResponseHandleUtil {
if
(
null
==
list
)
{
if
(
null
==
list
)
{
return
list
;
return
list
;
}
}
return
JSON
.
parseArray
(
JSON
.
toJSONString
(
list
),
clazz
);
return
JSON
.
parseArray
(
JSON
.
toJSONString
(
list
),
clazz
);
}
}
/**
/**
*
* @param entity
* @param entity
* @param clazzK
* @param clazzK key class类型
* key class类型
* @param clazzV value class类型
* @param clazzV
* value class类型
* @param <K>
* @param <K>
* @param <V>
* @param <V>
* @return
* @return
...
@@ -149,7 +163,6 @@ public class ResponseHandleUtil {
...
@@ -149,7 +163,6 @@ public class ResponseHandleUtil {
if
(
null
==
map
)
{
if
(
null
==
map
)
{
return
map
;
return
map
;
}
}
Map
<
K
,
V
>
result
=
new
HashMap
<>();
Map
<
K
,
V
>
result
=
new
HashMap
<>();
for
(
Object
o
:
map
.
entrySet
())
{
for
(
Object
o
:
map
.
entrySet
())
{
Map
.
Entry
entry
=
(
Map
.
Entry
)
o
;
Map
.
Entry
entry
=
(
Map
.
Entry
)
o
;
...
@@ -193,6 +206,7 @@ public class ResponseHandleUtil {
...
@@ -193,6 +206,7 @@ public class ResponseHandleUtil {
/**
/**
* Map List转换
* Map List转换
*
* @param entity 需要解析的数据对象
* @param entity 需要解析的数据对象
* @param clazzK key元素类型
* @param clazzK key元素类型
* @param clazzT value中list元素类型
* @param clazzT value中list元素类型
...
@@ -206,6 +220,12 @@ public class ResponseHandleUtil {
...
@@ -206,6 +220,12 @@ public class ResponseHandleUtil {
return
getMapListData
(
object
,
clazzK
,
clazzT
);
return
getMapListData
(
object
,
clazzK
,
clazzT
);
}
}
/**
* 内部接口返回值解析
*
* @param entity
* @return
*/
public
static
Object
parseResponse
(
ResponseEntity
<?>
entity
)
{
public
static
Object
parseResponse
(
ResponseEntity
<?>
entity
)
{
if
(
null
==
entity
)
{
if
(
null
==
entity
)
{
LOGGER
.
warn
(
"null response object"
);
LOGGER
.
warn
(
"null response object"
);
...
@@ -232,16 +252,103 @@ public class ResponseHandleUtil {
...
@@ -232,16 +252,103 @@ public class ResponseHandleUtil {
LOGGER
.
warn
(
"【业务异常】:"
+
body
.
getErrCode
()
+
", 异常信息: "
+
body
.
getMessage
());
LOGGER
.
warn
(
"【业务异常】:"
+
body
.
getErrCode
()
+
", 异常信息: "
+
body
.
getMessage
());
throw
new
BizException
(
body
.
getErrCode
(),
body
.
getMessage
());
throw
new
BizException
(
body
.
getErrCode
(),
body
.
getMessage
());
}
}
// 获取当前的整个链路的调用类和方法,发送服务调用链queue
try
{
// StackTraceElement[] stackTraceElements = new Exception().getStackTrace();
// ThreadUtil.FIXED_POOL.execute(() -> sendServerLink(body, stackTraceElements));
}
catch
(
Exception
e
)
{
LOGGER
.
warn
(
"【内部调用】获取调用类和方法失败:"
+
e
.
getMessage
(),
e
);
}
return
body
.
getData
();
return
body
.
getData
();
}
}
/**
* 发送服务调用链queue
*
* @param body
*/
private
static
void
sendServerLink
(
ResponseDto
<?>
body
,
StackTraceElement
[]
stackTraceElements
)
{
int
index
=
2
;
// 如果第二级是parseMap或parseList表明是当前类的方法,则索引更新为3
String
methodName
=
stackTraceElements
[
index
].
getMethodName
();
if
(
methodName
.
startsWith
(
"parseMap"
)
||
methodName
.
startsWith
(
"parseList"
))
{
index
=
3
;
}
methodName
=
stackTraceElements
[
index
].
getMethodName
();
// 数据平台和获取微信分享参数的接口过滤不用统计
if
(
"trackEventInfo"
.
equals
(
methodName
)
||
"getJsShareParam"
.
equals
(
methodName
))
{
return
;
}
ServerLinkDTO
serverLinkDTO
=
new
ServerLinkDTO
();
serverLinkDTO
.
setConsumerClassName
(
stackTraceElements
[
index
].
getClassName
());
serverLinkDTO
.
setConsumerMethodName
(
methodName
);
serverLinkDTO
.
setConsumerAppName
(
Application
.
APP_NAME
);
serverLinkDTO
.
setConsumerIp
(
NginxUtils
.
getLocalAddress
());
serverLinkDTO
.
setProduceAppName
(
body
.
getProduceAppName
());
serverLinkDTO
.
setProduceIp
(
body
.
getProduceIp
());
serverLinkDTO
.
setProduceClassName
(
body
.
getProduceClassName
());
serverLinkDTO
.
setProduceMethodName
(
body
.
getProduceMethodName
());
serverLinkDTO
.
setLinks
(
appendLinks
(
stackTraceElements
,
index
));
try
{
ServerLinkQueue
.
send
(
serverLinkDTO
);
}
catch
(
Exception
e
)
{
LOGGER
.
warn
(
"【内部调用】发送服务调用链QUEUE失败:"
+
e
.
getMessage
(),
e
);
}
}
/**
* 拼接整个调用链路
*
* @param stackTraceElements
* @return
*/
private
static
String
appendLinks
(
StackTraceElement
[]
stackTraceElements
,
int
index
)
{
if
(
stackTraceElements
==
null
||
stackTraceElements
.
length
==
0
)
{
return
null
;
}
int
i
=
0
;
StringBuilder
links
=
new
StringBuilder
();
for
(
StackTraceElement
element
:
stackTraceElements
)
{
// 过滤index以前的数据,index以前的数据都是本类的方法,无需记录
if
(
i
<
index
)
{
i
++;
continue
;
}
String
className
=
element
.
getClassName
();
// 只拼接调用的业务类和方法,JDK的类不拼接
if
(!
className
.
startsWith
(
"com.pcloud"
)
||
className
.
indexOf
(
"$$FastClassBySpringCGLIB$$"
)
>
0
||
className
.
indexOf
(
"$$EnhancerBySpringCGLIB$$"
)
>
0
)
{
continue
;
}
links
.
append
(
className
).
append
(
"."
).
append
(
element
.
getMethodName
()).
append
(
"->"
);
}
return
links
.
toString
();
}
/**
* 内部接口封装返回类型
*
* @param data
* @param <T>
* @return
*/
public
static
<
T
>
ResponseEntity
<
ResponseDto
<
T
>>
toResponse
(
T
data
)
{
public
static
<
T
>
ResponseEntity
<
ResponseDto
<
T
>>
toResponse
(
T
data
)
{
if
(
null
==
data
)
{
if
(
null
==
data
)
{
LOGGER
.
warn
(
"null data object"
);
LOGGER
.
warn
(
"null data object"
);
return
null
;
return
null
;
}
}
ResponseDto
<
T
>
body
=
new
ResponseDto
<>(
data
);
ResponseDto
<
T
>
body
=
new
ResponseDto
<>(
data
);
return
new
ResponseEntity
<
ResponseDto
<
T
>>(
body
,
HttpStatus
.
OK
);
try
{
// body.setProduceAppName(Application.APP_NAME);
// body.setProduceIp(NginxUtils.getLocalAddress());
// StackTraceElement stackTraceElement = new Exception().getStackTrace()[1];
// body.setProduceClassName(stackTraceElement.getClassName());
// body.setProduceMethodName(stackTraceElement.getMethodName());
}
catch
(
Exception
e
)
{
LOGGER
.
warn
(
"【内部接口】封装返回类型失败:"
+
e
.
getMessage
(),
e
);
}
return
new
ResponseEntity
<>(
body
,
HttpStatus
.
OK
);
}
}
}
}
\ No newline at end of file
pcloud-common/src/main/java/com/pcloud/common/utils/SessionUtil.java
View file @
59cf09ff
...
@@ -67,14 +67,15 @@ public abstract class SessionUtil {
...
@@ -67,14 +67,15 @@ public abstract class SessionUtil {
public
static
final
String
ROLE_CODE
=
"roleCode"
;
public
static
final
String
ROLE_CODE
=
"roleCode"
;
/**
/**
*
wechatUserId
*
讲师ID
*/
*/
public
static
final
String
WECHAT_USER_ID
=
"wechatUserId"
;
public
static
final
String
LECTURER_ID
=
"lecturerId"
;
/**
/**
*
讲师
Id
*
wechatUser
Id
*/
*/
public
static
final
String
LECTURER_ID
=
"lectur
erId"
;
public
static
final
String
WECHAT_USER_ID
=
"wechatUs
erId"
;
/**
/**
* wechatUserId
* wechatUserId
...
@@ -82,6 +83,26 @@ public abstract class SessionUtil {
...
@@ -82,6 +83,26 @@ public abstract class SessionUtil {
public
static
final
String
THIRD_TYPE
=
"thirdType"
;
public
static
final
String
THIRD_TYPE
=
"thirdType"
;
/**
/**
* 代理商ID
*/
public
static
final
String
PROMOTER_ID
=
"promoterId"
;
/**
* 代理商名称
*/
public
static
final
String
PROMOTER_NAME
=
"promoterName"
;
/**
* 代理商电话
*/
public
static
final
String
PROMOTER_PHONE
=
"promoterPhone"
;
/**
* 代理商创建时间
*/
public
static
final
String
PROMOTER_CREATE_TIME
=
"promoterCreateTime"
;
/**
* 登录场景
* 登录场景
*/
*/
public
static
final
String
MERCHANT_MEMBER_ID
=
"merchantMemberId"
;
public
static
final
String
MERCHANT_MEMBER_ID
=
"merchantMemberId"
;
...
...
pcloud-common/src/main/java/com/pcloud/common/utils/ThreadUtil.java
View file @
59cf09ff
...
@@ -2,6 +2,8 @@ package com.pcloud.common.utils;
...
@@ -2,6 +2,8 @@ package com.pcloud.common.utils;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
/**
/**
* @描述:
* @描述:
...
@@ -11,10 +13,15 @@ import java.util.Map;
...
@@ -11,10 +13,15 @@ import java.util.Map;
*/
*/
public
class
ThreadUtil
{
public
class
ThreadUtil
{
/**
* 固定长度程池
*/
public
static
final
ExecutorService
FIXED_POOL
=
Executors
.
newFixedThreadPool
(
3
);
@SuppressWarnings
(
"rawtypes"
)
@SuppressWarnings
(
"rawtypes"
)
private
static
final
ThreadLocal
ctx
=
new
ThreadLocal
();
private
static
final
ThreadLocal
ctx
=
new
ThreadLocal
();
@SuppressWarnings
({
"rawtypes"
,
"unchecked"
})
@SuppressWarnings
({
"rawtypes"
,
"unchecked"
})
public
static
void
put
(
Object
key
,
Object
value
)
{
public
static
void
put
(
Object
key
,
Object
value
)
{
Map
m
=
(
Map
)
ctx
.
get
();
Map
m
=
(
Map
)
ctx
.
get
();
if
(
m
==
null
)
{
if
(
m
==
null
)
{
...
...
pcloud-common/src/main/java/com/pcloud/common/utils/UUIDUitl.java
View file @
59cf09ff
...
@@ -6,10 +6,10 @@ import java.util.UUID;
...
@@ -6,10 +6,10 @@ import java.util.UUID;
/**
/**
* @描述:生成随机数
* @描述:生成随机数
* @作者:DiSeng.H
* @作者:DiSeng.H
* @创建时间:2016年3月10日,下午1:17:02
* @创建时间:2016年3月10日,下午1:17:02 @版本:1.0
* @版本:1.0
*/
*/
public
class
UUIDUitl
{
public
class
UUIDUitl
{
public
static
final
String
allCharStr
=
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()_+"
;
public
static
final
String
allCharStr
=
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()_+"
;
public
static
final
String
allChar
=
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
;
public
static
final
String
allChar
=
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
;
public
static
final
String
letterChar
=
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
;
public
static
final
String
letterChar
=
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
;
...
@@ -18,13 +18,39 @@ public class UUIDUitl {
...
@@ -18,13 +18,39 @@ public class UUIDUitl {
/**
/**
* 生成的token
* 生成的token
*/
*/
public
static
final
String
someCharStr
=
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@$%^&*()_+"
;
public
static
final
String
someCharStr
=
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@$%^&*()_+"
;
public
static
String
[]
chars
=
new
String
[]{
"a"
,
"b"
,
"c"
,
"d"
,
"e"
,
"f"
,
"g"
,
"h"
,
"i"
,
"j"
,
"k"
,
"l"
,
"m"
,
"n"
,
"o"
,
"p"
,
"q"
,
"r"
,
"s"
,
"t"
,
"u"
,
"v"
,
"w"
,
"x"
,
"y"
,
"z"
,
"0"
,
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"8"
,
"9"
,
"A"
,
"B"
,
"C"
,
"D"
,
"E"
,
"F"
,
"G"
,
"H"
,
"I"
,
"J"
,
"K"
,
"L"
,
"M"
,
"N"
,
"O"
,
"P"
,
"Q"
,
"R"
,
"S"
,
"T"
,
"U"
,
"V"
,
"W"
,
"X"
,
"Y"
,
"Z"
};
/**
* 生成8位不重复的随机码
*
* @return
*/
public
static
String
generateShort
()
{
StringBuffer
shortBuffer
=
new
StringBuffer
();
String
uuid
=
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
);
for
(
int
i
=
0
;
i
<
8
;
i
++)
{
String
str
=
uuid
.
substring
(
i
*
4
,
i
*
4
+
4
);
int
x
=
Integer
.
parseInt
(
str
,
16
);
shortBuffer
.
append
(
chars
[
x
%
0x3E
]);
}
return
shortBuffer
.
toString
();
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
generateShort
());
}
/**
/**
* 返回一个定长的随机字符串(只包含大小写字母、数字)
* 返回一个定长的随机字符串(只包含大小写字母、数字)
*
*
* @param length
* @param length 随机字符串长度
* 随机字符串长度
* @return 随机字符串
* @return 随机字符串
*/
*/
public
static
String
generateInteger
(
int
length
)
{
public
static
String
generateInteger
(
int
length
)
{
...
@@ -39,8 +65,7 @@ public class UUIDUitl {
...
@@ -39,8 +65,7 @@ public class UUIDUitl {
/**
/**
* 返回一个定长的随机字符串(只包含大小写字母、数字)
* 返回一个定长的随机字符串(只包含大小写字母、数字)
*
*
* @param length
* @param length 随机字符串长度
* 随机字符串长度
* @return 随机字符串
* @return 随机字符串
*/
*/
public
static
String
generateString
(
int
length
)
{
public
static
String
generateString
(
int
length
)
{
...
@@ -55,8 +80,7 @@ public class UUIDUitl {
...
@@ -55,8 +80,7 @@ public class UUIDUitl {
/**
/**
* 返回一个定长的随机字符串(只包含大小写字母、数字)
* 返回一个定长的随机字符串(只包含大小写字母、数字)
*
*
* @param length
* @param length 随机字符串长度
* 随机字符串长度
* @return 随机字符串
* @return 随机字符串
*/
*/
public
static
String
generateAllString
(
int
length
)
{
public
static
String
generateAllString
(
int
length
)
{
...
@@ -67,11 +91,11 @@ public class UUIDUitl {
...
@@ -67,11 +91,11 @@ public class UUIDUitl {
}
}
return
sb
.
toString
();
return
sb
.
toString
();
}
}
/**
/**
* 返回一个定长的随机字符串(只包含大小写字母、数字),不包含#
* 返回一个定长的随机字符串(只包含大小写字母、数字),不包含#
*
*
* @param length
* @param length 随机字符串长度
* 随机字符串长度
* @return 随机字符串
* @return 随机字符串
*/
*/
public
static
String
generateSomeString
(
int
length
)
{
public
static
String
generateSomeString
(
int
length
)
{
...
@@ -82,11 +106,11 @@ public class UUIDUitl {
...
@@ -82,11 +106,11 @@ public class UUIDUitl {
}
}
return
sb
.
toString
();
return
sb
.
toString
();
}
}
/**
/**
* 返回一个定长的随机纯字母字符串(只包含大小写字母)
* 返回一个定长的随机纯字母字符串(只包含大小写字母)
*
*
* @param length
* @param length 随机字符串长度
* 随机字符串长度
* @return 随机字符串
* @return 随机字符串
*/
*/
public
static
String
generateMixString
(
int
length
)
{
public
static
String
generateMixString
(
int
length
)
{
...
@@ -101,8 +125,7 @@ public class UUIDUitl {
...
@@ -101,8 +125,7 @@ public class UUIDUitl {
/**
/**
* 返回一个定长的随机纯大写字母字符串(只包含大小写字母)
* 返回一个定长的随机纯大写字母字符串(只包含大小写字母)
*
*
* @param length
* @param length 随机字符串长度
* 随机字符串长度
* @return 随机字符串
* @return 随机字符串
*/
*/
public
static
String
generateLowerString
(
int
length
)
{
public
static
String
generateLowerString
(
int
length
)
{
...
@@ -112,8 +135,7 @@ public class UUIDUitl {
...
@@ -112,8 +135,7 @@ public class UUIDUitl {
/**
/**
* 返回一个定长的随机纯小写字母字符串(只包含大小写字母)
* 返回一个定长的随机纯小写字母字符串(只包含大小写字母)
*
*
* @param length
* @param length 随机字符串长度
* 随机字符串长度
* @return 随机字符串
* @return 随机字符串
*/
*/
public
static
String
generateUpperString
(
int
length
)
{
public
static
String
generateUpperString
(
int
length
)
{
...
@@ -123,8 +145,7 @@ public class UUIDUitl {
...
@@ -123,8 +145,7 @@ public class UUIDUitl {
/**
/**
* 生成一个定长的纯0字符串
* 生成一个定长的纯0字符串
*
*
* @param length
* @param length 字符串长度
* 字符串长度
* @return 纯0字符串
* @return 纯0字符串
*/
*/
public
static
String
generateZeroString
(
int
length
)
{
public
static
String
generateZeroString
(
int
length
)
{
...
@@ -138,10 +159,8 @@ public class UUIDUitl {
...
@@ -138,10 +159,8 @@ public class UUIDUitl {
/**
/**
* 根据数字生成一个定长的字符串,长度不够前面补0
* 根据数字生成一个定长的字符串,长度不够前面补0
*
*
* @param num
* @param num 数字
* 数字
* @param fixdlenth 字符串长度
* @param fixdlenth
* 字符串长度
* @return 定长的字符串
* @return 定长的字符串
*/
*/
public
static
String
toFixdLengthString
(
long
num
,
int
fixdlenth
)
{
public
static
String
toFixdLengthString
(
long
num
,
int
fixdlenth
)
{
...
@@ -159,10 +178,8 @@ public class UUIDUitl {
...
@@ -159,10 +178,8 @@ public class UUIDUitl {
/**
/**
* 根据数字生成一个定长的字符串,长度不够前面补0
* 根据数字生成一个定长的字符串,长度不够前面补0
*
*
* @param num
* @param num 数字
* 数字
* @param fixdlenth 字符串长度
* @param fixdlenth
* 字符串长度
* @return 定长的字符串
* @return 定长的字符串
*/
*/
public
static
String
toFixdLengthString
(
int
num
,
int
fixdlenth
)
{
public
static
String
toFixdLengthString
(
int
num
,
int
fixdlenth
)
{
...
...
pcloud-common/src/main/java/com/pcloud/common/utils/aliyun/OssUtils.java
View file @
59cf09ff
...
@@ -40,7 +40,7 @@ import com.aliyuncs.mts.model.v20140618.SubmitSnapshotJobRequest;
...
@@ -40,7 +40,7 @@ import com.aliyuncs.mts.model.v20140618.SubmitSnapshotJobRequest;
import
com.aliyuncs.mts.model.v20140618.SubmitSnapshotJobResponse.SnapshotJob
;
import
com.aliyuncs.mts.model.v20140618.SubmitSnapshotJobResponse.SnapshotJob
;
import
com.aliyuncs.profile.DefaultProfile
;
import
com.aliyuncs.profile.DefaultProfile
;
import
com.pcloud.common.constant.AliyunConstant
;
import
com.pcloud.common.constant.AliyunConstant
;
import
com.pcloud.common.constant.FilePathConst
;
import
com.pcloud.common.constant.FilePathConst
ant
;
import
com.pcloud.common.constant.UrlConstant
;
import
com.pcloud.common.constant.UrlConstant
;
import
com.pcloud.common.dto.OssImageCropDTO
;
import
com.pcloud.common.dto.OssImageCropDTO
;
import
com.pcloud.common.dto.OssImageDTO
;
import
com.pcloud.common.dto.OssImageDTO
;
...
@@ -1600,7 +1600,7 @@ public class OssUtils {
...
@@ -1600,7 +1600,7 @@ public class OssUtils {
// 创建OSSClient实例
// 创建OSSClient实例
OSSClient
ossClient
=
getOSSClient
(
bucketName
);
OSSClient
ossClient
=
getOSSClient
(
bucketName
);
// 生成新的图片地址
// 生成新的图片地址
String
localPath
=
FilePathConst
.
IMAGE_PATH
+
UUIDUitl
.
generateString
(
32
)
+
"."
+
fileType
;
String
localPath
=
FilePathConst
ant
.
IMAGE
+
UUIDUitl
.
generateString
(
32
)
+
"."
+
fileType
;
FileUtils
.
creatFiles
(
localPath
);
FileUtils
.
creatFiles
(
localPath
);
try
{
try
{
ossClient
.
getObject
(
request
,
new
File
(
localPath
));
ossClient
.
getObject
(
request
,
new
File
(
localPath
));
...
@@ -1720,7 +1720,7 @@ public class OssUtils {
...
@@ -1720,7 +1720,7 @@ public class OssUtils {
// 创建OSSClient实例
// 创建OSSClient实例
OSSClient
ossClient
=
getOSSClient
(
bucketName
);
OSSClient
ossClient
=
getOSSClient
(
bucketName
);
// 生成带水印的本地图片地址
// 生成带水印的本地图片地址
String
localPath
=
FilePathConst
.
IMAGE_WATERMARK_PATH
+
fileName
+
"_"
+
LocalDateUtils
.
getYmdhmss
()
+
"."
String
localPath
=
FilePathConst
ant
.
IMAGE_WATERMARK
+
fileName
+
"_"
+
LocalDateUtils
.
getYmdhmss
()
+
"."
+
fileType
;
+
fileType
;
FileUtils
.
creatFiles
(
localPath
);
FileUtils
.
creatFiles
(
localPath
);
ossClient
.
getObject
(
request
,
new
File
(
localPath
));
ossClient
.
getObject
(
request
,
new
File
(
localPath
));
...
...
pcloud-common/src/main/java/com/pcloud/common/utils/httpclient/UrlUtils.java
View file @
59cf09ff
...
@@ -14,7 +14,6 @@ import org.apache.http.util.EntityUtils;
...
@@ -14,7 +14,6 @@ import org.apache.http.util.EntityUtils;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.pcloud.common.utils.rsa.MD5
;
import
com.pcloud.common.utils.rsa.MD5
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
...
@@ -25,17 +24,9 @@ import com.pcloud.common.utils.string.StringUtil;
...
@@ -25,17 +24,9 @@ import com.pcloud.common.utils.string.StringUtil;
*/
*/
public
class
UrlUtils
{
public
class
UrlUtils
{
/**
*
*/
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
UrlUtils
.
class
);
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
UrlUtils
.
class
);
/**
/**
* 请求地址(新郎接口)
*/
private
static
final
String
REQUEST_URL
=
"https://api.weibo.com/2/short_url/shorten.json?source=1681459862&url_long="
;
/**
* 请求地址(OWN)
* 请求地址(OWN)
*/
*/
private
static
final
String
REQUEST_URL2
=
"https://rays.5rs.me/convert/v1.0/url/shorten"
;
private
static
final
String
REQUEST_URL2
=
"https://rays.5rs.me/convert/v1.0/url/shorten"
;
...
@@ -51,20 +42,13 @@ public class UrlUtils {
...
@@ -51,20 +42,13 @@ public class UrlUtils {
public
static
final
String
PRIVATE_KEY
=
"lgsc1205"
;
public
static
final
String
PRIVATE_KEY
=
"lgsc1205"
;
/**
/**
* 获取短链接
(新浪)
* 获取短链接
*
*
* @param long_url
* @param long_url
* @return
* @return
*/
*/
public
static
String
getShortUrl
(
String
long_url
)
{
public
static
String
getShortUrl
(
String
long_url
)
{
String
result
=
callHttp
(
REQUEST_URL
+
long_url
);
return
getShortUrl4Own
(
long_url
);
if
(
StringUtil
.
isEmpty
(
result
))
{
return
null
;
}
JSONObject
resultObject
=
JSONObject
.
parseObject
(
result
);
JSONArray
array
=
resultObject
.
getJSONArray
(
"urls"
);
JSONObject
object
=
array
.
getJSONObject
(
0
);
return
object
.
getString
(
"url_short"
);
}
}
/**
/**
...
...
pcloud-common/src/main/java/com/pcloud/common/utils/pdf/PdfUtils.java
View file @
59cf09ff
...
@@ -29,7 +29,7 @@ import com.itextpdf.text.pdf.PdfPTable;
...
@@ -29,7 +29,7 @@ import com.itextpdf.text.pdf.PdfPTable;
import
com.itextpdf.text.pdf.PdfReader
;
import
com.itextpdf.text.pdf.PdfReader
;
import
com.itextpdf.text.pdf.PdfStamper
;
import
com.itextpdf.text.pdf.PdfStamper
;
import
com.itextpdf.text.pdf.PdfWriter
;
import
com.itextpdf.text.pdf.PdfWriter
;
import
com.pcloud.common.constant.FilePathConst
;
import
com.pcloud.common.constant.FilePathConst
ant
;
import
com.pcloud.common.entity.UploadResultInfo
;
import
com.pcloud.common.entity.UploadResultInfo
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.FileException
;
import
com.pcloud.common.exceptions.FileException
;
...
@@ -105,7 +105,7 @@ public class PdfUtils {
...
@@ -105,7 +105,7 @@ public class PdfUtils {
*/
*/
private
static
String
pdfConvert
(
byte
[]
b
,
String
fileName
,
String
prefix
,
String
format
)
throws
FileException
{
private
static
String
pdfConvert
(
byte
[]
b
,
String
fileName
,
String
prefix
,
String
format
)
throws
FileException
{
// 解析PDF文件
// 解析PDF文件
String
outPath
=
FilePathConst
.
PDF_PATH
+
fileName
+
"_"
+
UUIDUitl
.
generateString
(
12
);
String
outPath
=
FilePathConst
ant
.
PDF
+
fileName
+
"_"
+
UUIDUitl
.
generateString
(
12
);
File
fi
=
new
File
(
outPath
);
File
fi
=
new
File
(
outPath
);
if
(!
fi
.
exists
())
{
if
(!
fi
.
exists
())
{
fi
.
mkdirs
();
fi
.
mkdirs
();
...
@@ -161,7 +161,7 @@ public class PdfUtils {
...
@@ -161,7 +161,7 @@ public class PdfUtils {
/**
/**
* 创建PDF
* 创建PDF
*
*
* @param pdf
ChunkD
Os
* @param pdf
P
Os
* @return
* @return
* @throws Exception
* @throws Exception
*/
*/
...
@@ -176,7 +176,7 @@ public class PdfUtils {
...
@@ -176,7 +176,7 @@ public class PdfUtils {
OutputStream
os
=
null
;
OutputStream
os
=
null
;
try
{
try
{
// 输出路径
// 输出路径
outPath
=
FilePathConst
.
PDF_PATH
+
UUIDUitl
.
taskName
()
+
".pdf"
;
outPath
=
FilePathConst
ant
.
PDF
+
UUIDUitl
.
taskName
()
+
".pdf"
;
FileUtils
.
creatFiles
(
outPath
);
FileUtils
.
creatFiles
(
outPath
);
// 创建输出流
// 创建输出流
os
=
new
FileOutputStream
(
new
File
(
outPath
));
os
=
new
FileOutputStream
(
new
File
(
outPath
));
...
@@ -358,10 +358,8 @@ public class PdfUtils {
...
@@ -358,10 +358,8 @@ public class PdfUtils {
/**
/**
* 加水印(字符串)
* 加水印(字符串)
*
*
* @param
inputFile
* @param
filePath
* 需要加水印的PDF路径
* 需要加水印的PDF路径
* @param outputFile
* 输出生成PDF的路径
* @param waterMarkName
* @param waterMarkName
* 水印字符
* 水印字符
*/
*/
...
...
pcloud-common/src/main/java/com/pcloud/common/utils/string/StringUtil.java
View file @
59cf09ff
...
@@ -591,4 +591,19 @@ public class StringUtil extends StringUtilParent {
...
@@ -591,4 +591,19 @@ public class StringUtil extends StringUtilParent {
return
false
;
return
false
;
}
}
/**
* 过滤HTML标签
*
* @param str
* @return
*/
public
static
String
replaceHtml
(
String
str
)
{
if
(
StringUtil
.
isEmpty
(
str
))
{
return
""
;
}
Pattern
p_html
=
Pattern
.
compile
(
"<[^>]+>"
,
Pattern
.
CASE_INSENSITIVE
);
Matcher
m_html
=
p_html
.
matcher
(
str
);
return
m_html
.
replaceAll
(
""
).
replaceAll
(
" "
,
""
);
}
}
}
pcloud-common/src/main/java/com/pcloud/common/utils/word/WordNewUtils.java
View file @
59cf09ff
...
@@ -27,7 +27,7 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.STTblWidth;
...
@@ -27,7 +27,7 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.STTblWidth;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
com.pcloud.common.constant.FilePathConst
;
import
com.pcloud.common.constant.FilePathConst
ant
;
import
com.pcloud.common.constant.WordConstant
;
import
com.pcloud.common.constant.WordConstant
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.FileException
;
import
com.pcloud.common.exceptions.FileException
;
...
@@ -152,14 +152,14 @@ public class WordNewUtils {
...
@@ -152,14 +152,14 @@ public class WordNewUtils {
CustomXWPFDocument
document
=
null
;
CustomXWPFDocument
document
=
null
;
FileOutputStream
fos
=
null
;
FileOutputStream
fos
=
null
;
try
{
try
{
wordTemplate
=
FilePathConst
.
WORD_PATH
+
UUIDUitl
.
taskName
()
+
".docx"
;
wordTemplate
=
FilePathConst
ant
.
WORD
+
UUIDUitl
.
taskName
()
+
".docx"
;
FileUtils
.
downloadFileFromUrl
(
WordConstant
.
TEMPLATE_URL
,
wordTemplate
);
FileUtils
.
downloadFileFromUrl
(
WordConstant
.
TEMPLATE_URL
,
wordTemplate
);
OPCPackage
pack
=
POIXMLDocument
.
openPackage
(
wordTemplate
);
OPCPackage
pack
=
POIXMLDocument
.
openPackage
(
wordTemplate
);
document
=
new
CustomXWPFDocument
(
pack
);
document
=
new
CustomXWPFDocument
(
pack
);
// 添加内容到文档中
// 添加内容到文档中
addParagraphs
(
wordDTO
,
document
);
addParagraphs
(
wordDTO
,
document
);
// 生成目标word
// 生成目标word
outPath
=
FilePathConst
.
WORD_PATH
+
UUIDUitl
.
taskName
()
+
".docx"
;
outPath
=
FilePathConst
ant
.
WORD
+
UUIDUitl
.
taskName
()
+
".docx"
;
fos
=
new
FileOutputStream
(
outPath
);
fos
=
new
FileOutputStream
(
outPath
);
document
.
write
(
fos
);
document
.
write
(
fos
);
fos
.
flush
();
fos
.
flush
();
...
...
pcloud-common/src/main/java/com/pcloud/common/utils/word/WordUtils.java
View file @
59cf09ff
...
@@ -41,7 +41,7 @@ import com.lowagie.text.Paragraph;
...
@@ -41,7 +41,7 @@ import com.lowagie.text.Paragraph;
import
com.lowagie.text.Phrase
;
import
com.lowagie.text.Phrase
;
import
com.lowagie.text.Table
;
import
com.lowagie.text.Table
;
import
com.lowagie.text.rtf.RtfWriter2
;
import
com.lowagie.text.rtf.RtfWriter2
;
import
com.pcloud.common.constant.FilePathConst
;
import
com.pcloud.common.constant.FilePathConst
ant
;
import
com.pcloud.common.constant.WordConstant
;
import
com.pcloud.common.constant.WordConstant
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.exceptions.FileException
;
import
com.pcloud.common.exceptions.FileException
;
...
@@ -84,7 +84,7 @@ public class WordUtils {
...
@@ -84,7 +84,7 @@ public class WordUtils {
RtfWriter2
rtfWriter2
=
null
;
RtfWriter2
rtfWriter2
=
null
;
try
{
try
{
// 输出路径
// 输出路径
outPath
=
FilePathConst
.
WORD_PATH
+
UUIDUitl
.
taskName
()
+
".doc"
;
outPath
=
FilePathConst
ant
.
WORD
+
UUIDUitl
.
taskName
()
+
".doc"
;
FileUtils
.
creatFiles
(
outPath
);
FileUtils
.
creatFiles
(
outPath
);
// 创建输出流
// 创建输出流
os
=
new
FileOutputStream
(
new
File
(
outPath
));
os
=
new
FileOutputStream
(
new
File
(
outPath
));
...
@@ -302,14 +302,14 @@ public class WordUtils {
...
@@ -302,14 +302,14 @@ public class WordUtils {
CustomXWPFDocument
document
=
null
;
CustomXWPFDocument
document
=
null
;
FileOutputStream
fos
=
null
;
FileOutputStream
fos
=
null
;
try
{
try
{
wordTemplate
=
FilePathConst
.
WORD_PATH
+
UUIDUitl
.
taskName
()
+
".docx"
;
wordTemplate
=
FilePathConst
ant
.
WORD
+
UUIDUitl
.
taskName
()
+
".docx"
;
FileUtils
.
downloadFileFromUrl
(
WordConstant
.
TEMPLATE_URL
,
wordTemplate
);
FileUtils
.
downloadFileFromUrl
(
WordConstant
.
TEMPLATE_URL
,
wordTemplate
);
OPCPackage
pack
=
POIXMLDocument
.
openPackage
(
wordTemplate
);
OPCPackage
pack
=
POIXMLDocument
.
openPackage
(
wordTemplate
);
document
=
new
CustomXWPFDocument
(
pack
);
document
=
new
CustomXWPFDocument
(
pack
);
// 添加内容到文档中
// 添加内容到文档中
addChunks
(
wordPOs
,
document
);
addChunks
(
wordPOs
,
document
);
// 生成目标word
// 生成目标word
outPath
=
FilePathConst
.
WORD_PATH
+
UUIDUitl
.
taskName
()
+
".docx"
;
outPath
=
FilePathConst
ant
.
WORD
+
UUIDUitl
.
taskName
()
+
".docx"
;
fos
=
new
FileOutputStream
(
outPath
);
fos
=
new
FileOutputStream
(
outPath
);
document
.
write
(
fos
);
document
.
write
(
fos
);
fos
.
flush
();
fos
.
flush
();
...
...
pcloud-solr/src/main/java/com/pcloud/solr/SolrDto.java
View file @
59cf09ff
...
@@ -127,6 +127,12 @@ public class SolrDto implements Serializable {
...
@@ -127,6 +127,12 @@ public class SolrDto implements Serializable {
@Field
@Field
private
Long
channelId
;
private
Long
channelId
;
/**
* 场景编码
*/
@Field
private
String
sceneCode
;
public
String
getId
()
{
public
String
getId
()
{
return
id
;
return
id
;
}
}
...
@@ -282,6 +288,14 @@ public class SolrDto implements Serializable {
...
@@ -282,6 +288,14 @@ public class SolrDto implements Serializable {
this
.
saleState
=
saleState
;
this
.
saleState
=
saleState
;
}
}
public
String
getSceneCode
()
{
return
sceneCode
;
}
public
void
setSceneCode
(
String
sceneCode
)
{
this
.
sceneCode
=
sceneCode
;
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"SolrDto{"
+
return
"SolrDto{"
+
...
@@ -292,6 +306,7 @@ public class SolrDto implements Serializable {
...
@@ -292,6 +306,7 @@ public class SolrDto implements Serializable {
", typeId="
+
typeId
+
", typeId="
+
typeId
+
", typeCode='"
+
typeCode
+
'\''
+
", typeCode='"
+
typeCode
+
'\''
+
", typeName='"
+
typeName
+
'\''
+
", typeName='"
+
typeName
+
'\''
+
", sceneCode='"
+
sceneCode
+
'\''
+
", startDate="
+
startDate
+
", startDate="
+
startDate
+
", endDate="
+
endDate
+
", endDate="
+
endDate
+
", saleState="
+
saleState
+
", saleState="
+
saleState
+
...
...
pcloud-solr/src/main/java/com/pcloud/solr/SolrQueryParam.java
View file @
59cf09ff
...
@@ -44,7 +44,7 @@ public class SolrQueryParam {
...
@@ -44,7 +44,7 @@ public class SolrQueryParam {
/**
/**
* 返回字段
* 返回字段
*/
*/
private
String
fl
=
"id,saleId,saleCode,typeId,typeCode,typeName,title,startDate,endDate,coverImg,description,createdUser,createdDate,lastModifiedDate,channelId"
;
private
String
fl
=
"id,saleId,saleCode,typeId,typeCode,typeName,title,startDate,endDate,coverImg,description,createdUser,createdDate,lastModifiedDate,channelId
,saleState,sceneCode
"
;
public
String
getQ
()
{
public
String
getQ
()
{
return
q
;
return
q
;
...
...
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