mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 17:05:43 +01:00
add avatarUrl / fix conditions_os to list of string
This commit is contained in:
@@ -3,7 +3,6 @@ package sonia.scm.api.v2.resources;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
@@ -51,6 +50,7 @@ public final class PluginCenterDto implements Serializable {
|
||||
private String category;
|
||||
private String version;
|
||||
private String author;
|
||||
private String avatarUrl;
|
||||
private String sha256;
|
||||
|
||||
@XmlElement(name = "conditions")
|
||||
@@ -69,7 +69,7 @@ public final class PluginCenterDto implements Serializable {
|
||||
@AllArgsConstructor
|
||||
public static class Condition {
|
||||
|
||||
private String os;
|
||||
private List<String> os;
|
||||
private String arch;
|
||||
private String minVersion;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package sonia.scm.api.v2.resources;
|
||||
import sonia.scm.plugin.PluginCondition;
|
||||
import sonia.scm.plugin.PluginInformation;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@@ -24,7 +23,7 @@ public class PluginCenterDtoMapper {
|
||||
|
||||
if (plugin.getConditions() != null) {
|
||||
PluginCenterDto.Condition condition = plugin.getConditions();
|
||||
pluginInformation.setCondition(new PluginCondition(condition.getMinVersion(), Collections.singletonList(condition.getOs()), condition.getArch()));
|
||||
pluginInformation.setCondition(new PluginCondition(condition.getMinVersion(), condition.getOs(), condition.getArch()));
|
||||
}
|
||||
|
||||
pluginInformationSet.add(pluginInformation);
|
||||
|
||||
@@ -3,7 +3,6 @@ package sonia.scm.api.v2.resources;
|
||||
import de.otto.edison.hal.HalRepresentation;
|
||||
import de.otto.edison.hal.Links;
|
||||
import lombok.Getter;
|
||||
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@@ -16,6 +15,7 @@ public class PluginDto extends HalRepresentation {
|
||||
private String category;
|
||||
private String version;
|
||||
private String author;
|
||||
private String avatarUrl;
|
||||
private String description;
|
||||
|
||||
public PluginDto(Links links) {
|
||||
|
||||
@@ -4,9 +4,10 @@ import de.otto.edison.hal.Links;
|
||||
import sonia.scm.plugin.PluginInformation;
|
||||
import sonia.scm.plugin.PluginState;
|
||||
import sonia.scm.plugin.PluginWrapper;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import static de.otto.edison.hal.Link.*;
|
||||
import static de.otto.edison.hal.Link.link;
|
||||
import static de.otto.edison.hal.Links.linkingTo;
|
||||
|
||||
public class PluginDtoMapper {
|
||||
@@ -43,6 +44,7 @@ public class PluginDtoMapper {
|
||||
pluginDto.setVersion(pluginInformation.getVersion());
|
||||
pluginDto.setAuthor(pluginInformation.getAuthor());
|
||||
pluginDto.setDescription(pluginInformation.getDescription());
|
||||
pluginDto.setAvatarUrl(pluginInformation.getAvatarUrl());
|
||||
|
||||
return pluginDto;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user