mirror of
https://github.com/HangarMC/Hangar.git
synced 2024-11-21 01:21:54 +08:00
Fix webhook avatar, simplify message title
This commit is contained in:
parent
cf4b92d273
commit
1a78c0b7c2
@ -1,13 +1,14 @@
|
||||
package io.papermc.hangar.components.webhook.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonRawValue;
|
||||
import java.util.List;
|
||||
|
||||
public record DiscordWebhook(
|
||||
String username,
|
||||
String avatarUrl,
|
||||
@JsonProperty("avatar_url") String avatarUrl,
|
||||
@JsonRawValue String embeds,
|
||||
AllowedMentions allowedMentions
|
||||
@JsonProperty("allowed_mentions") AllowedMentions allowedMentions
|
||||
) {
|
||||
|
||||
public DiscordWebhook(final String embeds) {
|
||||
|
@ -31,7 +31,7 @@ public class WebhookService {
|
||||
[
|
||||
{
|
||||
"id": {{id}},
|
||||
"title": "{{author}} / {{name}} is now available on Hangar!",
|
||||
"title": "{{author}}/{{name}}",
|
||||
"description": "{{description}}",
|
||||
"color": 2326507,
|
||||
"fields": [],
|
||||
@ -50,7 +50,7 @@ public class WebhookService {
|
||||
[
|
||||
{
|
||||
"id": {{id}},
|
||||
"title": "Version {{version}} for {{author}} / {{name}} has been released!",
|
||||
"title": "Version {{version}} - {{author}}/{{name}}",
|
||||
"description": "{{description}}",
|
||||
"color": 2326507,
|
||||
"fields": [],
|
||||
|
@ -61,7 +61,7 @@ public class JobService extends HangarComponent {
|
||||
@Transactional
|
||||
public void schedule(final Job... jobs) {
|
||||
for (final Job job : jobs) {
|
||||
logger.info("Scheduling job: {}", job);
|
||||
this.logger.info("Scheduling job: {}", job);
|
||||
this.jobsDAO.save(job.toTable());
|
||||
}
|
||||
}
|
||||
|
@ -472,7 +472,7 @@ public class VersionFactory extends HangarComponent {
|
||||
final Platform platform = entry.getKey();
|
||||
final Set<String> versionsForPlatform = new HashSet<>(this.platformService.getFullVersionsForPlatform(platform));
|
||||
if (!versionsForPlatform.containsAll(entry.getValue())) {
|
||||
throw new HangarApiException(HttpStatus.BAD_REQUEST, "version.new.error.invalidPlatformVersion", entry.getValue());
|
||||
throw new HangarApiException(HttpStatus.BAD_REQUEST, "version.new.error.invalidPlatformVersionList", entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user