Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lol-statis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jozef Bugoš
lol-statis
Commits
6778b015
Commit
6778b015
authored
4 years ago
by
Jozef Bugos
Browse files
Options
Downloads
Patches
Plain Diff
adding docckerfile and fixing not foudn error
parent
e486927f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Dockerfile
+5
-0
5 additions, 0 deletions
Dockerfile
docker-compose.yml
+25
-0
25 additions, 0 deletions
docker-compose.yml
run.sh
+2
-0
2 additions, 0 deletions
run.sh
src/main/java/com/example/demo/lol/RiotController.java
+10
-2
10 additions, 2 deletions
src/main/java/com/example/demo/lol/RiotController.java
with
42 additions
and
2 deletions
Dockerfile
0 → 100644
+
5
−
0
View file @
6778b015
FROM
adoptopenjdk/openjdk11:latest
VOLUME
/tmp
COPY
run.sh .
COPY
target/*.jar app.jar
ENTRYPOINT
["run.sh"]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
docker-compose.yml
0 → 100644
+
25
−
0
View file @
6778b015
version
:
'
2'
services
:
lol
:
container_name
:
lol
build
:
context
:
docker
dockerfile
:
Dockerfile
image
:
lol:latest
ports
:
-
18888:8888
networks
:
-
spring-cloud-network
# product-server:
# container_name: product-server
# build:
# context: docker-product-server
# dockerfile: Dockerfile
# image: product-server:latest
# ports:
# - 19999:9999
# networks:
# - spring-cloud-network
networks
:
spring-cloud-network
:
driver
:
bridge
\ No newline at end of file
This diff is collapsed.
Click to expand it.
run.sh
0 → 100644
+
2
−
0
View file @
6778b015
#!/bin/sh
exec
java
-jar
/app.jar
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/main/java/com/example/demo/lol/RiotController.java
+
10
−
2
View file @
6778b015
...
@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.GetMapping;
...
@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.client.HttpClientErrorException
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.client.RestTemplate
;
@RestController
@RestController
...
@@ -78,8 +79,12 @@ public class RiotController {
...
@@ -78,8 +79,12 @@ public class RiotController {
final
String
uriHistory
=
"https://"
+
server
+
".api.riotgames.com/lol/match/v4/matchlists/by-account/"
+
id
+
"?endIndex="
+
endIndex
+
"&beginIndex="
+
beginIndex
+
timeParams
+
"&queue="
+
queue
+
"&api_key="
+
key
;
final
String
uriHistory
=
"https://"
+
server
+
".api.riotgames.com/lol/match/v4/matchlists/by-account/"
+
id
+
"?endIndex="
+
endIndex
+
"&beginIndex="
+
beginIndex
+
timeParams
+
"&queue="
+
queue
+
"&api_key="
+
key
;
RestTemplate
restTemplate
=
new
RestTemplate
();
RestTemplate
restTemplate
=
new
RestTemplate
();
MatchesBean
result
=
restTemplate
.
getForObject
(
uriHistory
,
MatchesBean
.
class
);
try
{
return
result
;
MatchesBean
result
=
restTemplate
.
getForObject
(
uriHistory
,
MatchesBean
.
class
);
return
result
;
}
catch
(
HttpClientErrorException
ex
)
{
return
new
MatchesBean
();
}
}
}
private
MatchDetailBean
getMatchDetail
(
String
server
,
String
id
)
{
private
MatchDetailBean
getMatchDetail
(
String
server
,
String
id
)
{
...
@@ -94,6 +99,9 @@ public class RiotController {
...
@@ -94,6 +99,9 @@ public class RiotController {
private
StatsBean
getStatsForPlayer
(
String
server
,
String
userId
,
long
timestamp
,
String
summonerName
,
int
team
)
{
private
StatsBean
getStatsForPlayer
(
String
server
,
String
userId
,
long
timestamp
,
String
summonerName
,
int
team
)
{
MatchesBean
matches
=
getMatchHistory
(
server
,
userId
,
1
,
timestamp
);
MatchesBean
matches
=
getMatchHistory
(
server
,
userId
,
1
,
timestamp
);
int
games
=
0
,
wins
=
0
,
streak
=
0
;
int
games
=
0
,
wins
=
0
,
streak
=
0
;
if
(
matches
.
getMatches
()
==
null
)
{
return
new
StatsBean
(
summonerName
,
team
,
games
,
streak
,
false
,
0
);
}
boolean
isWinStreak
=
true
;
boolean
isWinStreak
=
true
;
boolean
isStreak
=
true
;
boolean
isStreak
=
true
;
for
(
MatchBean
match
:
matches
.
getMatches
())
{
for
(
MatchBean
match
:
matches
.
getMatches
())
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment