Commit 19846ed8 authored by Rosanny Sihombing's avatar Rosanny Sihombing
Browse files

add classes

parent bc16c384
class Project {
constructor(ownerGitlabId, id, name, desc, logo) {
this.ownerGitlabId = ownerGitlabId
this.id = id
this.name = name
this.desc = desc
this.logo = logo
}
// getter
getOwnerGitlabId() {
return this.ownerGitlabId
}
getId() {
return this.id
}
getName() {
return this.name
}
getDesc() {
return this.desc
}
getLogo() {
return this.logo
}
// setter
setOwnerGitlabId(newOwnerGitlabId){
this.ownerGitlabId = newOwnerGitlabId
}
setId(newId) {
this.id = newId
}
setName(newName) {
this.name = newName
}
setDesc(newDesc) {
this.desc = newDesc
}
setLogo(newLogoUrl){
this.logo = newLogoUrl
}
}
module.exports = Project
\ No newline at end of file
const Project = require("./project");
class Repo extends Project {
constructor(ownerGitlabId, id, name, desc, logo) {
super(ownerGitlabId, id, name, desc, logo)
}
}
module.exports = Repo
\ No newline at end of file
class User {
constructor(id, email, salutation, title, firstName, lastName, industry, organisation, speciality, m4lab_idp, gitlabUserId, verificationStatus) {
constructor(id, email, salutation, title, firstName, lastName, industry, organisation, speciality, is_m4lab_idp, gitlabUserId, verificationStatus) {
this.id = id
this.email = email
this.salutation = salutation
......@@ -9,15 +9,55 @@ class User {
this.industry = industry
this.organisation = organisation
this.speciality = speciality
this.m4lab_idp = m4lab_idp
this.is_m4lab_idp = is_m4lab_idp // 1 or 0
this.gitlabUserId = gitlabUserId
this.verificationStatus = verificationStatus
}
// getter
get fullName() {
getFullName() {
return this.firstName+' '+this.lastName
}
getIdpStatus() {
return this.is_m4lab_idp
}
getGitlabUserId() {
return this.gitlabUserId
}
// setter
setEmail(email) {
this.email = email
}
setSalutation(salutation) {
this.salutation = salutation
}
setTitle(title) {
this.title = title
}
setFirstName(firstName) {
this.firstName = firstName
}
setLastName(lastName) {
this.lastName = lastName
}
setIndustry(industry) {
this.industry = industry
}
setOrganisation(organisation) {
this.organisation = organisation
}
setSpeciality(speciality) {
this.speciality = speciality
}
setM4lab_idp(m4lab_idp) {
this.m4lab_idp = m4lab_idp
}
setGitlabUserId(newGitlabUserId) {
this.gitlabUserId = newGitlabUserId
}
setVerificationStatus(verificationStatus) {
this.verificationStatus = verificationStatus
}
}
module.exports = User
\ No newline at end of file
const Project = require("./project");
class Website extends Project {
constructor(ownerGitlabId, id, name, desc, logo, settingUrl, kontaktUrl) {
super(ownerGitlabId, id, name, desc, logo)
this.settingUrl = settingUrl
this.kontaktUrl = kontaktUrl
}
// getter
getSettingUrl() {
return this.settingUrl
}
getKontaktUrl() {
return this.kontaktUrl
}
// setter
setSettingUrl(newSettingUrl) {
this.settingUrl = newSettingUrl
}
setKontaktUrl(newKontaktUrl) {
this.kontaktUrl = newKontaktUrl
}
}
module.exports = Website
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment