Skip to content

Commit

Permalink
version 1.0.0 release (#33)
Browse files Browse the repository at this point in the history
* added team endpoint and infrastructure

* added dockerfile

* fixed issue with null

* updated player discord id to reflect what they actually are

* save pt

* added exception handling to better manage status codes and refactored

* added more features and much better exception handling.

* updated request contract and added ability to delete teams

* starting league endpoint stuff

* save point for completing GET All, POST Create League, PUT edit league name.
Added changelog stuff to liquibase, made more exceptions.

* made changes to handle league CRUD (PUT/DELETE/GET ONE) and edited player resource to enable league stuff

* updated db raid table to have a status column.

* save pt

* made fk to league from raid table and implemented POST

* added delete endpoint

* finished boss endpoint

* finished assignment endpoint

* added league id to raid response and endpoint to search raid by leagueName

* rewrote entire api to follow what's mentioned in #19

* rewrote entire api to follow what's mentioned in #19

* updated logic and added tier to payload

* added ability to update boss health

* fixed boss logging issue and finished endpoints

* added templates

* fixed #28

* added security for all paths non h2, configured docker compose and productionized settings

* save pt

* added gradle clean and fixed jdbc url

* fixed enum, dc file, and added logging level thresholds
  • Loading branch information
seekheart authored Dec 25, 2019
1 parent cb8ba36 commit f1c4171
Show file tree
Hide file tree
Showing 43 changed files with 707 additions and 516 deletions.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ out/

### VS Code ###
.vscode/

#secrets
.env
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM gradle:5.6.4-jdk11 AS build

RUN mkdir /app
WORKDIR /app

COPY --chown=gradle:gradle . /app

RUN gradle clean build --no-daemon

FROM openjdk:11-jre-slim

RUN mkdir /app
WORKDIR /app

COPY --from=build /app/build/libs/*jar /app/app.jar

ENTRYPOINT ["java", "-jar", "app.jar"]
18 changes: 18 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: "3.7"
services:
super-pal-api:
build: .
ports:
- "8080:8080"
env_file:
- .env
depends_on:
- db
links:
- db
db:
image: postgres:12-alpine
environment:
POSTGRES_PASSWORD: ${DB_PW}
POSTGRES_USER: ${DB_USER}
POSTGRES_DB: super_pal
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
public void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("/h2-console/**")
.permitAll()
.antMatchers("/h2-console/**").permitAll()
.anyRequest().authenticated()
.and()
.httpBasic();
http.csrf().disable();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.seekheart.superpalapi.model.domain;

import java.util.UUID;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import lombok.AllArgsConstructor;
Expand All @@ -10,14 +11,15 @@

@Entity
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@AllArgsConstructor
public class Boss {

@Id
private UUID id;
@Column
private Long health;
@Column
private String name;
private Long hp;
private UUID raidId;
}
22 changes: 0 additions & 22 deletions src/main/java/com/seekheart/superpalapi/model/domain/League.java

This file was deleted.

24 changes: 0 additions & 24 deletions src/main/java/com/seekheart/superpalapi/model/domain/Player.java

This file was deleted.

This file was deleted.

14 changes: 11 additions & 3 deletions src/main/java/com/seekheart/superpalapi/model/domain/Raid.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
package com.seekheart.superpalapi.model.domain;

import com.seekheart.superpalapi.model.util.RaidStatusOptions;
import java.util.UUID;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Data
@Builder
public class Raid {

@Id
private UUID id;
private Long rank;
@Column
private Long tier;
@Enumerated(EnumType.STRING)
@Column
private RaidStatusOptions state;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.seekheart.superpalapi.model.domain;

import java.util.UUID;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import lombok.AllArgsConstructor;
Expand All @@ -13,11 +14,12 @@
@NoArgsConstructor
@Builder
@Data
public class Assignment {
public class RaidBoss {

@Id
private UUID id;
private UUID playerId;
private UUID teamId;
@Column
private UUID raidId;
@Column
private UUID bossId;
}
21 changes: 0 additions & 21 deletions src/main/java/com/seekheart/superpalapi/model/domain/Team.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.seekheart.superpalapi.model.error;

public class BadRaidRequest extends RuntimeException {

public BadRaidRequest() {
super("Cannot have raid tier lower than 2 or greater than 8!");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.seekheart.superpalapi.model.error;

import java.util.UUID;

public class BossNotFoundException extends RuntimeException {

public BossNotFoundException(UUID id) {
super("Boss id=" + id + " does not exist!");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.seekheart.superpalapi.model.error;

import java.util.UUID;

public class NoActiveRaidException extends RuntimeException {

public NoActiveRaidException(UUID uuid) {
super("No active raid present for id=" + uuid);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.seekheart.superpalapi.model.error;

public class RaidAlreadyActiveException extends RuntimeException {

public RaidAlreadyActiveException() {
super("Only 1 active raid is allowed!");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.seekheart.superpalapi.model.error;

import java.util.UUID;

public class RaidBossNotFoundException extends RuntimeException {

public RaidBossNotFoundException(UUID id) {
super("RaidBoss not found for raid=" + id);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.seekheart.superpalapi.model.error;

import java.util.UUID;

public class RaidNotFoundException extends RuntimeException {

public RaidNotFoundException(UUID id) {
super("Raid not found for id=" + id);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.seekheart.superpalapi.model.util;

import lombok.Getter;

@Getter
public enum RaidStatusOptions {
FUNDING("funding"), IN_PROGRESS("in progress"), ENDED("ended");
private final String value;

RaidStatusOptions(String value) {
this.value = value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@Data
@EqualsAndHashCode
@Builder
@AllArgsConstructor
public class TeamBossAssignment {
@NoArgsConstructor
@Builder
public class BossRequest {

private String boss;
private String team;
private Long damage;
}
Loading

0 comments on commit f1c4171

Please sign in to comment.