Teams Service

@Service
open class TeamsService : EquinoxItemsHelper, RefyResourcesManager, RefyItemRetriever<T>

The TeamsHelper class is useful to manage all the Team database operations

Author

N7ghtm4r3 - Tecknobit

See also

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
Record class representing a team payload useful to create or edit a Team

Properties

Link copied to clipboard
private val _IN_CLAUSE_: String = " IN "
Link copied to clipboard
val _VALUES_: String = " VALUES "
Link copied to clipboard
val _WHERE_: String = " WHERE "
Link copied to clipboard
Link copied to clipboard
@Autowired
private open var collectionsRepository: CollectionsRepository
collectionsRepository instance for the collections repository
Link copied to clipboard
val COMMA: String = ","
Link copied to clipboard
val DELETE_FROM_: String = "DELETE FROM "
Link copied to clipboard
protected open var entityManager: EntityManager
Link copied to clipboard
@Autowired
private open var linksRepository: LinksRepository
linksRepository instance for the links repository
Link copied to clipboard
val LOGOS_DIRECTORY: String = "logos"
LOGOS_DIRECTORY the key of the logos folder where the logos of the team will be saved
Link copied to clipboard
Link copied to clipboard
val PROFILES_DIRECTORY: String = "profiles"
Link copied to clipboard
Link copied to clipboard
val RESOURCES_KEY: String = "resources"
Link copied to clipboard
val RESOURCES_PATH: String = "resources/"
Link copied to clipboard
val SINGLE_QUOTE: String = "'"
Link copied to clipboard
@Autowired
private open var teamsRepository: TeamsRepository
teamsRepository instance for the teams repository

Functions

Link copied to clipboard
protected open fun batchDelete(table: String, values: Collection<out Any>, columns: Array<@NotNull String>)
Link copied to clipboard
protected open fun <V> batchInsert(    command: EquinoxItemsHelper.InsertCommand,     table: String,     batchQuery: EquinoxItemsHelper.BatchQuery<V>)
Link copied to clipboard
open fun changeMemberRole(teamId: String, memberId: String, role: TeamRole)
Method change the role of a team member
Link copied to clipboard
open fun createLogoResource(resource: MultipartFile, resourceId: String): String
Method to create the pathname for a logo picture of a team
Link copied to clipboard
open fun createProfileResource(resource: MultipartFile, resourceId: String): String
Link copied to clipboard
open fun createResource(resource: MultipartFile, resourcesDirectory: String, resourceId: String): String
Link copied to clipboard
open fun createTeam(userId: String, teamId: String, payload: TeamsService.TeamPayload)
Method to create a new team
Link copied to clipboard
open fun deleteLogoResource(teamId: String): Boolean
Method to delete a logo picture of a team
Link copied to clipboard
Link copied to clipboard
open fun deleteResource(resourcesDirectory: String, resourceId: String): Boolean
Link copied to clipboard
open fun deleteTeam(teamId: String)
Method to delete a team
Link copied to clipboard
open fun editTeam(userId: String, team: Team, payload: TeamsService.TeamPayload)
Method to edit a team
Link copied to clipboard
open fun getAllUserTeams(userId: String, page: Int, pageSize: Int, keywords: Set<String>): PaginatedResponse<Team>
Method to get all the user's teams
Link copied to clipboard
open fun getItemIfAllowed(userId: String, teamId: String): Team
Method used to get an item if the user is authorized
Link copied to clipboard
open fun getSuffixResource(resource: MultipartFile): String
Link copied to clipboard
open fun getTeamCollections(teamId: String, page: Int, pageSize: Int): PaginatedResponse<LinksCollection>
Method to get the collections shared with the team
Link copied to clipboard
open fun getTeamLinks(teamId: String, page: Int, pageSize: Int, keywords: Set<String>): PaginatedResponse<RefyLink>
Method to get the links shared in a team
Link copied to clipboard
open fun getUserOwnedTeams(userId: String, page: Int, pageSize: Int): PaginatedResponse<Team>
Method to get the user's owned teams
Link copied to clipboard
open fun getUserTeams(userId: String): HashSet<String>
Method to get the user's owned teams identifiers
Link copied to clipboard
open fun removeCollectionFromTeam(teamId: String, collectionId: String)
Method to remove a collection from a team
Link copied to clipboard
open fun removeLinkFromTeam(teamId: String, linkId: String)
Method to remove a link from a team
Link copied to clipboard
open fun removeMember(teamId: String, memberId: String)
Method to remove a member from a team
Link copied to clipboard
open fun saveResource(resource: MultipartFile, path: String)
Link copied to clipboard
open fun shareCollectionsWithTeam(userId: String, teamId: String, collections: List<String>)
Method to share the collections with the team
Link copied to clipboard
open fun shareLinksWithTeam(userId: String, teamId: String, links: List<String>)
Method to share the links with the team
Link copied to clipboard
protected open fun <V> syncBatch(model: EquinoxItemsHelper.SyncBatchModel, table: String, batchQuery: EquinoxItemsHelper.BatchQuery<V>)
Method to execute a batch synchronization of a list of data simultaneously
Link copied to clipboard
private open fun synchronizeMembers(userId: String, teamId: String, payload: TeamsService.TeamPayload)