Skip to content

Commit

Permalink
Merge pull request #1 from colorfulFlames/release/1.1
Browse files Browse the repository at this point in the history
Release/1.1
  • Loading branch information
SeveralCircles authored Oct 18, 2021
2 parents 1705357 + aad3f9c commit f2a4dce
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group 'com.severalcircles'
version '1.0'
version '1.1'

repositories {
mavenCentral()
Expand Down
20 changes: 17 additions & 3 deletions src/main/java/com/severalcircles/flamesapi/DataController.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,24 @@
@SuppressWarnings("ALL")
@RestController
public class DataController {
@GetMapping("/user/{id}")
public ResponseEntity getUser(@PathVariable String id) {
@GetMapping("/user/{id}/{thing}")
public ResponseEntity getUser(@PathVariable String id, @PathVariable String thing) {
int th;
switch (thing) {
default:
case "":
case "user":
th = 0;
break;
case "stats":
th = 1;
break;
case "funfacts":
th = 2;
break;
}
try {
return new ResponseEntity(FlamesDataConnection.getUser(id)[0], HttpStatus.OK);
return new ResponseEntity(FlamesDataConnection.getUser(id)[th], HttpStatus.OK);
} catch (IOException e) {
return new ResponseEntity("<!DOCTYPE html><html><head><script type=\"text/javascript\">window.location=\"https://flamesapi.severalcircles.com/error/404\"</script></head></html>",HttpStatus.NOT_FOUND);
}
Expand Down

0 comments on commit f2a4dce

Please sign in to comment.