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
cafc9711
Commit
cafc9711
authored
Aug 29, 2019
by
苗权威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
8.29
parent
a1aa3fa5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
62 additions
and
27 deletions
+62
-27
workspace.xml
.idea/workspace.xml
+0
-0
Constants.java
...rc/main/java/ai/qiwu/com/xiaoduhome/common/Constants.java
+2
-0
OkHttp3Utils.java
...main/java/ai/qiwu/com/xiaoduhome/common/OkHttp3Utils.java
+2
-2
Utils.java
...me/src/main/java/ai/qiwu/com/xiaoduhome/common/Utils.java
+15
-4
XiaoDuOrderTB.java
...i/qiwu/com/xiaoduhome/entity/secondary/XiaoDuOrderTB.java
+9
-0
XiaoDuOrderTbRepository.java
...oduhome/repository/secondary/XiaoDuOrderTbRepository.java
+13
-0
DplBotService.java
...in/java/ai/qiwu/com/xiaoduhome/service/DplBotService.java
+0
-0
RequestTerminal.java
.../java/ai/qiwu/com/xiaoduhome/service/RequestTerminal.java
+16
-1
ScheduleService.java
.../java/ai/qiwu/com/xiaoduhome/service/ScheduleService.java
+5
-20
No files found.
.idea/workspace.xml
View file @
cafc9711
This diff is collapsed.
Click to expand it.
xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/Constants.java
View file @
cafc9711
...
@@ -30,6 +30,7 @@ public interface Constants {
...
@@ -30,6 +30,7 @@ public interface Constants {
String
LOAD_INTRO
=
"扫描二维码输入手机号获取验证码登录"
;
String
LOAD_INTRO
=
"扫描二维码输入手机号获取验证码登录"
;
String
REWARD_FLOWER
=
"请扫码支付"
;
String
REWARD_FLOWER
=
"请扫码支付"
;
String
UNIT_PRICE
=
"1"
;
interface
DPL_COMPONENT_ID
{
interface
DPL_COMPONENT_ID
{
String
FLOWE
=
"flowe"
;
String
FLOWE
=
"flowe"
;
...
@@ -93,6 +94,7 @@ public interface Constants {
...
@@ -93,6 +94,7 @@ public interface Constants {
String
BEGIN_NO_RESPONSE
=
"咋还没开始就停住了,我们这里可有很多好玩的作品哦"
;
String
BEGIN_NO_RESPONSE
=
"咋还没开始就停住了,我们这里可有很多好玩的作品哦"
;
String
GUIDE_WORD
=
"请点击或者直接说出您想要玩的作品名"
;
String
GUIDE_WORD
=
"请点击或者直接说出您想要玩的作品名"
;
String
FAIL_COLLECT
=
"好像出了什么问题,请再说一遍吧"
;
String
FAIL_COLLECT
=
"好像出了什么问题,请再说一遍吧"
;
String
ERROR_SEND_FLOWER
=
"好像出了什么问题,我们终止了该订单"
;
}
}
interface
EndMsg
{
interface
EndMsg
{
...
...
xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/OkHttp3Utils.java
View file @
cafc9711
...
@@ -19,8 +19,8 @@ import java.util.concurrent.TimeUnit;
...
@@ -19,8 +19,8 @@ import java.util.concurrent.TimeUnit;
@Slf4j
@Slf4j
public
class
OkHttp3Utils
{
public
class
OkHttp3Utils
{
private
static
final
OkHttpClient
client
=
new
OkHttpClient
.
Builder
()
private
static
final
OkHttpClient
client
=
new
OkHttpClient
.
Builder
()
.
connectTimeout
(
15
,
TimeUnit
.
SECONDS
)
.
connectTimeout
(
60
,
TimeUnit
.
SECONDS
)
.
readTimeout
(
15
,
TimeUnit
.
SECONDS
)
.
readTimeout
(
60
,
TimeUnit
.
SECONDS
)
.
build
();
.
build
();
public
static
String
doGet
(
String
url
)
throws
IOException
{
public
static
String
doGet
(
String
url
)
throws
IOException
{
...
...
xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/common/Utils.java
View file @
cafc9711
package
ai
.
qiwu
.
com
.
xiaoduhome
.
common
;
package
ai
.
qiwu
.
com
.
xiaoduhome
.
common
;
import
ai.qiwu.com.xiaoduhome.pojo.Payload
;
import
ai.qiwu.com.xiaoduhome.pojo.UserInfoByTokenResult
;
import
com.alibaba.fastjson.JSON
;
import
org.apache.commons.codec.binary.Base64
;
import
org.apache.commons.codec.binary.Base64
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.charset.StandardCharsets
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Objects
;
/**
/**
...
@@ -99,8 +98,20 @@ public class Utils {
...
@@ -99,8 +98,20 @@ public class Utils {
return
Constants
.
XIAOWU_API
.
BASIC_PREFIX
+
str
;
return
Constants
.
XIAOWU_API
.
BASIC_PREFIX
+
str
;
}
}
public
static
List
<
String
>
getRecommandBotNames
(
String
word
)
{
int
start
=
word
.
indexOf
(
"《"
);
int
end
=
word
.
lastIndexOf
(
"》"
);
word
=
word
.
substring
(
start
,
end
+
1
);
String
[]
names
=
word
.
split
(
"、"
);
List
<
String
>
botNames
=
new
ArrayList
<>();
for
(
String
name
:
names
)
{
botNames
.
add
(
name
.
substring
(
1
,
name
.
length
()-
1
));
}
return
botNames
;
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
String
s
=
"[{\"type\": \"SendEvent\",\"componentId\":\"%s\"}]"
;
String
s
=
"[{\"type\": \"SendEvent\",\"componentId\":\"%s\"}]"
;
System
.
out
.
println
(
String
.
format
(
s
,
"gsagh"
));
//
System.out.println(String.format(s, "gsagh"));
}
}
}
}
xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/entity/secondary/XiaoDuOrderTB.java
View file @
cafc9711
...
@@ -45,6 +45,15 @@ public class XiaoDuOrderTB {
...
@@ -45,6 +45,15 @@ public class XiaoDuOrderTB {
@Column
(
name
=
"is_buy"
)
@Column
(
name
=
"is_buy"
)
private
Boolean
isBuy
;
private
Boolean
isBuy
;
@Column
(
name
=
"ch_order_id"
)
private
String
chOrderId
;
@Column
(
name
=
"creation_timestamp"
)
private
String
creationTimestamp
;
@Column
(
name
=
"status"
)
private
Boolean
status
;
@CreatedDate
@CreatedDate
@Column
(
name
=
"create_time"
,
nullable
=
false
,
updatable
=
false
)
@Column
(
name
=
"create_time"
,
nullable
=
false
,
updatable
=
false
)
private
Date
createTime
;
private
Date
createTime
;
...
...
xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/repository/secondary/XiaoDuOrderTbRepository.java
View file @
cafc9711
...
@@ -3,6 +3,7 @@ package ai.qiwu.com.xiaoduhome.repository.secondary;
...
@@ -3,6 +3,7 @@ package ai.qiwu.com.xiaoduhome.repository.secondary;
import
ai.qiwu.com.xiaoduhome.entity.secondary.XiaoDuOrderTB
;
import
ai.qiwu.com.xiaoduhome.entity.secondary.XiaoDuOrderTB
;
import
org.springframework.data.domain.Example
;
import
org.springframework.data.domain.Example
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -17,4 +18,16 @@ public interface XiaoDuOrderTbRepository extends JpaRepository<XiaoDuOrderTB, In
...
@@ -17,4 +18,16 @@ public interface XiaoDuOrderTbRepository extends JpaRepository<XiaoDuOrderTB, In
@Transactional
@Transactional
@Override
@Override
<
S
extends
XiaoDuOrderTB
>
S
save
(
S
s
);
<
S
extends
XiaoDuOrderTB
>
S
save
(
S
s
);
@Transactional
@Override
<
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
)
void
updateAterSeccessPayed
(
String
chOrderId
,
String
creationTimestamp
,
String
orderId
);
@Transactional
@Override
void
delete
(
XiaoDuOrderTB
xiaoDuOrderTB
);
}
}
xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/DplBotService.java
View file @
cafc9711
This diff is collapsed.
Click to expand it.
xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/RequestTerminal.java
View file @
cafc9711
...
@@ -2,6 +2,7 @@ package ai.qiwu.com.xiaoduhome.service;
...
@@ -2,6 +2,7 @@ package ai.qiwu.com.xiaoduhome.service;
import
ai.qiwu.com.xiaoduhome.common.Constants
;
import
ai.qiwu.com.xiaoduhome.common.Constants
;
import
ai.qiwu.com.xiaoduhome.common.OkHttp3Utils
;
import
ai.qiwu.com.xiaoduhome.common.OkHttp3Utils
;
import
ai.qiwu.com.xiaoduhome.common.Utils
;
import
ai.qiwu.com.xiaoduhome.pojo.QiWuRequest
;
import
ai.qiwu.com.xiaoduhome.pojo.QiWuRequest
;
import
ai.qiwu.com.xiaoduhome.pojo.QiWuResponse
;
import
ai.qiwu.com.xiaoduhome.pojo.QiWuResponse
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
...
@@ -11,6 +12,7 @@ import org.slf4j.LoggerFactory;
...
@@ -11,6 +12,7 @@ import org.slf4j.LoggerFactory;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Random
;
/**
/**
* @author 苗权威
* @author 苗权威
...
@@ -42,6 +44,19 @@ class RequestTerminal {
...
@@ -42,6 +44,19 @@ class RequestTerminal {
}
}
public
static
void
main
(
String
[]
args
)
throws
IOException
{
public
static
void
main
(
String
[]
args
)
throws
IOException
{
backRequest
(
"2353461"
);
int
i
=
10
;
while
(
i
--
>
0
)
{
final
int
j
=
i
;
new
Thread
(()
->
{
try
{
String
userId
=
j
+
"2453525"
+
j
;
log
.
info
(
userId
);
String
word
=
requestTerminate
(
"有什么好玩的吗"
,
userId
).
getText
();
System
.
out
.
println
(
Utils
.
getRecommandBotNames
(
word
));
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}).
start
();
}
}
}
}
}
xiaoduhome/src/main/java/ai/qiwu/com/xiaoduhome/service/ScheduleService.java
View file @
cafc9711
...
@@ -55,31 +55,24 @@ public class ScheduleService implements InitializingBean {
...
@@ -55,31 +55,24 @@ public class ScheduleService implements InitializingBean {
@Scheduled
(
cron
=
"0 0 19 * * ?"
)
@Scheduled
(
cron
=
"0 0 19 * * ?"
)
public
void
initRankingList
()
{
public
void
initRankingList
()
{
try
{
new
Thread
(()
->
{
new
Thread
(()
->
{
RANKING_LIST
=
gameProjectTbRepository
.
findFirst15ByApplyStatusOrderByWatchDesc
(
1
);
RANKING_LIST
=
gameProjectTbRepository
.
findFirst15ByApplyStatusOrderByWatchDesc
(
1
);
//log.info("排行榜:{}", RANKING_LIST);
//log.info("排行榜:{}", RANKING_LIST);
}).
start
();
}).
start
();
}
catch
(
Exception
e
)
{
//log.error("更新排行榜出错:{}", e.getMessage());
log
.
error
(
"更新排行榜出错:{}"
,
e
.
getMessage
());
}
}
}
@Scheduled
(
cron
=
"0 0 18 * * ?"
)
@Scheduled
(
cron
=
"0 0 18 * * ?"
)
public
void
initRecommendList
()
{
public
void
initRecommendList
()
{
try
{
new
Thread
(()
->
{
new
Thread
(()
->
{
RECOMMEND_LIST
=
gameProjectTbRepository
.
recommendList
();
RECOMMEND_LIST
=
gameProjectTbRepository
.
recommendList
();
//log.info("推荐:{}", RECOMMEND_LIST);
//log.info("推荐:{}", RECOMMEND_LIST);
}).
start
();
}).
start
();
}
catch
(
Exception
e
)
{
//log.error("更新推荐页出错:{}", e.getMessage());
log
.
error
(
"更新推荐页出错:{}"
,
e
.
getMessage
());
}
}
}
@Scheduled
(
cron
=
"0 0 17 * * ?"
)
@Scheduled
(
cron
=
"0 0 17 * * ?"
)
public
void
initAllOnTableProductInfo
()
{
public
void
initAllOnTableProductInfo
()
{
try
{
new
Thread
(()
->
{
new
Thread
(()
->
{
ALL_ON_PRODUCT
=
allOnProductInfoRepository
.
findAllByApplyStatus
(
1
);
ALL_ON_PRODUCT
=
allOnProductInfoRepository
.
findAllByApplyStatus
(
1
);
for
(
OnProductDetail
item
:
ALL_ON_PRODUCT
)
{
for
(
OnProductDetail
item
:
ALL_ON_PRODUCT
)
{
...
@@ -93,14 +86,11 @@ public class ScheduleService implements InitializingBean {
...
@@ -93,14 +86,11 @@ public class ScheduleService implements InitializingBean {
}
}
//log.info("作品详细信息:{}", PRODUCT_NAME_DETAIL);
//log.info("作品详细信息:{}", PRODUCT_NAME_DETAIL);
}).
start
();
}).
start
();
}
catch
(
Exception
e
)
{
//log.error("更新推荐页出错:{}", e.getMessage());
log
.
error
(
"更新推荐页出错:{}"
,
e
.
getMessage
());
}
}
}
@Scheduled
(
cron
=
"0 0 1 ? * 7"
)
@Scheduled
(
cron
=
"0 0 1 ? * 7"
)
public
void
initProductList
()
{
public
void
initProductList
()
{
try
{
new
Thread
(()
->
{
new
Thread
(()
->
{
for
(
String
category:
CATEGORY
)
{
for
(
String
category:
CATEGORY
)
{
List
<
GameProjectTb
>
list
=
gameProjectTbRepository
.
categoryProject
(
category
);
List
<
GameProjectTb
>
list
=
gameProjectTbRepository
.
categoryProject
(
category
);
...
@@ -108,14 +98,11 @@ public class ScheduleService implements InitializingBean {
...
@@ -108,14 +98,11 @@ public class ScheduleService implements InitializingBean {
log
.
info
(
"分类{},作品列表{}"
,
category
,
list
);
log
.
info
(
"分类{},作品列表{}"
,
category
,
list
);
}
}
}).
start
();
}).
start
();
}
catch
(
Exception
e
)
{
//log.error("更新分类作品列表出错:{}", e.getMessage());
log
.
error
(
"更新分类作品列表出错:{}"
,
e
.
getMessage
());
}
}
}
@Scheduled
(
cron
=
"0 0 2 * * ?"
)
@Scheduled
(
cron
=
"0 0 2 * * ?"
)
public
void
deleteOverTimeHistory
()
{
public
void
deleteOverTimeHistory
()
{
try
{
new
Thread
(()
->
{
new
Thread
(()
->
{
xiaoDuHistoryTBRepository
.
deletePasted
((
long
)
(
System
.
currentTimeMillis
()-
2592
E5
));
xiaoDuHistoryTBRepository
.
deletePasted
((
long
)
(
System
.
currentTimeMillis
()-
2592
E5
));
List
<
String
>
userIds
=
xiaoDuHistoryTBRepository
.
getAllUser
();
List
<
String
>
userIds
=
xiaoDuHistoryTBRepository
.
getAllUser
();
...
@@ -123,9 +110,7 @@ public class ScheduleService implements InitializingBean {
...
@@ -123,9 +110,7 @@ public class ScheduleService implements InitializingBean {
xiaoDuHistoryTBRepository
.
deleteOverTime
(
userId
);
xiaoDuHistoryTBRepository
.
deleteOverTime
(
userId
);
}
}
}).
start
();
}).
start
();
}
catch
(
Exception
e
)
{
//log.error("清理历史记录数据库出错:{}", e.toString());
log
.
error
(
"清理历史记录数据库出错:{}"
,
e
.
toString
());
}
}
}
@Override
@Override
...
...
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