Skip to content

Commit

Permalink
feat: Added Blog service
Browse files Browse the repository at this point in the history
  • Loading branch information
miguel-merlin committed Apr 9, 2024
1 parent 51c3e51 commit bee5734
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/main/java/com/sitblueprint/admin/model/blog/Blog.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.sitblueprint.admin.model.blog;

import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

@Entity
@Table(name = "blogs")
@NoArgsConstructor
@AllArgsConstructor
public class Blog {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

private String title;

private LocalDateTime datePublished;

private LocalDateTime lastModified;

private String status; // Published, In Progress, Deleted

private String pathToMarkdown;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.time.LocalDateTime;

@Entity
@Table(name = "event_forms")
@Data
@AllArgsConstructor
@NoArgsConstructor
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/sitblueprint/admin/model/users/Team.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.util.Set;

@Entity
@Table(name = "teams")
@Data
@NoArgsConstructor
@AllArgsConstructor
Expand All @@ -33,4 +34,6 @@ public class Team {

@Column(nullable = false)
private LocalDateTime dateCreated;

private int teamClass;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.sitblueprint.admin.repository.applications;

import com.sitblueprint.admin.model.applications.ApplicationSatisfactionForm;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface ApplicationSatisfactionFormRepository extends JpaRepository<ApplicationSatisfactionForm, Long> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.sitblueprint.admin.repository.blog;

import com.sitblueprint.admin.model.blog.Blog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface BlogRepository extends JpaRepository<Blog, Long> {
}
19 changes: 19 additions & 0 deletions src/main/java/com/sitblueprint/admin/service/blog/BlogService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.sitblueprint.admin.service.blog;

import com.sitblueprint.admin.model.blog.Blog;

import java.util.List;

public interface BlogService {
List<Blog> getAllBlogs();

Blog getBlogById(Long id);

Blog createBlog(Long blog);

Blog updateBlog(Blog blog);

void deleteBlog(Long id);

void setBlogToPublished(Long id);
}

0 comments on commit bee5734

Please sign in to comment.