Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Zaichuk/helpers/Post.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
*
*/
package helpers;

/**
* @author ezaichuk
* Test commit 2
*/

import java.text.SimpleDateFormat;
import java.util.Date;

public abstract class Post {

Long PostId;
String Body;
Date PostPublishDate;


}
40 changes: 40 additions & 0 deletions Zaichuk/helpers/User.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package helpers;


public abstract class User {

public Long id;
public String username;
public String password;
public String firstName;
public String lastName;
public String e_mail;
boolean isLoggedin;

public boolean doLogin(String Username, String Password) {

this.username = Username;
this.password = Password;
this.firstName = "";
this.lastName = "";
this.e_mail = "";

return isLoggedin;
}

public void createUser(){

}

public void deleteUser(){

}

protected void getRestDetails(long userId) {

}




}
22 changes: 22 additions & 0 deletions Zaichuk/major/Article.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package major;

import helpers.Post;

import java.util.Date;

public class Article extends Post{

Long id;
String Header;
String Body;
String Tags;

public Article(String header, String body, String tags)
{
this.id = (long) 1;
this.Header = header;
this.Body = body;
this.Tags = tags;
}

}
18 changes: 18 additions & 0 deletions Zaichuk/major/Comment.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package major;

import helpers.Post;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Comment extends Post{

Long CommentId;
String CommentAuthorUsername;
String Body;

public Comment(String body){
this.Body = body;
}

}
50 changes: 50 additions & 0 deletions Zaichuk/major/Moderator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package major;

import helpers.Post;
import helpers.User;

public class Moderator extends User{

WebBlog[] moderatedBlogs;

protected void getRestDetails(long Id) {
/*
Fill additional user details from DB logic
*/
this.moderatedBlogs = this.getModeratedBlogs(Id);

}


public void publishArticle(Article article) {

}

public void updateArticle(Article article) {


}

public void deleteArticle(Article article) {

}

public void publishComment(Comment comment) {

}

public void updateComment(Comment comment) {


}

public void deleteComment(Comment comment) {

}


protected WebBlog[] getModeratedBlogs(long moderatorId){
return moderatedBlogs;
}

}
23 changes: 23 additions & 0 deletions Zaichuk/major/WebBlog.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package major;

public class WebBlog {

int blogId;
String[] topics;
author[] authors;

public WebBlog(int id){
blogId = id;
}

public static void main(String[] args){
Article article = new Article("Science brakethrou", "bla bla bla", "brakethrou");

author Evgeniy = new author("ez", "12345");

Evgeniy.publishArticle(article);


}

}
39 changes: 39 additions & 0 deletions Zaichuk/major/author.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package major;

import helpers.User;

public class author extends User{

String degree;

public author(String Username, String Password) {
//super.doLogin(Username, Password);
this.id = 1L;
this.getRestDetails(this.id);
}

protected void getRestDetails(long Id) {
/*
Fill additional user details from DB logic
*/
this.degree = "stub";
}

public void publishArticle(Article article){
System.out.println("Following article(id:"+ article.id + ") is published:" + article.Header);
}

public void updateArticle(Article article){
System.out.println("Following article(id:"+ article.Header + ") was updated");
}

public void deleteArticle(Article article) {
// TODO Auto-generated method stub
System.out.println("Following article(id:"+ article.id + ") was deleted");
}





}
39 changes: 39 additions & 0 deletions Zaichuk/major/reader.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
*
*/
package major;

import helpers.User;

/**
* @author ezaichuk
*
*/
public class reader extends User{

String Country;
String City;


public reader(String Username, String Password) {
super.doLogin(Username, Password);
}

protected void getRestDetails(long Id) {
/*
Fill additional user details from DB logic
*/
this.Country = "stub";
this.City = "stub";
}

public void publishComment(Comment comment) {

}

public void updateComment(Comment comment) {


}

}