Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
antai-sport-http-server
Project
Project
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
antai-sport
antai-sport-http-server
Commits
57a2467f
Commit
57a2467f
authored
Oct 13, 2021
by
liming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加自动创建比赛接口
parent
319da40b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
2 deletions
+41
-2
MatchBicycleService.java
.../game/api/business/match/bicycle/MatchBicycleService.java
+4
-1
application-dev.yaml
game-api/src/main/resources/application-dev.yaml
+2
-0
application-local.yaml
game-api/src/main/resources/application-local.yaml
+16
-0
application-prod.yaml
game-api/src/main/resources/application-prod.yaml
+3
-1
application-test.yaml
game-api/src/main/resources/application-test.yaml
+2
-0
application-common-db-local.yml
profile/src/main/resources/application-common-db-local.yml
+14
-0
No files found.
game-api/src/main/java/com/antai/sport/http/server/game/api/business/match/bicycle/MatchBicycleService.java
View file @
57a2467f
...
...
@@ -10,6 +10,7 @@ import com.antai.sport.http.server.repository.sport.entity.SportUser;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.client.RestTemplate
;
...
...
@@ -28,6 +29,8 @@ import java.util.List;
public
class
MatchBicycleService
extends
ServiceImpl
<
MatchBicycleMapper
,
MatchBicycle
>
{
@Resource
private
MatchBicycleBusinessMapper
matchBicycleBusinessMapper
;
@Value
(
"${game-server-address}"
)
private
String
gameServerAddress
;
public
Long
saveMatchBicycle
(
@RequestBody
ReqMatchBicycleSave
data
)
{
if
(
StringUtils
.
isBlank
(
data
.
getName
()))
{
...
...
@@ -96,7 +99,7 @@ public class MatchBicycleService extends ServiceImpl<MatchBicycleMapper, MatchBi
}
//调用游戏服务端的暂停接口
RestTemplate
restTemplate
=
new
RestTemplate
();
restTemplate
.
getForObject
(
"http://47.100.168.51:3333/close?MatchId=force"
,
String
.
class
);
restTemplate
.
getForObject
(
gameServerAddress
,
String
.
class
);
//创建一场新的比赛 创建比赛规则:进入时间=当前时间+1分钟 开始时间=进入时间+1分钟 结束时间=开始时间+20分钟
MatchBicycle
match
=
new
MatchBicycle
();
...
...
game-api/src/main/resources/application-dev.yaml
View file @
57a2467f
...
...
@@ -12,3 +12,5 @@ spring:
swagger
:
enable
:
true
game-server-address
:
http://47.100.168.51:3333/close?MatchId=force
\ No newline at end of file
game-api/src/main/resources/application-local.yaml
0 → 100644
View file @
57a2467f
server
:
port
:
8080
spring
:
profiles
:
include
:
-
common-db-local
redis
:
database
:
1
host
:
127.0.0.1
port
:
6379
password
:
123456
swagger
:
enable
:
true
game-server-address
:
http://127.0.0.1:3333/close?MatchId=force
\ No newline at end of file
game-api/src/main/resources/application-prod.yaml
View file @
57a2467f
...
...
@@ -6,4 +6,6 @@ spring:
database
:
0
host
:
127.0.0.1
port
:
6379
password
:
ENC(yKZoKLWfAj6BRglq4C2HWWjsL64maeCm)
\ No newline at end of file
password
:
ENC(yKZoKLWfAj6BRglq4C2HWWjsL64maeCm)
game-server-address
:
http://47.100.168.51:3333/close?MatchId=force
\ No newline at end of file
game-api/src/main/resources/application-test.yaml
View file @
57a2467f
...
...
@@ -12,3 +12,5 @@ spring:
swagger
:
enable
:
true
game-server-address
:
http://47.100.168.51:3333/close?MatchId=force
\ No newline at end of file
profile/src/main/resources/application-common-db-local.yml
0 → 100644
View file @
57a2467f
spring
:
profiles
:
include
:
-
common-db
datasource
:
url
:
jdbc:mysql://127.0.0.1:3306/antaisport${project.mysql-url-params}
username
:
root
password
:
123456
logging
:
level
:
root
:
info
com.antai.sport.http.server.repository
:
debug
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