fixed model for notifications workspace
This commit is contained in:
parent
2fcbb24d63
commit
99d46e7fc9
|
@ -1,6 +1,6 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## [v1.1.1-SNAPSHOT] - 2022-04-21
|
## [v1.1.2-SNAPSHOT] - 2022-04-21
|
||||||
|
|
||||||
- Partially added support for workspace notifications
|
- Partially added support for workspace notifications
|
||||||
|
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
<groupId>org.gcube.social-networking</groupId>
|
<groupId>org.gcube.social-networking</groupId>
|
||||||
<artifactId>social-service-model</artifactId>
|
<artifactId>social-service-model</artifactId>
|
||||||
<version>1.1.1-SNAPSHOT</version>
|
<version>1.1.2-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>social-networking-service-model</name>
|
<name>social-networking-service-model</name>
|
||||||
<description>Social networking service model classes</description>
|
<description>Social networking service model classes</description>
|
||||||
|
|
|
@ -6,9 +6,8 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||||
|
|
||||||
@JsonTypeName("ITEM_NEW")
|
|
||||||
@JsonIgnoreProperties(ignoreUnknown=true)
|
@JsonIgnoreProperties(ignoreUnknown=true)
|
||||||
public class WSAddedItemNotificationBean extends WorkspaceNotificationBean {
|
public class WSAddedItemNotificationBean implements WorkspaceNotificationBean {
|
||||||
/**
|
/**
|
||||||
* the username of the user you wish to notify
|
* the username of the user you wish to notify
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -7,9 +7,8 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||||
|
|
||||||
|
|
||||||
@JsonTypeName("FOLDER_SHARE")
|
|
||||||
@JsonIgnoreProperties(ignoreUnknown=true)
|
@JsonIgnoreProperties(ignoreUnknown=true)
|
||||||
public class WSSharedFolderNotificationBean extends WorkspaceNotificationBean {
|
public class WSSharedFolderNotificationBean implements WorkspaceNotificationBean {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the username of the user you wish to notify
|
* the username of the user you wish to notify
|
||||||
|
|
|
@ -6,8 +6,8 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||||
|
|
||||||
@JsonTypeName("FOLDER_UNSHARE")
|
@JsonIgnoreProperties(ignoreUnknown=true)
|
||||||
public class WSUnsharedFolderNotificationBean extends WorkspaceNotificationBean {
|
public class WSUnsharedFolderNotificationBean implements WorkspaceNotificationBean {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the username of the user you wish to notify
|
* the username of the user you wish to notify
|
||||||
|
|
|
@ -1,17 +1,8 @@
|
||||||
package org.gcube.social_networking.socialnetworking.model.beans;
|
package org.gcube.social_networking.socialnetworking.model.beans;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
|
|
||||||
|
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME,
|
public interface WorkspaceNotificationBean {
|
||||||
include = As.PROPERTY, property = "type") @JsonSubTypes({
|
|
||||||
@JsonSubTypes.Type(value = WSSharedFolderNotificationBean.class, name = "FOLDER_SHARE"),
|
|
||||||
@JsonSubTypes.Type(value = WSUnsharedFolderNotificationBean.class, name = "FOLDER_UNSHARE"),
|
|
||||||
@JsonSubTypes.Type(value = WSAddedItemNotificationBean.class, name = "ITEM_NEW")
|
|
||||||
})
|
|
||||||
public abstract class WorkspaceNotificationBean {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
package org.gcube.social_networking.socialnetworking.model.beans;
|
package org.gcube.social_networking.socialnetworking.model.beans;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||||
|
|
||||||
public class WorkspaceNotificationMessage {
|
public class WorkspaceNotificationMessage {
|
||||||
|
|
||||||
private WorkspaceNotificationType type;
|
private WorkspaceNotificationType type;
|
||||||
|
|
||||||
|
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS)
|
||||||
private WorkspaceNotificationBean bean;
|
private WorkspaceNotificationBean bean;
|
||||||
|
|
||||||
public WorkspaceNotificationMessage() {
|
public WorkspaceNotificationMessage() {
|
||||||
|
|
Loading…
Reference in New Issue