Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SmartBox
Project
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
苗权威
SmartBox
Commits
41e7e3b7
Commit
41e7e3b7
authored
Aug 30, 2019
by
苗权威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
8.30
parent
cafc9711
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
311 additions
and
8 deletions
+311
-8
workspace.xml
.idea/workspace.xml
+0
-0
TTService.java
.../main/java/ai/qiwu/com/tts_service/service/TTService.java
+1
-1
Utils.java
...me/src/main/java/ai/qiwu/com/xiaoduhome/common/Utils.java
+3
-1
TempleUtils.java
...ava/ai/qiwu/com/xiaoduhome/common/temple/TempleUtils.java
+86
-3
FunnyDocument.java
...iwu/com/xiaoduhome/common/temple/funny/FunnyDocument.java
+20
-0
FunnyMainTemplate.java
...com/xiaoduhome/common/temple/funny/FunnyMainTemplate.java
+24
-0
FunnyPageItemData.java
...com/xiaoduhome/common/temple/funny/FunnyPageItemData.java
+13
-0
FunnyPojo.java
...ai/qiwu/com/xiaoduhome/common/temple/funny/FunnyPojo.java
+48
-0
XiaoDuHomeController.java
.../qiwu/com/xiaoduhome/controller/XiaoDuHomeController.java
+1
-0
AppFlowerTB.java
...va/ai/qiwu/com/xiaoduhome/entity/primary/AppFlowerTB.java
+2
-1
AppFlowerTBRepository.java
.../xiaoduhome/repository/primary/AppFlowerTBRepository.java
+3
-0
XiaoDuOrderTbRepository.java
...oduhome/repository/secondary/XiaoDuOrderTbRepository.java
+3
-1
DplBotService.java
...in/java/ai/qiwu/com/xiaoduhome/service/DplBotService.java
+0
-0
ScheduleService.java
.../java/ai/qiwu/com/xiaoduhome/service/ScheduleService.java
+12
-1
funny.json
xiaoduhome/src/main/resources/static/json/funny.json
+63
-0
funnyPageItem.json
xiaoduhome/src/main/resources/static/json/funnyPageItem.json
+32
-0
No files found.
.idea/workspace.xml
View file @
41e7e3b7
This diff is collapsed.
Click to expand it.
tts_service/src/main/java/ai/qiwu/com/tts_service/service/TTService.java
View file @
41e7e3b7
...
...
@@ -254,7 +254,7 @@ public class TTService {
// ResponseCodeWithData data = future.get(60, TimeUnit.SECONDS);
ResponseCodeWithData
data
=
future
.
get
();
if
(
data
.
getCode
()
!=
200
)
{
log
.
error
(
"下载
:{}
音频失败, status:{}"
,
data
.
getCode
());
log
.
error
(
"下载音频失败, status:{}"
,
data
.
getCode
());
TTServiceUtil
.
buildTTS_lsResponse
(
response
,
new
TTSResponse
(
data
.
getCode
()),
null
,
data
.
getCode
());
return
;
}
...
...
xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/Utils.java
View file @
41e7e3b7
...
...
@@ -105,7 +105,9 @@ public class Utils {
String
[]
names
=
word
.
split
(
"、"
);
List
<
String
>
botNames
=
new
ArrayList
<>();
for
(
String
name
:
names
)
{
botNames
.
add
(
name
.
substring
(
1
,
name
.
length
()-
1
));
int
i
=
name
.
indexOf
(
":"
);
if
(
i
==
-
1
)
i
=
name
.
length
()-
1
;
botNames
.
add
(
name
.
substring
(
1
,
i
));
}
return
botNames
;
}
...
...
xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/TempleUtils.java
View file @
41e7e3b7
...
...
@@ -2,6 +2,9 @@ package ai.qiwu.com.xiaoduhome.common.temple;
import
ai.qiwu.com.xiaoduhome.common.BaseHolder
;
import
ai.qiwu.com.xiaoduhome.common.Constants
;
import
ai.qiwu.com.xiaoduhome.common.temple.funny.FunnyDocument
;
import
ai.qiwu.com.xiaoduhome.common.temple.funny.FunnyPageItemData
;
import
ai.qiwu.com.xiaoduhome.common.temple.funny.FunnyPojo
;
import
ai.qiwu.com.xiaoduhome.common.temple.playUpdate.PlayUpdateDocument
;
import
ai.qiwu.com.xiaoduhome.common.temple.playUpdate.PlayUpdatePojo
;
import
ai.qiwu.com.xiaoduhome.common.temple.rank.RankBotInfo
;
...
...
@@ -63,6 +66,23 @@ public class TempleUtils {
return
document
;
}
public
static
FunnyDocument
getFunnyDocument
(
List
<
OnProductDetail
>
bots
)
{
FunnyDocument
document
=
JSON
.
parseObject
(
getDPLTemple
(
"static/json/funny.json"
),
FunnyDocument
.
class
);
List
<
FunnyPageItemData
>
datas
=
new
ArrayList
<>();
FunnyPojo
page
=
document
.
getMainTemplate
().
getItems
().
get
(
1
).
getItems
().
get
(
0
);
List
<
FunnyPojo
>
dataList
=
new
ArrayList
<>();
page
.
setItems
(
dataList
);
for
(
OnProductDetail
bot
:
bots
)
{
FunnyPageItemData
data
=
new
FunnyPageItemData
();
data
.
setImgSrc
(
new
StringBuilder
(
Constants
.
IMG_PREFIX
).
append
(
bot
.
getBannerImgUrl
()).
toString
());
data
.
setText
(
bot
.
getIntro
());
datas
.
add
(
data
);
dataList
.
add
(
getFunnyPageItemPojo
());
}
page
.
setData
(
datas
);
return
document
;
}
public
static
RankingDocument
getRanking
()
{
if
(
RANKING_DOCUMENT
!=
null
)
{
return
RANKING_DOCUMENT
;
...
...
@@ -228,8 +248,71 @@ public class TempleUtils {
return
FRAME_CATEGORY
;
}
public
static
void
main
(
String
[]
args
)
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
);
System
.
out
.
println
(
sdf
.
format
(
new
java
.
sql
.
Date
(
1566887509312L
)));
private
static
FunnyPojo
getFunnyPageItemPojo
()
{
FunnyPojo
pojo
=
new
FunnyPojo
();
pojo
.
setType
(
"Container"
);
pojo
.
setFlexDirection
(
"row"
);
pojo
.
setWidth
(
"100%"
);
pojo
.
setHeight
(
"100%"
);
FunnyPojo
image
=
new
FunnyPojo
();
image
.
setSrc
(
"${data.imgSrc}"
);
image
.
setType
(
"Image"
);
image
.
setMarginTop
(
"30dp"
);
image
.
setHeight
(
"400dp"
);
image
.
setWidth
(
"400dp"
);
image
.
setMarginLeft
(
"25dp"
);
FunnyPojo
textContainer
=
new
FunnyPojo
();
textContainer
.
setType
(
"Container"
);
textContainer
.
setWidth
(
"500dp"
);
textContainer
.
setHeight
(
"100%"
);
FunnyPojo
text
=
new
FunnyPojo
();
text
.
setType
(
"Text"
);
text
.
setText
(
"${data.text}"
);
text
.
setFontSize
(
"25dp"
);
text
.
setLineHeight
(
"60dp"
);
text
.
setMarginTop
(
"20dp"
);
text
.
setMarginLeft
(
"10dp"
);
List
<
FunnyPojo
>
textContainerItems
=
new
ArrayList
<>();
textContainerItems
.
add
(
text
);
textContainer
.
setItems
(
textContainerItems
);
List
<
FunnyPojo
>
pojoItems
=
new
ArrayList
<>();
pojoItems
.
add
(
image
);
pojoItems
.
add
(
textContainer
);
pojo
.
setItems
(
pojoItems
);
return
pojo
;
}
public
static
void
main
(
String
[]
args
)
throws
IOException
,
CloneNotSupportedException
{
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
// System.out.println(sdf.format(new java.sql.Date(1566887509312L)));
new
Thread
(()
->
{
int
i
=
3000
;
long
start
=
System
.
currentTimeMillis
();
while
(
i
--
>
0
)
{
try
{
FunnyPojo
pageItem
=
JSON
.
parseObject
(
getJsonFromName
(
"static/json/funnyPageItem.json"
),
FunnyPojo
.
class
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
long
end
=
System
.
currentTimeMillis
();
System
.
out
.
println
(
"JSON:"
+(
end
-
start
));
}).
start
();
new
Thread
(()
->
{
int
i
=
3000
;
long
start
=
System
.
currentTimeMillis
();
while
(
i
--
>
0
)
{
getFunnyPageItemPojo
();
}
long
end
=
System
.
currentTimeMillis
();
System
.
out
.
println
(
"TEST:"
+(
end
-
start
));
}).
start
();
}
}
xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/funny/FunnyDocument.java
0 → 100644
View file @
41e7e3b7
package
ai
.
qiwu
.
com
.
xiaoduhome
.
common
.
temple
.
funny
;
import
com.baidu.dueros.data.response.directive.dpl.Document
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
lombok.Data
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.ToString
;
/**
* @author 苗权威
* @dateTime 19-8-30 上午11:28
*/
@Getter
@Setter
@ToString
@JsonSerialize
(
include
=
JsonSerialize
.
Inclusion
.
NON_NULL
)
public
class
FunnyDocument
extends
Document
{
private
FunnyMainTemplate
mainTemplate
;
}
xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/funny/FunnyMainTemplate.java
0 → 100644
View file @
41e7e3b7
package
ai
.
qiwu
.
com
.
xiaoduhome
.
common
.
temple
.
funny
;
import
ai.qiwu.com.xiaoduhome.common.temple.rank.RankingPojo
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author 苗权威
* @dateTime 19-8-30 上午11:28
*/
@Data
@JsonSerialize
(
include
=
JsonSerialize
.
Inclusion
.
NON_NULL
)
public
class
FunnyMainTemplate
{
private
List
<
String
>
parameters
=
new
ArrayList
<>();
private
List
<
FunnyPojo
>
items
;
public
FunnyMainTemplate
()
{
this
.
parameters
.
add
(
"payload"
);
this
.
items
=
new
ArrayList
<>();
}
}
xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/funny/FunnyPageItemData.java
0 → 100644
View file @
41e7e3b7
package
ai
.
qiwu
.
com
.
xiaoduhome
.
common
.
temple
.
funny
;
import
lombok.Data
;
/**
* @author 苗权威
* @dateTime 19-8-30 下午1:09
*/
@Data
public
class
FunnyPageItemData
{
private
String
imgSrc
;
private
String
text
;
}
xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/temple/funny/FunnyPojo.java
0 → 100644
View file @
41e7e3b7
package
ai
.
qiwu
.
com
.
xiaoduhome
.
common
.
temple
.
funny
;
import
ai.qiwu.com.xiaoduhome.pojo.dpl.Event
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author 苗权威
* @dateTime 19-8-30 上午11:18
*/
@Data
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
@JsonSerialize
(
include
=
JsonSerialize
.
Inclusion
.
NON_NULL
)
public
class
FunnyPojo
{
private
String
type
;
private
String
height
;
private
String
width
;
private
String
position
;
private
String
left
;
private
String
top
;
private
String
src
;
private
List
<
FunnyPojo
>
items
;
private
String
headerTitle
;
private
Boolean
hasBackIcon
;
@JsonProperty
(
"flex-direction"
)
private
String
flexDirection
;
@JsonProperty
(
"margin-top"
)
private
String
marginTop
;
@JsonProperty
(
"margin-left"
)
private
String
marginLeft
;
@JsonProperty
(
"font-size"
)
private
String
fontSize
;
@JsonProperty
(
"line-height"
)
private
String
lineHeight
;
private
List
<
FunnyPageItemData
>
data
;
private
String
text
;
private
String
bottom
;
private
List
<
String
>
hints
;
private
String
direction
;
private
String
componentId
;
private
String
looping
;
private
String
autoplay
;
private
List
<
Event
>
onLoaded
;
}
xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/controller/XiaoDuHomeController.java
View file @
41e7e3b7
...
...
@@ -5,6 +5,7 @@ import ai.qiwu.com.xiaoduhome.service.DplBotService;
import
ai.qiwu.com.xiaoduhome.service.ResponseEncapsulation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.util.ResourceUtils
;
import
org.springframework.web.bind.annotation.CrossOrigin
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/entity/primary/AppFlowerTB.java
View file @
41e7e3b7
...
...
@@ -45,7 +45,8 @@ public class AppFlowerTB {
@Column
private
Integer
status
;
@Column
(
name
=
"gmt_create"
)
@CreatedDate
@Column
(
name
=
"gmt_create"
,
nullable
=
false
,
updatable
=
false
)
private
Date
createTime
;
@Column
(
name
=
"gmt_modified"
)
...
...
xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/repository/primary/AppFlowerTBRepository.java
View file @
41e7e3b7
...
...
@@ -5,6 +5,7 @@ import org.springframework.data.domain.Example;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* @author 苗权威
...
...
@@ -13,9 +14,11 @@ import org.springframework.stereotype.Repository;
@Repository
public
interface
AppFlowerTBRepository
extends
JpaRepository
<
AppFlowerTB
,
Integer
>
{
@Transactional
@Query
(
value
=
"INSERT INTO app_flower_tb (module,bot_username,user_id,unit_price,number,order_id,status,gmt_create,gmt_modified) VALUES (0,?1,?2,1,1,?3,1,?4,?4)"
,
nativeQuery
=
true
)
void
insertOrder
(
String
botId
,
String
userId
,
String
orderId
,
String
time
);
@Transactional
@Override
<
S
extends
AppFlowerTB
>
S
save
(
S
s
);
...
...
xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/repository/secondary/XiaoDuOrderTbRepository.java
View file @
41e7e3b7
...
...
@@ -24,10 +24,12 @@ public interface XiaoDuOrderTbRepository extends JpaRepository<XiaoDuOrderTB, In
<
S
extends
XiaoDuOrderTB
>
S
saveAndFlush
(
S
s
);
@Transactional
@Query
(
value
=
"UPDATE xiaodu_order_
id
SET creation_timestamp=?2,order_id=?3,status=1,update_time=now() WHERE ch_order_id=?1"
,
nativeQuery
=
true
)
@Query
(
value
=
"UPDATE xiaodu_order_
tb
SET creation_timestamp=?2,order_id=?3,status=1,update_time=now() WHERE ch_order_id=?1"
,
nativeQuery
=
true
)
void
updateAterSeccessPayed
(
String
chOrderId
,
String
creationTimestamp
,
String
orderId
);
@Transactional
@Override
void
delete
(
XiaoDuOrderTB
xiaoDuOrderTB
);
void
deleteByStatus
(
Boolean
status
);
}
xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/DplBotService.java
View file @
41e7e3b7
This diff is collapsed.
Click to expand it.
xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/ScheduleService.java
View file @
41e7e3b7
...
...
@@ -6,6 +6,7 @@ import ai.qiwu.com.xiaoduhome.repository.primary.AllOnProductInfoRepository;
import
ai.qiwu.com.xiaoduhome.repository.primary.GameProjectTbRepository
;
import
ai.qiwu.com.xiaoduhome.repository.primary.ProjectLabelRepository
;
import
ai.qiwu.com.xiaoduhome.repository.secondary.XiaoDuHistoryTBRepository
;
import
ai.qiwu.com.xiaoduhome.repository.secondary.XiaoDuOrderTbRepository
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -44,13 +45,16 @@ public class ScheduleService implements InitializingBean {
private
final
XiaoDuHistoryTBRepository
xiaoDuHistoryTBRepository
;
private
final
XiaoDuOrderTbRepository
xiaoDuOrderTbRepository
;
@Autowired
public
ScheduleService
(
GameProjectTbRepository
gameProjectTbRepository
,
ProjectLabelRepository
projectLabelRepository
,
AllOnProductInfoRepository
allOnProductInfoRepository
,
XiaoDuHistoryTBRepository
xiaoDuHistoryTBRepository
)
{
ProjectLabelRepository
projectLabelRepository
,
AllOnProductInfoRepository
allOnProductInfoRepository
,
XiaoDuHistoryTBRepository
xiaoDuHistoryTBRepository
,
XiaoDuOrderTbRepository
xiaoDuOrderTbRepository
)
{
this
.
gameProjectTbRepository
=
gameProjectTbRepository
;
this
.
projectLabelRepository
=
projectLabelRepository
;
this
.
allOnProductInfoRepository
=
allOnProductInfoRepository
;
this
.
xiaoDuHistoryTBRepository
=
xiaoDuHistoryTBRepository
;
this
.
xiaoDuOrderTbRepository
=
xiaoDuOrderTbRepository
;
}
@Scheduled
(
cron
=
"0 0 19 * * ?"
)
...
...
@@ -113,6 +117,13 @@ public class ScheduleService implements InitializingBean {
//log.error("清理历史记录数据库出错:{}", e.toString());
}
@Scheduled
(
cron
=
"0 0 3 * * ?"
)
public
void
deleteUnPayedOrder
()
{
new
Thread
(()
->
{
xiaoDuOrderTbRepository
.
deleteByStatus
(
false
);
}).
start
();
}
@Override
public
void
afterPropertiesSet
()
throws
Exception
{
initAllOnTableProductInfo
();
...
...
xiaoduhome/src/main/resources/static/json/funny.json
0 → 100644
View file @
41e7e3b7
{
"type"
:
"DPL"
,
"version"
:
"1.0"
,
"mainTemplate"
:
{
"parameters"
:
[
"payload"
],
"items"
:
[
{
"type"
:
"Image"
,
"height"
:
"100%"
,
"width"
:
"100%"
,
"position"
:
"absolute"
,
"left"
:
"0dp"
,
"top"
:
"0dp"
,
"src"
:
"https://aliyun-hz1.chewrobot.com/xiaoduhome/image/backend.jpg"
},
{
"type"
:
"Container"
,
"width"
:
"100%"
,
"height"
:
"100%"
,
"items"
:
[
{
"type"
:
"Pager"
,
"direction"
:
"horizontal"
,
"componentId"
:
"funnyPage"
,
"width"
:
"100%"
,
"height"
:
"100%"
,
"onLoaded"
:
[
{
"type"
:
"AutoPage"
,
"componentId"
:
"funnyPage"
,
"durationInMillisecond"
:
3000
}
]
}
]
},
{
"type"
:
"Audio"
,
"componentId"
:
"audioCom"
,
"looping"
:
"false"
,
"autoplay"
:
"true"
},
{
"type"
:
"Container"
,
"position"
:
"absolute"
,
"width"
:
"100%"
,
"left"
:
"0"
,
"bottom"
:
"0"
,
"items"
:
[
{
"type"
:
"Footer"
,
"hints"
:
[
"返回/回到首页"
,
"可左右滑动"
]
}
]
}
]
}
}
\ No newline at end of file
xiaoduhome/src/main/resources/static/json/funnyPageItem.json
0 → 100644
View file @
41e7e3b7
{
"type"
:
"Container"
,
"flex-direction"
:
"row"
,
"width"
:
"100%"
,
"height"
:
"100%"
,
"items"
:
[
{
"type"
:
"Image"
,
"margin-top"
:
"30dp"
,
"height"
:
"400dp"
,
"width"
:
"400dp"
,
"margin-left"
:
"25dp"
,
"src"
:
"${data.imgSrc}"
},
{
"type"
:
"Container"
,
"width"
:
"500dp"
,
"height"
:
"100%"
,
"items"
:
[
{
"type"
:
"Text"
,
"text"
:
"${data.text}"
,
"font-size"
:
"25dp"
,
"line-height"
:
"60dp"
,
"margin-top"
:
"30dp"
,
"margin-left"
:
"10dp"
}
]
}
]
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment