-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: IM-393 Add Create tag notification REST call
- Loading branch information
1 parent
4a85dde
commit 49133ea
Showing
7 changed files
with
201 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
klab.hub/src/main/java/org/integratedmodelling/klab/hub/tags/enums/ITagElementEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.integratedmodelling.klab.hub.tags.enums; | ||
|
||
/** | ||
* Use for determinate entity of MongoTag, if is NULL is generic | ||
* | ||
* @author kristina | ||
* | ||
*/ | ||
public enum ITagElementEnum { | ||
USER, GROUP; | ||
|
||
} |
63 changes: 63 additions & 0 deletions
63
klab.hub/src/main/java/org/integratedmodelling/klab/hub/tags/payload/TagRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package org.integratedmodelling.klab.hub.tags.payload; | ||
|
||
public class TagRequest { | ||
|
||
private String id; | ||
private String type; | ||
private String iTagElement; | ||
private String iTagElementId; | ||
private String name; | ||
private String title; | ||
private String message; | ||
private String visible; | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
public String getType() { | ||
return type; | ||
} | ||
public void setType(String type) { | ||
this.type = type; | ||
} | ||
public String getiTagElement() { | ||
return iTagElement; | ||
} | ||
public void setiTagElement(String iTagElement) { | ||
this.iTagElement = iTagElement; | ||
} | ||
public String getiTagElementId() { | ||
return iTagElementId; | ||
} | ||
public void setiTagElementId(String iTagElementId) { | ||
this.iTagElementId = iTagElementId; | ||
} | ||
public String getName() { | ||
return name; | ||
} | ||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
public String getTitle() { | ||
return title; | ||
} | ||
public void setTitle(String title) { | ||
this.title = title; | ||
} | ||
public String getMessage() { | ||
return message; | ||
} | ||
public void setMessage(String message) { | ||
this.message = message; | ||
} | ||
public String getVisible() { | ||
return visible; | ||
} | ||
public void setVisible(String visible) { | ||
this.visible = visible; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
klab.hub/src/main/java/org/integratedmodelling/klab/hub/users/services/UserService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.integratedmodelling.klab.hub.users.services; | ||
|
||
import org.integratedmodelling.klab.hub.repository.UserRepository; | ||
import org.integratedmodelling.klab.hub.tags.dto.ITagElement; | ||
import org.integratedmodelling.klab.hub.users.dto.User; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.security.core.userdetails.UsernameNotFoundException; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class UserService { | ||
|
||
@Autowired | ||
private UserRepository userRepository; | ||
|
||
public User getUserByUsername(String username) throws UsernameNotFoundException { | ||
|
||
return userRepository.findByNameIgnoreCase(username).get(); | ||
|
||
} | ||
|
||
public ITagElement getUserById(String id) { | ||
return userRepository.findById(id).get(); | ||
} | ||
|
||
} |