From e8fef550d576aa3eba9d51ea70a3beeac6157ba5 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 14 Mar 2021 09:03:03 +0200 Subject: Renamed all models to have proper naming (from model-name.ts to model-name.model.ts), updated includes of services --- src/app/services/comment.service.ts | 2 +- src/app/services/language.service.ts | 2 +- src/app/services/post.service.ts | 2 +- src/app/services/technology.service.ts | 2 +- src/app/services/user.service.ts | 6 +- src/models/comment.model.ts | 70 +++++++++++++++++++++++ src/models/comment.ts | 70 ----------------------- src/models/identity/friend.model.ts | 3 + src/models/identity/friend.ts | 3 - src/models/identity/role.model.ts | 3 + src/models/identity/role.ts | 3 - src/models/identity/user.model.ts | 100 +++++++++++++++++++++++++++++++++ src/models/identity/user.ts | 100 --------------------------------- src/models/language.model.ts | 6 ++ src/models/language.ts | 6 -- src/models/post-comment.model.ts | 5 ++ src/models/post-comment.ts | 5 -- src/models/post.model.ts | 81 ++++++++++++++++++++++++++ src/models/post.ts | 81 -------------------------- src/models/technology.model.ts | 6 ++ src/models/technology.ts | 6 -- 21 files changed, 281 insertions(+), 281 deletions(-) create mode 100644 src/models/comment.model.ts delete mode 100644 src/models/comment.ts create mode 100644 src/models/identity/friend.model.ts delete mode 100644 src/models/identity/friend.ts create mode 100644 src/models/identity/role.model.ts delete mode 100644 src/models/identity/role.ts create mode 100644 src/models/identity/user.model.ts delete mode 100644 src/models/identity/user.ts create mode 100644 src/models/language.model.ts delete mode 100644 src/models/language.ts create mode 100644 src/models/post-comment.model.ts delete mode 100644 src/models/post-comment.ts create mode 100644 src/models/post.model.ts delete mode 100644 src/models/post.ts create mode 100644 src/models/technology.model.ts delete mode 100644 src/models/technology.ts diff --git a/src/app/services/comment.service.ts b/src/app/services/comment.service.ts index c9dbf35..29707ab 100644 --- a/src/app/services/comment.service.ts +++ b/src/app/services/comment.service.ts @@ -2,7 +2,7 @@ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Guid } from 'guid-typescript'; import { Observable } from 'rxjs'; -import { Comment } from 'src/models/comment'; +import { Comment } from 'src/models/comment.model'; import { AppConstants } from '../app-constants.module'; import { TokenService } from './token.service'; diff --git a/src/app/services/language.service.ts b/src/app/services/language.service.ts index 15e241f..5846dd6 100644 --- a/src/app/services/language.service.ts +++ b/src/app/services/language.service.ts @@ -2,7 +2,7 @@ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Guid } from 'guid-typescript'; import { Observable } from 'rxjs'; -import { Language } from 'src/models/language'; +import { Language } from 'src/models/language.model'; import { AppConstants } from '../app-constants.module'; import { TokenService } from './token.service'; diff --git a/src/app/services/post.service.ts b/src/app/services/post.service.ts index 7b2a539..eb613a6 100644 --- a/src/app/services/post.service.ts +++ b/src/app/services/post.service.ts @@ -3,7 +3,7 @@ import { Injectable } from '@angular/core'; import * as FormData from 'form-data'; import { Guid } from 'guid-typescript'; import { Observable } from 'rxjs'; -import { Post } from 'src/models/post'; +import { Post } from 'src/models/post.model'; import { AppConstants } from '../app-constants.module'; import { TokenService } from './token.service'; diff --git a/src/app/services/technology.service.ts b/src/app/services/technology.service.ts index dbdc039..fcc3d4c 100644 --- a/src/app/services/technology.service.ts +++ b/src/app/services/technology.service.ts @@ -2,7 +2,7 @@ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Guid } from 'guid-typescript'; import { Observable } from 'rxjs'; -import { Technology } from 'src/models/technology'; +import { Technology } from 'src/models/technology.model'; import { AppConstants } from '../app-constants.module'; import { TokenService } from './token.service'; diff --git a/src/app/services/user.service.ts b/src/app/services/user.service.ts index 31862c4..f22952e 100644 --- a/src/app/services/user.service.ts +++ b/src/app/services/user.service.ts @@ -1,12 +1,12 @@ import { Injectable } from '@angular/core'; import { Guid } from 'guid-typescript'; -import { User } from '../../models/identity/user'; +import { User } from '../../models/identity/user.model'; import { FormGroup } from '@angular/forms'; import { AppConstants } from 'src/app/app-constants.module'; import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { Observable } from 'rxjs'; -import { Role } from 'src/models/identity/role'; -import { Friend } from 'src/models/identity/friend'; +import { Role } from 'src/models/identity/role.model'; +import { Friend } from 'src/models/identity/friend.model'; import { TokenService } from './token.service'; @Injectable({ diff --git a/src/models/comment.model.ts b/src/models/comment.model.ts new file mode 100644 index 0000000..0d1755f --- /dev/null +++ b/src/models/comment.model.ts @@ -0,0 +1,70 @@ +import { Guid } from 'guid-typescript'; + +export class Comment { + private _commentId: Guid; + private _postId: Guid; + private _issuerFirstName: string; + private _issuerLastName: string; + private _issuerUsername: string; + private _message: string; + private _timeCreated: Date; + + constructor(commentId: Guid, postId: Guid, issuerFirstName: string, issuerLastName: string, issuerUsername: string, message: string, timeCreated: Date) { + this.commentId = commentId; + this.postId = postId; + this.issuerFirstName = issuerFirstName; + this.issuerLastName = issuerLastName; + this.issuerUsername = issuerUsername; + this.message = message; + this.timeCreated = timeCreated; + } + + public get commentId(): Guid { + return this._commentId; + } + public set commentId(v: Guid) { + this._commentId = v; + } + + public get postId(): Guid { + return this._postId; + } + public set postId(v: Guid) { + this._postId = v; + } + + public get issuerFirstName(): string { + return this._issuerFirstName; + } + public set issuerFirstName(v: string) { + this._issuerFirstName = v; + } + + public get issuerLastName(): string { + return this._issuerLastName; + } + public set issuerLastName(v: string) { + this._issuerLastName = v; + } + + public get issuerUsername(): string { + return this._issuerUsername; + } + public set issuerUsername(v: string) { + this._issuerUsername = v; + } + + public get message(): string { + return this._message; + } + public set message(v: string) { + this._message = v; + } + + public get timeCreated(): Date { + return this._timeCreated; + } + public set timeCreated(v: Date) { + this._timeCreated = v; + } +} diff --git a/src/models/comment.ts b/src/models/comment.ts deleted file mode 100644 index 0d1755f..0000000 --- a/src/models/comment.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { Guid } from 'guid-typescript'; - -export class Comment { - private _commentId: Guid; - private _postId: Guid; - private _issuerFirstName: string; - private _issuerLastName: string; - private _issuerUsername: string; - private _message: string; - private _timeCreated: Date; - - constructor(commentId: Guid, postId: Guid, issuerFirstName: string, issuerLastName: string, issuerUsername: string, message: string, timeCreated: Date) { - this.commentId = commentId; - this.postId = postId; - this.issuerFirstName = issuerFirstName; - this.issuerLastName = issuerLastName; - this.issuerUsername = issuerUsername; - this.message = message; - this.timeCreated = timeCreated; - } - - public get commentId(): Guid { - return this._commentId; - } - public set commentId(v: Guid) { - this._commentId = v; - } - - public get postId(): Guid { - return this._postId; - } - public set postId(v: Guid) { - this._postId = v; - } - - public get issuerFirstName(): string { - return this._issuerFirstName; - } - public set issuerFirstName(v: string) { - this._issuerFirstName = v; - } - - public get issuerLastName(): string { - return this._issuerLastName; - } - public set issuerLastName(v: string) { - this._issuerLastName = v; - } - - public get issuerUsername(): string { - return this._issuerUsername; - } - public set issuerUsername(v: string) { - this._issuerUsername = v; - } - - public get message(): string { - return this._message; - } - public set message(v: string) { - this._message = v; - } - - public get timeCreated(): Date { - return this._timeCreated; - } - public set timeCreated(v: Date) { - this._timeCreated = v; - } -} diff --git a/src/models/identity/friend.model.ts b/src/models/identity/friend.model.ts new file mode 100644 index 0000000..22290cd --- /dev/null +++ b/src/models/identity/friend.model.ts @@ -0,0 +1,3 @@ +export class Friend { + public userName: string; +} diff --git a/src/models/identity/friend.ts b/src/models/identity/friend.ts deleted file mode 100644 index 22290cd..0000000 --- a/src/models/identity/friend.ts +++ /dev/null @@ -1,3 +0,0 @@ -export class Friend { - public userName: string; -} diff --git a/src/models/identity/role.model.ts b/src/models/identity/role.model.ts new file mode 100644 index 0000000..132b0b0 --- /dev/null +++ b/src/models/identity/role.model.ts @@ -0,0 +1,3 @@ +export class Role { + public name: string; +} diff --git a/src/models/identity/role.ts b/src/models/identity/role.ts deleted file mode 100644 index 132b0b0..0000000 --- a/src/models/identity/role.ts +++ /dev/null @@ -1,3 +0,0 @@ -export class Role { - public name: string; -} diff --git a/src/models/identity/user.model.ts b/src/models/identity/user.model.ts new file mode 100644 index 0000000..e0038e0 --- /dev/null +++ b/src/models/identity/user.model.ts @@ -0,0 +1,100 @@ +import { Guid } from 'guid-typescript'; +import { Language } from '../language'; +import { Technology } from '../technology'; +import { Friend } from './friend'; +import { Role } from './role'; + +export class User { + private _id : Guid; + private _lastName : string; + private _firstName : string; + private _userName : string; + private _email: string; + private _profilePictureURL : string; + private _languages: Language[]; + private _technologies: Technology[]; + private _roles: Role[]; + private _friends: Friend[]; + + constructor(id: Guid, userName: string, firstName: string, lastName: string, email: string, profilePictureURL: string, languages: Language[], technologies: Technology[], roles: Role[], friends: Friend[]) { + this.id = id; + this.userName = userName; + this.firstName = firstName; + this.lastName = lastName; + this.email = email; + this._profilePictureURL = profilePictureURL; + this.languages = languages; + this.technologies = technologies; + this.roles = roles; + } + + public get id(): Guid { + return this._id; + } + public set id(v: Guid) { + this._id = v; + } + + public get userName(): string { + return this._userName; + } + public set userName(v: string) { + this._userName = v; + } + + public get firstName(): string { + return this._firstName; + } + public set firstName(v: string) { + this._firstName = v; + } + + public get lastName(): string { + return this._lastName; + } + public set lastName(v: string) { + this._lastName = v; + } + + public get email(): string { + return this._email; + } + public set email(v: string) { + this._email = v; + } + + public get profilePictureURL(): string { + return this._profilePictureURL; + } + public set profilePictureURL(v: string) { + this._profilePictureURL = v; + } + + public get languages(): Language[] { + return this._languages; + } + public set languages(v: Language[]) { + this._languages = v; + } + + public get technologies(): Technology[] { + return this._technologies; + } + public set technologies(v: Technology[]) { + this._technologies = v; + } + + public get roles(): Role[] { + return this._roles; + } + public set roles(v: Role[]) { + this._roles = v; + } + + public get friends(): Friend[] { + return this._friends; + } + public set friends(v: Friend[]) { + this._friends = v; + } +} diff --git a/src/models/identity/user.ts b/src/models/identity/user.ts deleted file mode 100644 index e0038e0..0000000 --- a/src/models/identity/user.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { Guid } from 'guid-typescript'; -import { Language } from '../language'; -import { Technology } from '../technology'; -import { Friend } from './friend'; -import { Role } from './role'; - -export class User { - private _id : Guid; - private _lastName : string; - private _firstName : string; - private _userName : string; - private _email: string; - private _profilePictureURL : string; - private _languages: Language[]; - private _technologies: Technology[]; - private _roles: Role[]; - private _friends: Friend[]; - - constructor(id: Guid, userName: string, firstName: string, lastName: string, email: string, profilePictureURL: string, languages: Language[], technologies: Technology[], roles: Role[], friends: Friend[]) { - this.id = id; - this.userName = userName; - this.firstName = firstName; - this.lastName = lastName; - this.email = email; - this._profilePictureURL = profilePictureURL; - this.languages = languages; - this.technologies = technologies; - this.roles = roles; - } - - public get id(): Guid { - return this._id; - } - public set id(v: Guid) { - this._id = v; - } - - public get userName(): string { - return this._userName; - } - public set userName(v: string) { - this._userName = v; - } - - public get firstName(): string { - return this._firstName; - } - public set firstName(v: string) { - this._firstName = v; - } - - public get lastName(): string { - return this._lastName; - } - public set lastName(v: string) { - this._lastName = v; - } - - public get email(): string { - return this._email; - } - public set email(v: string) { - this._email = v; - } - - public get profilePictureURL(): string { - return this._profilePictureURL; - } - public set profilePictureURL(v: string) { - this._profilePictureURL = v; - } - - public get languages(): Language[] { - return this._languages; - } - public set languages(v: Language[]) { - this._languages = v; - } - - public get technologies(): Technology[] { - return this._technologies; - } - public set technologies(v: Technology[]) { - this._technologies = v; - } - - public get roles(): Role[] { - return this._roles; - } - public set roles(v: Role[]) { - this._roles = v; - } - - public get friends(): Friend[] { - return this._friends; - } - public set friends(v: Friend[]) { - this._friends = v; - } -} diff --git a/src/models/language.model.ts b/src/models/language.model.ts new file mode 100644 index 0000000..e3aa61e --- /dev/null +++ b/src/models/language.model.ts @@ -0,0 +1,6 @@ +import { Guid } from 'guid-typescript'; + +export class Language { + public id: Guid; + public name: string; +} diff --git a/src/models/language.ts b/src/models/language.ts deleted file mode 100644 index e3aa61e..0000000 --- a/src/models/language.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Guid } from 'guid-typescript'; - -export class Language { - public id: Guid; - public name: string; -} diff --git a/src/models/post-comment.model.ts b/src/models/post-comment.model.ts new file mode 100644 index 0000000..5d1e346 --- /dev/null +++ b/src/models/post-comment.model.ts @@ -0,0 +1,5 @@ +import { Guid } from 'guid-typescript'; + +export class PostComment { + public id: Guid; +} diff --git a/src/models/post-comment.ts b/src/models/post-comment.ts deleted file mode 100644 index 5d1e346..0000000 --- a/src/models/post-comment.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Guid } from 'guid-typescript'; - -export class PostComment { - public id: Guid; -} diff --git a/src/models/post.model.ts b/src/models/post.model.ts new file mode 100644 index 0000000..8e58bea --- /dev/null +++ b/src/models/post.model.ts @@ -0,0 +1,81 @@ +import { Guid } from 'guid-typescript'; +import { Comment } from './comment'; +import { PostComment } from './post-comment'; + +export class Post { + private _postId: Guid; + private _creatorFirstName: string; + private _creatorLastName: string; + private _creatorUsername: string; + private _message: string; + private _timeCreated: Date; + private _comments: PostComment[]; + private _fileURLs: string[]; + + constructor(postId: Guid, creatorFirstName: string, creatorLastName: string, creatorUsername: string, message: string, timeCreated: Date, comments: PostComment[], fileURLs: string[]) { + this.postId = postId; + this.creatorFirstName = creatorFirstName; + this.creatorLastName = creatorLastName; + this.creatorUsername = creatorUsername; + this.message = message; + this.timeCreated = timeCreated; + this.comments = comments; + this.fileURLs = fileURLs; + } + + public get postId(): Guid { + return this._postId; + } + public set postId(v: Guid) { + this._postId = v; + } + + public get creatorFirstName(): string { + return this._creatorFirstName; + } + public set creatorFirstName(v: string) { + this._creatorFirstName = v; + } + + public get creatorLastName(): string { + return this._creatorLastName; + } + public set creatorLastName(v: string) { + this._creatorLastName = v; + } + + public get creatorUsername(): string { + return this._creatorUsername; + } + public set creatorUsername(v: string) { + this._creatorUsername = v; + } + + public get message(): string { + return this._message; + } + public set message(v: string) { + this._message = v; + } + + public get timeCreated(): Date { + return this._timeCreated; + } + public set timeCreated(v: Date) { + this._timeCreated = v; + } + + public get comments(): PostComment[] { + return this._comments; + } + public set comments(v: PostComment[]) { + this._comments = v; + } + + public get fileURLs(): string[] { + return this._fileURLs; + } + public set fileURLs(v: string[]) { + this._fileURLs = v; + } +} diff --git a/src/models/post.ts b/src/models/post.ts deleted file mode 100644 index 8e58bea..0000000 --- a/src/models/post.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { Guid } from 'guid-typescript'; -import { Comment } from './comment'; -import { PostComment } from './post-comment'; - -export class Post { - private _postId: Guid; - private _creatorFirstName: string; - private _creatorLastName: string; - private _creatorUsername: string; - private _message: string; - private _timeCreated: Date; - private _comments: PostComment[]; - private _fileURLs: string[]; - - constructor(postId: Guid, creatorFirstName: string, creatorLastName: string, creatorUsername: string, message: string, timeCreated: Date, comments: PostComment[], fileURLs: string[]) { - this.postId = postId; - this.creatorFirstName = creatorFirstName; - this.creatorLastName = creatorLastName; - this.creatorUsername = creatorUsername; - this.message = message; - this.timeCreated = timeCreated; - this.comments = comments; - this.fileURLs = fileURLs; - } - - public get postId(): Guid { - return this._postId; - } - public set postId(v: Guid) { - this._postId = v; - } - - public get creatorFirstName(): string { - return this._creatorFirstName; - } - public set creatorFirstName(v: string) { - this._creatorFirstName = v; - } - - public get creatorLastName(): string { - return this._creatorLastName; - } - public set creatorLastName(v: string) { - this._creatorLastName = v; - } - - public get creatorUsername(): string { - return this._creatorUsername; - } - public set creatorUsername(v: string) { - this._creatorUsername = v; - } - - public get message(): string { - return this._message; - } - public set message(v: string) { - this._message = v; - } - - public get timeCreated(): Date { - return this._timeCreated; - } - public set timeCreated(v: Date) { - this._timeCreated = v; - } - - public get comments(): PostComment[] { - return this._comments; - } - public set comments(v: PostComment[]) { - this._comments = v; - } - - public get fileURLs(): string[] { - return this._fileURLs; - } - public set fileURLs(v: string[]) { - this._fileURLs = v; - } -} diff --git a/src/models/technology.model.ts b/src/models/technology.model.ts new file mode 100644 index 0000000..1869d14 --- /dev/null +++ b/src/models/technology.model.ts @@ -0,0 +1,6 @@ +import { Guid } from 'guid-typescript'; + +export class Technology { + public id: Guid; + public name: string; +} diff --git a/src/models/technology.ts b/src/models/technology.ts deleted file mode 100644 index 1869d14..0000000 --- a/src/models/technology.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Guid } from 'guid-typescript'; - -export class Technology { - public id: Guid; - public name: string; -} -- cgit v1.2.3