-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Working on fixing tests that broke + added bungieAPIService
- Loading branch information
Daniel Villavicencio
authored and
Daniel Villavicencio
committed
Feb 9, 2024
1 parent
d171faf
commit 3248795
Showing
41 changed files
with
1,045 additions
and
410 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
src/main/java/com/danielvm/destiny2bot/dto/destiny/manifest/ManifestFields.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/main/java/com/danielvm/destiny2bot/entity/UserCharacterIndexing.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.danielvm.destiny2bot.entity; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.persistence.Table; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@Setter | ||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Entity | ||
@Builder | ||
@Table(name = "user_character_indexing_information") | ||
public class UserCharacterIndexing { | ||
|
||
@Id | ||
@Column(name = "character_id") | ||
private Long characterId; | ||
|
||
@Column(name = "last_page") | ||
private Integer lastPage; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "bot_user_id") | ||
private UserIndexing userIndexing; | ||
} |
19 changes: 10 additions & 9 deletions
19
...y2bot/entity/UserIndexingInformation.java → ...elvm/destiny2bot/entity/UserIndexing.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,33 @@ | ||
package com.danielvm.destiny2bot.entity; | ||
|
||
import jakarta.persistence.CascadeType; | ||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.OneToMany; | ||
import jakarta.persistence.Table; | ||
import java.util.List; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@Entity | ||
@Setter | ||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Entity | ||
@Table(name = "user_indexing_information") | ||
public class UserIndexingInformation { | ||
public class UserIndexing { | ||
|
||
@Id | ||
@Column(name = "user_discord_id") | ||
private Long userDiscordId; | ||
|
||
@Column(name = "number_of_pages") | ||
private Integer numberOfPages; | ||
|
||
@Column(name = "last_page") | ||
private Integer lastPage; | ||
private Long discordUserId; | ||
|
||
@Column(name = "is_indexing") | ||
private Boolean isIndexing; | ||
|
||
@OneToMany(mappedBy = "userIndexing", cascade = CascadeType.ALL) | ||
private List<UserCharacterIndexing> currentCharacters; | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/danielvm/destiny2bot/enums/IndexingStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.danielvm.destiny2bot.enums; | ||
|
||
public enum IndexingStatus { | ||
INDEXING, | ||
SUCCESS, | ||
ERROR | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/com/danielvm/destiny2bot/factory/creator/WhyAuthorizeButtonMessageCreator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.danielvm.destiny2bot.factory.creator; | ||
|
||
import com.danielvm.destiny2bot.dto.discord.Interaction; | ||
import com.danielvm.destiny2bot.dto.discord.InteractionResponse; | ||
import com.danielvm.destiny2bot.dto.discord.InteractionResponseData; | ||
import org.springframework.stereotype.Component; | ||
import reactor.core.publisher.Mono; | ||
|
||
@Component | ||
public class WhyAuthorizeButtonMessageCreator implements MessageComponentSource { | ||
|
||
private static final Integer EPHEMERAL_BYTE = 1000000; | ||
|
||
@Override | ||
public Mono<InteractionResponse> messageComponentResponse(Interaction interaction) { | ||
return Mono.just(InteractionResponse.builder() | ||
.type(4) | ||
.data(InteractionResponseData.builder() | ||
.content( | ||
"Without going into technical details, in order to retrieve interesting and relevant " | ||
+ "information regarding your Destiny 2 characters, e.g., like Raid statistics, " | ||
+ "**through Discord**, we need to link both your Bungie and Discord account together. " | ||
+ "This command allows you to do just that. In the consent screen for both Discord " | ||
+ "and Bungie you will be able to review all the permissions the Riven will have with " | ||
+ "both your accounts. Be sure to read and review them well!") | ||
.flags(EPHEMERAL_BYTE) | ||
.build()) | ||
.build()); | ||
} | ||
} |
10 changes: 7 additions & 3 deletions
10
src/main/java/com/danielvm/destiny2bot/model/state/ErrorState.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.