fixed model for notifications workspace

This commit is contained in:
Massimiliano Assante 2022-05-02 17:30:20 +02:00
parent 2fcbb24d63
commit 99d46e7fc9
7 changed files with 10 additions and 18 deletions

View File

@ -1,6 +1,6 @@
# Changelog
## [v1.1.1-SNAPSHOT] - 2022-04-21
## [v1.1.2-SNAPSHOT] - 2022-04-21
- Partially added support for workspace notifications

View File

@ -12,7 +12,7 @@
<groupId>org.gcube.social-networking</groupId>
<artifactId>social-service-model</artifactId>
<version>1.1.1-SNAPSHOT</version>
<version>1.1.2-SNAPSHOT</version>
<packaging>jar</packaging>
<name>social-networking-service-model</name>
<description>Social networking service model classes</description>

View File

@ -6,9 +6,8 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
@JsonTypeName("ITEM_NEW")
@JsonIgnoreProperties(ignoreUnknown=true)
public class WSAddedItemNotificationBean extends WorkspaceNotificationBean {
public class WSAddedItemNotificationBean implements WorkspaceNotificationBean {
/**
* the username of the user you wish to notify
*/

View File

@ -7,9 +7,8 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
@JsonTypeName("FOLDER_SHARE")
@JsonIgnoreProperties(ignoreUnknown=true)
public class WSSharedFolderNotificationBean extends WorkspaceNotificationBean {
public class WSSharedFolderNotificationBean implements WorkspaceNotificationBean {
/**
* the username of the user you wish to notify

View File

@ -6,8 +6,8 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
@JsonTypeName("FOLDER_UNSHARE")
public class WSUnsharedFolderNotificationBean extends WorkspaceNotificationBean {
@JsonIgnoreProperties(ignoreUnknown=true)
public class WSUnsharedFolderNotificationBean implements WorkspaceNotificationBean {
/**
* the username of the user you wish to notify

View File

@ -1,17 +1,8 @@
package org.gcube.social_networking.socialnetworking.model.beans;
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)
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME,
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 {
public interface WorkspaceNotificationBean {
}

View File

@ -1,9 +1,12 @@
package org.gcube.social_networking.socialnetworking.model.beans;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
public class WorkspaceNotificationMessage {
private WorkspaceNotificationType type;
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS)
private WorkspaceNotificationBean bean;
public WorkspaceNotificationMessage() {