ProjectsController

@RestController
@RequestMapping(value = "/api/v1/")
open class ProjectsController : ProjectManager

The ProjectsController class is useful to manage all the project operations

Author

N7ghtm4r3 - Tecknobit

See also

Constructors

Link copied to clipboard
@Autowired
constructor(projectsHelper: ProjectsHelper, usersHelper: EquinoxUsersHelper<NovaUser>)
Constructor to init the ProjectsController controller

Properties

Link copied to clipboard
protected open var currentProject: Project
currentProject the current project in use
Link copied to clipboard
protected open var jsonHelper: JsonHelper
Link copied to clipboard
protected val mantis: Mantis
Link copied to clipboard
protected open var me: T
Link copied to clipboard
Link copied to clipboard
projectsHelper helper to manage the project database operations
Link copied to clipboard
open var resourcesProvider: ResourcesProvider
Link copied to clipboard
val RESPONSE_SUCCESSFUL_MESSAGE: String = "operation_executed_successfully_key"
Link copied to clipboard
protected open var serverProtector: ServerProtector
Link copied to clipboard
private val usersHelper: EquinoxUsersHelper<NovaUser>
usersHelper helper to manage the users database operations
Link copied to clipboard
protected open var usersRepository: EquinoxUsersRepository<T>
Link copied to clipboard
val WRONG_PROCEDURE_MESSAGE: String = "wrong_procedure_key"

Functions

Link copied to clipboard
@PutMapping(path = ""/{" + IDENTIFIER_KEY + "}/" + PROJECTS_KEY + "/{" + PROJECT_IDENTIFIER_KEY + "}" + ADD_MEMBERS_ENDPOINT", headers = [])
open fun addMembers(@PathVariable(value = "id") id: String, @PathVariable(value = "project_id") projectId: String, @RequestHeader(value = "token") token: String, @RequestBody payload: String): String
Method to add members in a project
Link copied to clipboard
@PostMapping(path = ""/{" + IDENTIFIER_KEY + "}/" + PROJECTS_KEY", headers = [])
open fun addProject(@PathVariable(value = "id") id: String, @RequestHeader(value = "token") token: String, @ModelAttribute payload: ProjectsHelper.ProjectPayload): String
Method to add a project
Link copied to clipboard
protected open fun amIProjectMember(userId: String, projectId: String): Boolean
Method to get whether the user who made a request on server is an authorized member of a project
Link copied to clipboard
@DeleteMapping(path = "/{" + IDENTIFIER_KEY + "}/" + PROJECTS_KEY + "/{" + PROJECT_IDENTIFIER_KEY + "}", headers = [])
open fun deleteProject(@PathVariable(value = "id") id: String, @PathVariable(value = "project_id") projectId: String, @RequestHeader(value = "token") token: String): String
Method to delete a project
Link copied to clipboard
@PostMapping(path = "/{" + IDENTIFIER_KEY + "}/" + PROJECTS_KEY + "/{" + PROJECT_IDENTIFIER_KEY + "}", headers = [])
open fun editProject(@PathVariable(value = "id") id: String, @PathVariable(value = "project_id") projectId: String, @RequestHeader(value = "token") token: String, @ModelAttribute payload: ProjectsHelper.ProjectPayload): String
Method to update a project
Link copied to clipboard
protected open fun failedResponse(error: String): String
Link copied to clipboard
private open fun fetchJoiningQRCode(): JoiningQRCode
Method to get a joining code from the database No-any params required
Link copied to clipboard
Link copied to clipboard
@GetMapping(path = "/{" + IDENTIFIER_KEY + "}/" + PROJECTS_KEY + "/{" + PROJECT_IDENTIFIER_KEY + "}", headers = [])
open fun <T> getProject(@PathVariable(value = "id") id: String, @PathVariable(value = "project_id") projectId: String, @RequestHeader(value = "token") token: String): T
Method to get a project
Link copied to clipboard
open fun initEquinoxEnvironment(storagePath: String, saveMessage: String, context: Class<out Any>, args: Array<String>, customSubDirectories: Array<String>)
Link copied to clipboard
protected open fun isAuthorizedUser(userId: String, projectId: String): Boolean
Method to get whether the user who made a request on server is an authorized member to make operations on the checked project such upload asset or promote releases, so is the author or a Vendor
Link copied to clipboard
protected open fun isMe(id: String, token: String): Boolean
Link copied to clipboard
protected open fun isProjectAuthor(project: Project, userId: String): Boolean
protected open fun isProjectAuthor(userId: String, projectId: String): Boolean
Method to get whether the user who made a request on server is the author of the checked project
Link copied to clipboard
protected open fun isUserQualified(userId: String, projectId: String): Boolean
Method to get whether the user who made a request on server is a qualified member to make operations on the checked project such comment release, so is a Customer
Link copied to clipboard
@PostMapping(path = "PROJECTS_KEY + JOIN_ENDPOINT")
open fun join(@RequestBody payload: Map<String, String>): String
Method to join in a project.
Link copied to clipboard
@DeleteMapping(path = ""/{" + IDENTIFIER_KEY + "}/" + PROJECTS_KEY + "/{" + PROJECT_IDENTIFIER_KEY + "}" + LEAVE_ENDPOINT", headers = [])
open fun leave(@PathVariable(value = "id") id: String, @PathVariable(value = "project_id") projectId: String, @RequestHeader(value = "token") token: String): String
Method to leave from a project
Link copied to clipboard
@GetMapping(path = ""/{" + IDENTIFIER_KEY + "}/" + PROJECTS_KEY", headers = [])
open fun <T> list(@PathVariable(value = "id") id: String, @RequestHeader(value = "token") token: String): T
Method to get a projects list
Link copied to clipboard
protected open fun <V> loadJsonHelper(payload: Map<String, V>)
Link copied to clipboard
@PatchMapping(path = ""/{" + IDENTIFIER_KEY + "}/" + PROJECTS_KEY + "/{" + PROJECT_IDENTIFIER_KEY + "}" + MARK_MEMBER_AS_TESTER_ENDPOINT", headers = [])
open fun markAsTester(@PathVariable(value = "id") id: String, @PathVariable(value = "project_id") projectId: String, @RequestHeader(value = "token") token: String, @RequestBody payload: Map<String, String>): String
Method to mark a member as Tester of the project
Link copied to clipboard
@PatchMapping(path = ""/{" + IDENTIFIER_KEY + "}/" + PROJECTS_KEY + "/{" + PROJECT_IDENTIFIER_KEY + "}" + REMOVE_MEMBER_ENDPOINT", headers = [])
open fun removeMember(@PathVariable(value = "id") id: String, @PathVariable(value = "project_id") projectId: String, @RequestHeader(value = "token") token: String, @RequestBody payload: Map<String, String>): String
Method to remove a member from a project
Link copied to clipboard
protected open fun successResponse(): String
protected open fun <V> successResponse(value: V): HashMap<String, V>