Added RixaPermission#fromString, GuildMapper, GuildManager

This commit is contained in:
Savvy 2017-11-10 08:34:02 -05:00
parent 4c67eff7ee
commit 6e5b7a0b42
7 changed files with 45 additions and 1 deletions

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@ -42,6 +42,12 @@
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
<version>1.16.18</version> <version>1.16.18</version>
</dependency> </dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>4.3.9.RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -2,4 +2,13 @@ package io.rixa.commands;
public enum RixaPermission { public enum RixaPermission {
NONE; NONE;
public static RixaPermission fromString(String string) {
for (RixaPermission value : values()) {
if (value.toString().equalsIgnoreCase(string)) {
return value;
}
}
return null;
}
} }

View File

@ -1,5 +1,6 @@
package io.rixa.guild; package io.rixa.guild;
import io.rixa.guild.manager.IGuild;
import io.rixa.guild.modules.RixaModule; import io.rixa.guild.modules.RixaModule;
import lombok.Getter; import lombok.Getter;
import net.dv8tion.jda.core.entities.Guild; import net.dv8tion.jda.core.entities.Guild;

View File

@ -0,0 +1,4 @@
package io.rixa.guild.manager;
public class GuildManager {
}

View File

@ -0,0 +1,18 @@
package io.rixa.guild.manager;
import io.rixa.guild.RixaGuild;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class GuildMapper implements RowMapper<RixaGuild> {
@Override
public RixaGuild mapRow(ResultSet resultSet, int i) throws SQLException {
RixaGuild guild = new RixaGuild(null);
guild.load(resultSet);
// Register guild;
return guild;
}
}

View File

@ -1,4 +1,4 @@
package io.rixa.guild; package io.rixa.guild.manager;
import io.rixa.guild.modules.RixaModule; import io.rixa.guild.modules.RixaModule;