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/models/post.model.ts | 81 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 src/models/post.model.ts (limited to 'src/models/post.model.ts') 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; + } +} -- cgit v1.2.3 From e3a8875e64c25a6e46380c4d003beac5953fd3e9 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 14 Mar 2021 09:07:01 +0200 Subject: Fixed model imports of post and user models --- src/models/identity/user.model.ts | 8 ++++---- src/models/post.model.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/models/post.model.ts') diff --git a/src/models/identity/user.model.ts b/src/models/identity/user.model.ts index e0038e0..e2f54a4 100644 --- a/src/models/identity/user.model.ts +++ b/src/models/identity/user.model.ts @@ -1,8 +1,8 @@ import { Guid } from 'guid-typescript'; -import { Language } from '../language'; -import { Technology } from '../technology'; -import { Friend } from './friend'; -import { Role } from './role'; +import { Language } from '../language.model'; +import { Technology } from '../technology.model'; +import { Friend } from './friend.model'; +import { Role } from './role.model'; export class User { private _id : Guid; diff --git a/src/models/post.model.ts b/src/models/post.model.ts index 8e58bea..e0fcd5b 100644 --- a/src/models/post.model.ts +++ b/src/models/post.model.ts @@ -1,6 +1,6 @@ import { Guid } from 'guid-typescript'; -import { Comment } from './comment'; -import { PostComment } from './post-comment'; +import { Comment } from './comment.model'; +import { PostComment } from './post-comment.model'; export class Post { private _postId: Guid; -- cgit v1.2.3