Add Staff Application Form handling
Introduced `StaffAppController` and `StaffAppFormData` to handle staff application form submissions. The controller now stores user data, initiates email verification, and provides appropriate responses based on the verification outcome. Additionally, updated `application.properties` and cleaned up IntelliJ workspace.xml.
This commit is contained in:
parent
d53ba82e3e
commit
01deea380a
|
|
@ -4,9 +4,16 @@
|
|||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="ce59df2a-8d56-446a-867b-80e627daf479" name="Changes" comment="Add database configuration via command-line arguments A new configuration setup now allows specifying a path for database properties via command-line arguments during application startup. This update also changes the call signature for `DatabaseConnection.initialize()` method to accept a path argument. Similarly, methods in `PropertiesLoader`, `PropertiesWriter`, and `MailSettings` classes were also updated to use the specified path when working with properties files. The `TestForm` class's tests were updated accordingly to handle these changes.">
|
||||
<change afterPath="$PROJECT_DIR$/build.sh" afterDir="false" />
|
||||
<list default="true" id="ce59df2a-8d56-446a-867b-80e627daf479" name="Changes" comment="Update URI to point to Discord bot endpoint Changed the URI in VerifyController to use the Discord bot's endpoint for form submission. This adjustment is part of the process to route form data correctly through the specified internal service.">
|
||||
<change afterPath="$PROJECT_DIR$/src/main/java/com/alttd/forms/apply/StaffAppController.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/main/java/com/alttd/forms/apply/StaffAppFormData.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/alttd/forms/contact/ContactController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/alttd/forms/contact/ContactController.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/alttd/forms/contact/ContactFormData.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/alttd/forms/contact/ContactFormData.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/alttd/forms/contact/StoreFormQuery.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/alttd/forms/form/StoreFormQuery.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/alttd/forms/form/Form.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/alttd/forms/form/Form.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/resources/application.properties" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/application.properties" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/test/java/TestForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/TestForm.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
|
@ -47,9 +54,9 @@
|
|||
<option name="RECENT_TEMPLATES">
|
||||
<list>
|
||||
<option value="Jsp File" />
|
||||
<option value="Class" />
|
||||
<option value="package-info" />
|
||||
<option value="package.json" />
|
||||
<option value="Class" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
|
|
@ -134,6 +141,11 @@
|
|||
]
|
||||
}
|
||||
}</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CreateClassDialog.RecentsKey">
|
||||
<recent name="com.alttd.forms.apply" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="RunManager" selected="Gradle.TestForm">
|
||||
<configuration name="TestForm" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
|
||||
<ExternalSystemSettings>
|
||||
|
|
@ -231,6 +243,54 @@
|
|||
<predefined_log_file id="Tomcat Manager" />
|
||||
<predefined_log_file id="Tomcat Host Manager" />
|
||||
<predefined_log_file id="Tomcat Localhost Access" />
|
||||
<RunnerSettings RunnerId="Debug">
|
||||
<option name="DEBUG_PORT" value="51778" />
|
||||
</RunnerSettings>
|
||||
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Cover">
|
||||
<option name="USE_ENV_VARIABLES" value="true" />
|
||||
<STARTUP>
|
||||
<option name="USE_DEFAULT" value="true" />
|
||||
<option name="SCRIPT" value="" />
|
||||
<option name="VM_PARAMETERS" value="" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
</STARTUP>
|
||||
<SHUTDOWN>
|
||||
<option name="USE_DEFAULT" value="true" />
|
||||
<option name="SCRIPT" value="" />
|
||||
<option name="VM_PARAMETERS" value="" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
</SHUTDOWN>
|
||||
</ConfigurationWrapper>
|
||||
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Debug">
|
||||
<option name="USE_ENV_VARIABLES" value="true" />
|
||||
<STARTUP>
|
||||
<option name="USE_DEFAULT" value="true" />
|
||||
<option name="SCRIPT" value="" />
|
||||
<option name="VM_PARAMETERS" value="" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
</STARTUP>
|
||||
<SHUTDOWN>
|
||||
<option name="USE_DEFAULT" value="true" />
|
||||
<option name="SCRIPT" value="" />
|
||||
<option name="VM_PARAMETERS" value="" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
</SHUTDOWN>
|
||||
</ConfigurationWrapper>
|
||||
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Profile">
|
||||
<option name="USE_ENV_VARIABLES" value="true" />
|
||||
<STARTUP>
|
||||
<option name="USE_DEFAULT" value="true" />
|
||||
<option name="SCRIPT" value="" />
|
||||
<option name="VM_PARAMETERS" value="" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
</STARTUP>
|
||||
<SHUTDOWN>
|
||||
<option name="USE_DEFAULT" value="true" />
|
||||
<option name="SCRIPT" value="" />
|
||||
<option name="VM_PARAMETERS" value="" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
</SHUTDOWN>
|
||||
</ConfigurationWrapper>
|
||||
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Run">
|
||||
<option name="USE_ENV_VARIABLES" value="true" />
|
||||
<STARTUP>
|
||||
|
|
@ -271,8 +331,8 @@
|
|||
<component name="SharedIndexes">
|
||||
<attachedChunks>
|
||||
<set>
|
||||
<option value="bundled-jdk-9f38398b9061-39b83d9b5494-intellij.indexing.shared.core-IU-241.18034.62" />
|
||||
<option value="bundled-js-predefined-1d06a55b98c1-0b3e54e931b4-JavaScript-IU-241.18034.62" />
|
||||
<option value="bundled-jdk-9f38398b9061-39b83d9b5494-intellij.indexing.shared.core-IU-241.18968.26" />
|
||||
<option value="bundled-js-predefined-1d06a55b98c1-0b3e54e931b4-JavaScript-IU-241.18968.26" />
|
||||
</set>
|
||||
</attachedChunks>
|
||||
</component>
|
||||
|
|
@ -309,7 +369,9 @@
|
|||
<workItem from="1722697616738" duration="2649000" />
|
||||
<workItem from="1722718451005" duration="2120000" />
|
||||
<workItem from="1722786481232" duration="617000" />
|
||||
<workItem from="1722801254695" duration="601000" />
|
||||
<workItem from="1722801254695" duration="6135000" />
|
||||
<workItem from="1722879625782" duration="358000" />
|
||||
<workItem from="1722973564053" duration="2026000" />
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="Initial commit for site for forms">
|
||||
<option name="closed" value="true" />
|
||||
|
|
@ -359,7 +421,79 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1714332311321</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="7" />
|
||||
<task id="LOCAL-00007" summary="Add DB config via command-line arguments A new setup allows specifying database properties path using command-line arguments during startup. The `DatabaseConnection.initialize()` method signature has been updated to accept a path argument. Methods in `PropertiesLoader`, `PropertiesWriter`, and `MailSettings` classes, along with tests in the `TestForm` class, were adjusted accordingly.">
|
||||
<option name="closed" value="true" />
|
||||
<created>1722804244115</created>
|
||||
<option name="number" value="00007" />
|
||||
<option name="presentableId" value="LOCAL-00007" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1722804244115</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00008" summary="Add Jenkins pipeline for Gradle build and notifications This commit introduces a new Jenkinsfile configured to build the project using Gradle and archive the resulting artifacts. Additionally, it includes a stage to send build notifications to Discord with details about the build status.">
|
||||
<option name="closed" value="true" />
|
||||
<created>1722804255328</created>
|
||||
<option name="number" value="00008" />
|
||||
<option name="presentableId" value="LOCAL-00008" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1722804255328</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00009" summary="Disable database tests in Jenkins Disabled tests that require a database connection to prevent failures in Jenkins where there isn't a database. Updated Jenkinsfile to include a property that skips these tests during the build process.">
|
||||
<option name="closed" value="true" />
|
||||
<created>1722804722354</created>
|
||||
<option name="number" value="00009" />
|
||||
<option name="presentableId" value="LOCAL-00009" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1722804722354</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00010" summary="Fix typo in Gradle build command in Jenkinsfile Corrected the parameter for skipping database tests from `dontRunDatabaseTests` to `doNotRunDatabaseTests` in the Gradle build step. This ensures the intended tests are skipped during the build process.">
|
||||
<option name="closed" value="true" />
|
||||
<created>1722804816532</created>
|
||||
<option name="number" value="00010" />
|
||||
<option name="presentableId" value="LOCAL-00010" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1722804816532</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00011" summary="Configure system property for conditional test execution Added a system property 'doNotRunDatabaseTests' in the test configuration to allow conditional skipping of database tests. This helps in running tests selectively during different build scenarios.">
|
||||
<option name="closed" value="true" />
|
||||
<created>1722804890007</created>
|
||||
<option name="number" value="00011" />
|
||||
<option name="presentableId" value="LOCAL-00011" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1722804890007</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00012" summary="Add CORS support for production server Updated the CORS configuration to include the production server URL. This change ensures that requests from the production environment are properly handled.">
|
||||
<option name="closed" value="true" />
|
||||
<created>1722810187257</created>
|
||||
<option name="number" value="00012" />
|
||||
<option name="presentableId" value="LOCAL-00012" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1722810187257</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00013" summary="Refactor logging for better granularity Updated logging levels in multiple classes to differentiate between debug and trace information. Improved log messages to support parameterized logs, ensuring sensitive or variable information is handled appropriately without concatenation.">
|
||||
<option name="closed" value="true" />
|
||||
<created>1722811549943</created>
|
||||
<option name="number" value="00013" />
|
||||
<option name="presentableId" value="LOCAL-00013" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1722811549943</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00014" summary="Enhance logging for mail verification details Updated logging to provide more detailed information about user credentials and email actions. This helps in debugging and monitoring mail verification processes more effectively. Adjusted trace messages to include username and password for better traceability.">
|
||||
<option name="closed" value="true" />
|
||||
<created>1722812594171</created>
|
||||
<option name="number" value="00014" />
|
||||
<option name="presentableId" value="LOCAL-00014" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1722812594171</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00015" summary="Update URI to point to Discord bot endpoint Changed the URI in VerifyController to use the Discord bot's endpoint for form submission. This adjustment is part of the process to route form data correctly through the specified internal service.">
|
||||
<option name="closed" value="true" />
|
||||
<created>1722812932077</created>
|
||||
<option name="number" value="00015" />
|
||||
<option name="presentableId" value="LOCAL-00015" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1722812932077</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="16" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
|
|
@ -384,6 +518,15 @@
|
|||
<MESSAGE value="Mark fields as final in VerificationData and ContactFormData The 'code', 'eMail' fields in the VerificationData class and 'username', 'email', 'question' fields in the ContactFormData class are now marked as 'final'. At the same time, some unused imports from ContactController, ContactFormData, FormQuery, and VerifyController have been removed for code cleanliness." />
|
||||
<MESSAGE value="Update Form HTML output and disable validation auto-configuration The form-to-HTML output process has been switched from a `<div>` approach to using a `StringBuilder` with a table structure in `ContactFormData.java`. Also, the spring validation auto-configuration has been disabled by adding `exclude = ValidationAutoConfiguration.class` in the `@SpringBootApplication` annotation of `Main.java`. Some changes in `.idea/workspace.xml` and `VerifyController.java` were made as well." />
|
||||
<MESSAGE value="Add database configuration via command-line arguments A new configuration setup now allows specifying a path for database properties via command-line arguments during application startup. This update also changes the call signature for `DatabaseConnection.initialize()` method to accept a path argument. Similarly, methods in `PropertiesLoader`, `PropertiesWriter`, and `MailSettings` classes were also updated to use the specified path when working with properties files. The `TestForm` class's tests were updated accordingly to handle these changes." />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Add database configuration via command-line arguments A new configuration setup now allows specifying a path for database properties via command-line arguments during application startup. This update also changes the call signature for `DatabaseConnection.initialize()` method to accept a path argument. Similarly, methods in `PropertiesLoader`, `PropertiesWriter`, and `MailSettings` classes were also updated to use the specified path when working with properties files. The `TestForm` class's tests were updated accordingly to handle these changes." />
|
||||
<MESSAGE value="Add DB config via command-line arguments A new setup allows specifying database properties path using command-line arguments during startup. The `DatabaseConnection.initialize()` method signature has been updated to accept a path argument. Methods in `PropertiesLoader`, `PropertiesWriter`, and `MailSettings` classes, along with tests in the `TestForm` class, were adjusted accordingly." />
|
||||
<MESSAGE value="Add Jenkins pipeline for Gradle build and notifications This commit introduces a new Jenkinsfile configured to build the project using Gradle and archive the resulting artifacts. Additionally, it includes a stage to send build notifications to Discord with details about the build status." />
|
||||
<MESSAGE value="Disable database tests in Jenkins Disabled tests that require a database connection to prevent failures in Jenkins where there isn't a database. Updated Jenkinsfile to include a property that skips these tests during the build process." />
|
||||
<MESSAGE value="Fix typo in Gradle build command in Jenkinsfile Corrected the parameter for skipping database tests from `dontRunDatabaseTests` to `doNotRunDatabaseTests` in the Gradle build step. This ensures the intended tests are skipped during the build process." />
|
||||
<MESSAGE value="Configure system property for conditional test execution Added a system property 'doNotRunDatabaseTests' in the test configuration to allow conditional skipping of database tests. This helps in running tests selectively during different build scenarios." />
|
||||
<MESSAGE value="Add CORS support for production server Updated the CORS configuration to include the production server URL. This change ensures that requests from the production environment are properly handled." />
|
||||
<MESSAGE value="Refactor logging for better granularity Updated logging levels in multiple classes to differentiate between debug and trace information. Improved log messages to support parameterized logs, ensuring sensitive or variable information is handled appropriately without concatenation." />
|
||||
<MESSAGE value="Enhance logging for mail verification details Updated logging to provide more detailed information about user credentials and email actions. This helps in debugging and monitoring mail verification processes more effectively. Adjusted trace messages to include username and password for better traceability." />
|
||||
<MESSAGE value="Update URI to point to Discord bot endpoint Changed the URI in VerifyController to use the Discord bot's endpoint for form submission. This adjustment is part of the process to route form data correctly through the specified internal service." />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Update URI to point to Discord bot endpoint Changed the URI in VerifyController to use the Discord bot's endpoint for form submission. This adjustment is part of the process to route form data correctly through the specified internal service." />
|
||||
</component>
|
||||
</project>
|
||||
42
src/main/java/com/alttd/forms/apply/StaffAppController.java
Normal file
42
src/main/java/com/alttd/forms/apply/StaffAppController.java
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
package com.alttd.forms.apply;
|
||||
|
||||
import com.alttd.forms.form.StoreFormQuery;
|
||||
import com.alttd.forms.mail.verification.VerificationResult;
|
||||
import com.alttd.forms.mail.verification.Verify;
|
||||
import jakarta.validation.Valid;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class StaffAppController {
|
||||
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(StaffAppController.class);
|
||||
|
||||
@PostMapping("/staffApplication")
|
||||
public CompletableFuture<ResponseEntity<String>> submitForm(@Valid @RequestBody StaffAppFormData formData) {
|
||||
logger.debug("submitForm");
|
||||
logger.trace(formData.toString());
|
||||
|
||||
CompletableFuture<Integer> storeFormForVerificationCode = new StoreFormQuery().storeFormForVerificationCode(formData.email, formData);
|
||||
return storeFormForVerificationCode.thenCompose(code -> Verify.verifyEmail(formData.email, code).thenApply(verificationResult -> {
|
||||
if (verificationResult == VerificationResult.VERIFICATION_SENT) {
|
||||
//TODO if this is ok tell the user they have x min to verify if they fail to do so they have to remake the form
|
||||
logger.trace("Staff application form stored and requested verification from user");
|
||||
return ResponseEntity.ok("User Data received and email verification sent.");
|
||||
} else {
|
||||
logger.trace("Failed to send verification email");
|
||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
|
||||
.body("Failed to send verification email. Reason: " + verificationResult.name());
|
||||
}
|
||||
})).exceptionally(throwable -> {
|
||||
logger.error("Failed to store form", throwable);
|
||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("Failed to store your form");
|
||||
});
|
||||
}
|
||||
}
|
||||
118
src/main/java/com/alttd/forms/apply/StaffAppFormData.java
Normal file
118
src/main/java/com/alttd/forms/apply/StaffAppFormData.java
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
package com.alttd.forms.apply;
|
||||
|
||||
import com.alttd.forms.form.Form;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
public class StaffAppFormData extends Form {
|
||||
|
||||
public StaffAppFormData(String username, String email, String discord, String pc_requirements, int age, String pronoun, LocalDate join_date, int avg_time, String available_days, String available_time, String staff_experience, String plugin_experience, String why_staff, String expectations_mod, String other) {
|
||||
this.username = username;
|
||||
this.email = email;
|
||||
this.discord = discord;
|
||||
this.pc_requirements = pc_requirements;
|
||||
this.age = age;
|
||||
this.pronoun = pronoun;
|
||||
this.join_date = join_date;
|
||||
this.avg_time = avg_time;
|
||||
this.available_days = available_days;
|
||||
this.available_time = available_time;
|
||||
this.staff_experience = staff_experience;
|
||||
this.plugin_experience = plugin_experience;
|
||||
this.why_staff = why_staff;
|
||||
this.expectations_mod = expectations_mod;
|
||||
this.other = other;
|
||||
}
|
||||
|
||||
@NotEmpty(message = "Username is required")
|
||||
@Length(min = 3, max = 16, message = "Username should be between 3 and 16 characters")
|
||||
@Pattern(regexp = "^[a-zA-Z0-9_]*$", message = "Username should only include alphanumeric characters and underscore")
|
||||
public final String username;
|
||||
|
||||
@NotEmpty(message = "E-mail address is required")
|
||||
@Email(message = "Invalid email")
|
||||
@Length(min = 3, max = 254, message = "Email should be between 3 and 254 characters")
|
||||
public final String email;
|
||||
|
||||
@NotEmpty(message = "Discord name is required")
|
||||
@Length(min = 2, max = 32, message = "Discord name should be between 2 and 32 characters")
|
||||
@Pattern(regexp = "^(?!.*\\..)([a-z0-9._]{2,32})$", message = "Please enter a valid Discord name")
|
||||
public final String discord;
|
||||
|
||||
@NotEmpty(message = "An answer is required")
|
||||
@Length(min = 2, max = 3, message = "Please answer yes or no")
|
||||
@Pattern(regexp = "(yes|no)$", message = "Yes or no")
|
||||
public final String pc_requirements;
|
||||
|
||||
@Min(value = 0, message = "Please enter a valid age")
|
||||
@Max(value = 999, message = "We do not accept players older than 999 years old sorry!")
|
||||
public final int age;
|
||||
|
||||
@Length(max = 16, message = "Pronouns can't be longer than 16 characters")
|
||||
public final String pronoun;
|
||||
|
||||
@NotNull(message = "Your join date is required, if you're not sure enter an estimated date")
|
||||
public final LocalDate join_date;
|
||||
|
||||
@Range(min = 0, max = 168, message = "The only valid values are 0-168")
|
||||
public final int avg_time;
|
||||
|
||||
@NotEmpty(message = "Available days are required")
|
||||
@Length(min = 6, max = 128, message = "Available days should be between 6 and 128 characters")
|
||||
public final String available_days;
|
||||
|
||||
@NotEmpty(message = "Available time is required")
|
||||
@Length(min = 3, max = 256, message = "Available time should be between 3 and 256 characters")
|
||||
public final String available_time;
|
||||
|
||||
@NotEmpty(message = "Staff experience is required")
|
||||
@Length(min = 2, max = 2000, message = "Experience should be between 2 and 2000 characters")
|
||||
public final String staff_experience;
|
||||
|
||||
@NotEmpty(message = "Plugin experience is required")
|
||||
@Length(min = 2, max = 2000, message = "Experience should be between 2 and 2000 characters")
|
||||
public final String plugin_experience;
|
||||
|
||||
@NotEmpty(message = "Reason for wanting to be a moderator is required")
|
||||
@Length(min = 2, max =2000, message = "Reason should be between 2 and 2000 characters")
|
||||
public final String why_staff;
|
||||
|
||||
@NotEmpty(message = "Expectations of a moderator is required")
|
||||
@Length(min = 2, max = 2000, message = "Expectation should be between 2 and 2000 characters")
|
||||
public final String expectations_mod;
|
||||
|
||||
@Length(max = 2000, message = "Text can't be longer than 2000 characters")
|
||||
public final String other;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StaffAppFormData{" +
|
||||
"username='" + username + '\'' +
|
||||
", email='" + email + '\'' +
|
||||
", discord='" + discord + '\'' +
|
||||
", pc_requirements='" + pc_requirements + '\'' +
|
||||
", age=" + age +
|
||||
", pronoun='" + pronoun + '\'' +
|
||||
", join_date=" + join_date +
|
||||
", avg_time=" + avg_time +
|
||||
", available_days='" + available_days + '\'' +
|
||||
", available_time='" + available_time + '\'' +
|
||||
", staff_experience='" + staff_experience + '\'' +
|
||||
", plugin_experience='" + plugin_experience + '\'' +
|
||||
", why_staff='" + why_staff + '\'' +
|
||||
", expectations_mod='" + expectations_mod + '\'' +
|
||||
", other='" + other + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toHtml() {
|
||||
String[] fields = {"Username", "Email", "Discord", "PC requirements", "Age", "Pronoun", "Join date", "Avg time", "Available days", "Available time", "Staff experience", "Plugin experience", "Why staff", "Expectations mod", "Other"};
|
||||
String[] values = {username, email, discord, pc_requirements, String.valueOf(age), pronoun, join_date.toString(), String.valueOf(avg_time), available_days, available_time, staff_experience, plugin_experience, why_staff, expectations_mod, other};
|
||||
|
||||
return toHtml(fields, values);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,2 +1,3 @@
|
|||
logging.level.com.alttd.forms=warn
|
||||
server.port=8002
|
||||
server.port=8002
|
||||
spring.jackson.date-format=yyyy-MM-dd
|
||||
Loading…
Reference in New Issue
Block a user