mirror of
https://github.com/Qortal/qortal.git
synced 2025-03-26 23:44:34 +00:00
Remove duplicates in GET /arbitrary/hosted/resources response
This commit is contained in:
parent
fcdcc939e6
commit
54af36fb85
@ -400,7 +400,9 @@ public class ArbitraryResource {
|
|||||||
arbitraryResourceInfo.name = transactionData.getName();
|
arbitraryResourceInfo.name = transactionData.getName();
|
||||||
arbitraryResourceInfo.service = transactionData.getService();
|
arbitraryResourceInfo.service = transactionData.getService();
|
||||||
arbitraryResourceInfo.identifier = transactionData.getIdentifier();
|
arbitraryResourceInfo.identifier = transactionData.getIdentifier();
|
||||||
resources.add(arbitraryResourceInfo);
|
if (!resources.contains(arbitraryResourceInfo)) {
|
||||||
|
resources.add(arbitraryResourceInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (includeStatus != null && includeStatus == true) {
|
if (includeStatus != null && includeStatus == true) {
|
||||||
|
@ -4,6 +4,7 @@ import org.qortal.arbitrary.misc.Service;
|
|||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class ArbitraryResourceInfo {
|
public class ArbitraryResourceInfo {
|
||||||
@ -16,4 +17,19 @@ public class ArbitraryResourceInfo {
|
|||||||
public ArbitraryResourceInfo() {
|
public ArbitraryResourceInfo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (o == this)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (!(o instanceof ArbitraryResourceInfo))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
ArbitraryResourceInfo other = (ArbitraryResourceInfo) o;
|
||||||
|
|
||||||
|
return Objects.equals(this.name, other.name) &&
|
||||||
|
Objects.equals(this.service, other.service) &&
|
||||||
|
Objects.equals(this.identifier, other.identifier);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user