[AB-303] adding scheduled configurable activity updates

This commit is contained in:
Sheldan
2021-07-13 00:35:15 +02:00
parent c7514a6bad
commit ac605e4791
25 changed files with 1859 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>dynamic-activity</artifactId>
<groupId>dev.sheldan.abstracto.modules</groupId>
<version>1.3.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dynamic-activity-int</artifactId>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>dev.sheldan.abstracto.core</groupId>
<artifactId>core-int</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,5 @@
package dev.sheldan.abstracto.activity.models;
public enum ActivityType {
WATCHING, STREAMING, PLAYING, LISTENING
}

View File

@@ -0,0 +1,31 @@
package dev.sheldan.abstracto.activity.models;
import lombok.*;
import javax.persistence.*;
import java.time.Instant;
@Builder
@Entity
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "activity")
@Getter
@Setter
@EqualsAndHashCode
public class CustomActivity {
@Id
@Column(name = "id", nullable = false)
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Enumerated(EnumType.STRING)
@Column(name = "type")
private ActivityType type;
@Column(name = "template_key")
private String templateKey;
@Column(name = "created", nullable = false, insertable = false, updatable = false)
private Instant created;
}

View File

@@ -0,0 +1,9 @@
package dev.sheldan.abstracto.activity.service;
import dev.sheldan.abstracto.activity.models.CustomActivity;
public interface ActivityService {
void switchToOtherActivity();
void switchToActivity(CustomActivity activity);
net.dv8tion.jda.api.entities.Activity matchActivity(CustomActivity activity, String text);
}

View File

@@ -0,0 +1,9 @@
package dev.sheldan.abstracto.activity.service.management;
import dev.sheldan.abstracto.activity.models.CustomActivity;
import java.util.List;
public interface ActivityManagementService {
List<CustomActivity> getAllActivities();
}