Class Diagram - owenbean400/USMsocialMedia GitHub Wiki

classDiagram
direction BT
class AdminActionResponse {
  - String message
  - int status
  + builder() AdminActionResponseBuilder
  + equals(Object) boolean
  + getMessage() String
  + setMessage(String) void
  + hashCode() int
  + toString() String
  + getStatus() int
  # canEqual(Object) boolean
  + setStatus(int) void
}
class AdminController {
  - AdminService service
  + deleteUser(AdminDeleteRequest) ResponseEntity~AdminActionResponse~
  + deletePost(AdminDeleteRequest) ResponseEntity~AdminActionResponse~
}
class AdminDeleteRequest {
  - int targetId
  + builder() AdminDeleteRequestBuilder
  + equals(Object) boolean
  + hashCode() int
  + setTargetId(int) void
  # canEqual(Object) boolean
  + getTargetId() int
  + toString() String
}
class AdminService {
  - LikeRepository likeRepository
  - CommentRepository commentRepository
  - UserRepository userRepository
  - PostRepository postRepository
  + deleteUser(AdminDeleteRequest) AdminActionResponse
  + deletePost(AdminDeleteRequest) AdminActionResponse
}
class ApplicationConfig {
  - UserRepository userRepository
  + authenticationProvider() AuthenticationProvider
  + passwordEncoder() BCryptPasswordEncoder
  + authenticationManager(AuthenticationConfiguration) AuthenticationManager
  + userDetailsService() UserDetailsService
}
class AsyncConfig {
  + getAsyncExecutor() Executor?
  + getAsyncUncaughtExceptionHandler() AsyncUncaughtExceptionHandler?
}
class AuthenticationController {
  - AuthenticationService service
  + register(RegisterRequest) ResponseEntity~AuthenticationResponse~
  + authenticate(AuthenticationRequest) ResponseEntity~AuthenticationResponse~
  + googleLoginCallback(OAuth2User) ResponseEntity~AuthenticationResponse~
}
class AuthenticationRequest {
  - String email
  - String password
  + getPassword() String
  + builder() AuthenticationRequestBuilder
  + hashCode() int
  + equals(Object) boolean
  + setEmail(String) void
  + setPassword(String) void
  + toString() String
  + getEmail() String
  # canEqual(Object) boolean
}
class AuthenticationResponse {
  - String token
  # canEqual(Object) boolean
  + toString() String
  + getToken() String
  + hashCode() int
  + setToken(String) void
  + builder() AuthenticationResponseBuilder
  + equals(Object) boolean
}
class AuthenticationService {
  - UserRepository userRepository
  - JwtService jwtService
  - PasswordEncoder passwordEncoder
  - AuthenticationManager authenticationManager
  - EmailSenderService senderService
  - handleOAuthRegistration(RegisterRequest) User
  + register(RegisterRequest) AuthenticationResponse
  + authenticate(AuthenticationRequest) AuthenticationResponse
}
class CommentRepository {
<<Interface>>

}
class EmailSenderService {
  - JavaMailSender mailSender
  - Configuration freemarkerConfig
  + sendEmail(User, String, String, String, String) void
  - getFreeMarkerTemplateContent(Map~String, Object~) String
}
class FollowerRepository {
<<Interface>>

}
class JwtAuthFilter {
  - UserDetailsService userDetailsService
  - ObjectMapper OBJECT_MAPPER
  - JwtService jwtService
  # doFilterInternal(HttpServletRequest, HttpServletResponse, FilterChain) void
}
class JwtService {
  - String AUTH_HEADER
  - Key SECRET_KEY
  - String BEARER_PREFIX
  + fetchClaims(String, Function~Claims, T~) T
  + fetchEmail(String) String
  + isTokenExpired(String) boolean
  + generateToken(Map~String, Objects~, UserDetails) String
  + isValidToken(String, UserDetails) boolean
  + fetchClaims(String) Claims
  + generateToken(UserDetails) String
  + extractToken(HttpServletRequest) String
}
class LikeRepository {
<<Interface>>

}
class PostComment {
  - String content
  - UserPost post
  - Long commentId
  - LocalDateTime timestamp
  - User user
  + setCommentId(Long) void
  + setContent(String) void
  + hashCode() int
  + getTimestamp() LocalDateTime
  + setUser(User) void
  + setPost(UserPost) void
  + setTimestamp(LocalDateTime) void
  # canEqual(Object) boolean
  + getUser() User
  + getPost() UserPost
  + getContent() String
  + equals(Object) boolean
  + getCommentId() Long
  + builder() PostCommentBuilder
  + toString() String
}
class PostCommentResponse {
  - String commenterFirstName
  - String commenterLastName
  - LocalDateTime timestamp
  - String content
  - Long commentId
  + getCommenterFirstName() String
  + equals(Object) boolean
  + getCommentId() Long
  + getContent() String
  + getCommenterLastName() String
  + setCommenterLastName(String) void
  # canEqual(Object) boolean
  + getTimestamp() LocalDateTime
  + setCommentId(Long) void
  + hashCode() int
  + setContent(String) void
  + toString() String
  + setTimestamp(LocalDateTime) void
  + setCommenterFirstName(String) void
  + builder() PostCommentResponseBuilder
}
class PostCommentResponse {
  - String content
  - String commenterLastName
  - Long commentId
  - String commenterFirstName
  - LocalDateTime timestamp
  + setCommentId(Long) void
  + hashCode() int
  + setCommenterLastName(String) void
  + getContent() String
  + setContent(String) void
  + setCommenterFirstName(String) void
  + setTimestamp(LocalDateTime) void
  # canEqual(Object) boolean
  + getCommenterLastName() String
  + toString() String
  + getCommentId() Long
  + builder() PostCommentResponseBuilder
  + getCommenterFirstName() String
  + equals(Object) boolean
  + getTimestamp() LocalDateTime
}
class PostController {
  - PostService service
  + getRecommendedPosts() ResponseEntity~ResponseEntity~Page~RecommendedPostResponse~~~
  + likePost(UserRequest) ResponseEntity~UserActionResponse~
  + deletePost(UserRequest) ResponseEntity~UserActionResponse~
  + createComment(UserPostRequest) ResponseEntity~UserActionResponse~
  + createPost(UserPostRequest) ResponseEntity~UserActionResponse~
}
class PostLike {
  - UserPost post
  - User user
  - Long likeId
  - LocalDateTime timestamp
  + toString() String
  + equals(Object) boolean
  + builder() PostLikeBuilder
  + getUser() User
  + setPost(UserPost) void
  + hashCode() int
  + getTimestamp() LocalDateTime
  + setLikeId(Long) void
  + setTimestamp(LocalDateTime) void
  + setUser(User) void
  + getPost() UserPost
  + getLikeId() Long
  # canEqual(Object) boolean
}
class PostLikeResponse {
  - String likerLastName
  - Long likeID
  - String likerFirstName
  - LocalDateTime timestamp
  + setLikerFirstName(String) void
  + getTimestamp() LocalDateTime
  + equals(Object) boolean
  + setLikerLastName(String) void
  + getLikerFirstName() String
  + hashCode() int
  + getLikeID() Long
  + setLikeID(Long) void
  # canEqual(Object) boolean
  + getLikerLastName() String
  + builder() PostLikeResponseBuilder
  + setTimestamp(LocalDateTime) void
  + toString() String
}
class PostLikeResponse {
  - String likerLastName
  - LocalDateTime timestamp
  - Long likeID
  - String likerFirstName
  + setLikerFirstName(String) void
  + getLikeID() Long
  + builder() PostLikeResponseBuilder
  + hashCode() int
  + getLikerFirstName() String
  + getLikerLastName() String
  # canEqual(Object) boolean
  + getTimestamp() LocalDateTime
  + setLikeID(Long) void
  + setLikerLastName(String) void
  + setTimestamp(LocalDateTime) void
  + equals(Object) boolean
  + toString() String
}
class PostRepository {
<<Interface>>
  + findAll(Pageable) Page~UserPost~
  + deleteByUser(User) void
  + getLikeCount(Integer) Integer
}
class PostService {
  - LikeRepository likeRepository
  - CommentRepository commentRepository
  - JwtService jwtService
  - UserRepository userRepository
  - PostRepository postRepository
  + getRecommendedPosts() ResponseEntity~Page~RecommendedPostResponse~~
  + createComment(HttpServletRequest, UserPostRequest) UserActionResponse
  + deletePost(HttpServletRequest, UserRequest) UserActionResponse
  + createPost(HttpServletRequest, UserPostRequest) UserActionResponse
  + likePost(HttpServletRequest, UserRequest) UserActionResponse
  - mapToSimplifiedPostResponse(UserPost) RecommendedPostResponse
}
class RecommendedPostResponse {
  - LocalDateTime timestamp
  - String postersFirstName
  - List~PostCommentResponse~ comments
  - String postersLastName
  - int likeCount
  - Integer id
  - String content
  + setPostersFirstName(String) void
  + setContent(String) void
  + getId() Integer
  + getPostersFirstName() String
  + setLikeCount(int) void
  # canEqual(Object) boolean
  + hashCode() int
  + setComments(List~PostCommentResponse~) void
  + equals(Object) boolean
  + getComments() List~PostCommentResponse~
  + getLikeCount() int
  + getPostersLastName() String
  + setId(Integer) void
  + builder() RecommendedPostResponseBuilder
  + getContent() String
  + setPostersLastName(String) void
  + toString() String
  + getTimestamp() LocalDateTime
  + setTimestamp(LocalDateTime) void
}
class RecommendedPostResponse {
  - List~PostCommentResponse~ comments
  - String postersFirstName
  - int likeCount
  - String postersLastName
  - LocalDateTime timestamp
  - Integer id
  - String content
  + getContent() String
  + setPostersLastName(String) void
  + setPostersFirstName(String) void
  + getId() Integer
  + setTimestamp(LocalDateTime) void
  + toString() String
  + hashCode() int
  + getPostersFirstName() String
  + getPostersLastName() String
  + getComments() List~PostCommentResponse~
  + getTimestamp() LocalDateTime
  + setComments(List~PostCommentResponse~) void
  + builder() RecommendedPostResponseBuilder
  + getLikeCount() int
  + equals(Object) boolean
  # canEqual(Object) boolean
  + setContent(String) void
  + setLikeCount(int) void
  + setId(Integer) void
}
class RegisterRequest {
  - String lastName
  - String firstName
  - String email
  - String password
  - boolean isOAuthRegistration
  + getLastName() String
  + setLastName(String) void
  + isOAuthRegistration() boolean
  + getPassword() String
  + builder() RegisterRequestBuilder
  + setOAuthRegistration(boolean) void
  + setPassword(String) void
  + hashCode() int
  + toString() String
  + getFirstName() String
  # canEqual(Object) boolean
  + setEmail(String) void
  + getEmail() String
  + setFirstName(String) void
  + equals(Object) boolean
}
class Role {
<<enumeration>>
  +  ALUMNI
  +  FACULTY
  +  ADMIN
  - String authority
  +  STUDENT
  +  GUEST
  +  STAFF
  + getSimpleGrantedAuthority() SimpleGrantedAuthority
  + values() Role[]
  + getAuthority() String
  + valueOf(String) Role
}
class SecurityConfiguration {
  - JwtAuthFilter jwtAuthFilter
  - String[] AUTHORIZED_URLS
  - AuthenticationProvider authenticationProvider
  + corsConfigurationSource() CorsConfigurationSource
  + securityFilterChain(HttpSecurity) SecurityFilterChain
}
class TestController {
  + test() ResponseEntity~String~
}
class USMSocialApplication {
  - Logger log
  + generateRandomString(int) String
  + main(String[]) void
  + createDefaults(JdbcTemplate, BCryptPasswordEncoder, UserRepository) CommandLineRunner
  + convertImageToByteArray(String) byte[]
}
class USMSocialApplicationTests {
  ~ contextLoads() void
}
class User {
  - String lastName
  - String email
  - String verificationToken
  - boolean verified
  - LocalDateTime timestamp
  - String firstName
  - String password
  - byte[] profilePicture
  - Integer id
  - Role role
  + setRole(Role) void
  + hashCode() int
  + getVerificationToken() String
  + setPassword(String) void
  + getTimestamp() LocalDateTime
  + getFirstName() String
  + setFirstName(String) void
  + setProfilePicture(byte[]) void
  # canEqual(Object) boolean
  + setEmail(String) void
  + isCredentialsNonExpired() boolean
  + setVerificationToken(String) void
  + getAuthorities() Collection~GrantedAuthority~
  + toString() String
  + getProfilePicture() byte[]
  + builder() UserBuilder
  + setId(Integer) void
  + getLastName() String
  + getPassword() String
  + getRole() Role
  + isEnabled() boolean
  + getEmail() String
  + setVerified(boolean) void
  + isVerified() boolean
  + setTimestamp(LocalDateTime) void
  + equals(Object) boolean
  + getUsername() String
  + getId() Integer
  + isAccountNonExpired() boolean
  + setLastName(String) void
  + isAccountNonLocked() boolean
  + generateVerificationToken() void
}
class UserActionResponse {
  - int status
  - String message
  + setStatus(int) void
  + getStatus() int
  + getMessage() String
  + setMessage(String) void
  + equals(Object) boolean
  # canEqual(Object) boolean
  + hashCode() int
  + toString() String
  + builder() UserActionResponseBuilder
}
class UserActionResponse {
  - String message
  - int status
  + setStatus(int) void
  + hashCode() int
  + getMessage() String
  + equals(Object) boolean
  # canEqual(Object) boolean
  + builder() UserActionResponseBuilder
  + setMessage(String) void
  + getStatus() int
  + toString() String
}
class UserController {
  - UserService service
  + unfollowUser(Integer) ResponseEntity~UserActionResponse~
  + messageUser(String) ResponseEntity~String~
  + followUser(Integer) ResponseEntity~UserActionResponse~
  + changeProfilePicture(MultipartFile) ResponseEntity~UserActionResponse~
}
class UserFollowerId {
  - User following
  - User follower
  + setFollowing(User) void
  # canEqual(Object) boolean
  + builder() UserFollowerIdBuilder
  + equals(Object) boolean
  + hashCode() int
  + getFollowing() User
  + toString() String
  + getFollower() User
  + setFollower(User) void
}
class UserFollowers {
  - LocalDateTime timestamp
  - UserFollowerId id
  + getId() UserFollowerId
  + setId(UserFollowerId) void
  + equals(Object) boolean
  + toString() String
  - validateUsers() void
  + builder() UserFollowersBuilder
  + hashCode() int
  # canEqual(Object) boolean
  + getTimestamp() LocalDateTime
  + setTimestamp(LocalDateTime) void
}
class UserPost {
  - User user
  - Set~PostLike~ likes
  - int likeCount
  - List~PostComment~ comments
  - LocalDateTime timestamp
  - String content
  - Integer id
  + setContent(String) void
  + removeLike(PostLike) void
  + getLikeCount() int
  + setComments(List~PostComment~) void
  + getComments() List~PostComment~
  + builder() UserPostBuilder
  + toString() String
  + equals(Object) boolean
  + updateLikeCount() void
  + getLikes() Set~PostLike~
  # canEqual(Object) boolean
  + getUser() User
  + setTimestamp(LocalDateTime) void
  + hashCode() int
  + setLikeCount(int) void
  + setUser(User) void
  + addLike(PostLike) void
  + getContent() String
  + getId() Integer
  + setLikes(Set~PostLike~) void
  + getTimestamp() LocalDateTime
  + setId(Integer) void
}
class UserPostRequest {
  - String content
  - int id
  + equals(Object) boolean
  + getId() int
  + getContent() String
  + setId(int) void
  + setContent(String) void
  # canEqual(Object) boolean
  + hashCode() int
  + toString() String
  + builder() UserPostRequestBuilder
}
class UserPostRequest {
  - int id
  - String content
  + getId() int
  + builder() UserPostRequestBuilder
  # canEqual(Object) boolean
  + toString() String
  + getContent() String
  + setContent(String) void
  + setId(int) void
  + equals(Object) boolean
  + hashCode() int
}
class UserRepository {
<<Interface>>
  + findByVerificationToken(String) Optional~User~
  + findByEmail(String) Optional~User~
}
class UserRequest {
  - int targetId
  # canEqual(Object) boolean
  + getTargetId() int
  + equals(Object) boolean
  + hashCode() int
  + builder() UserRequestBuilder
  + setTargetId(int) void
  + toString() String
}
class UserService {
  - FollowerRepository followerRepository
  - JwtService jwtService
  - UserRepository userRepository
  + uploadProfilePicture(HttpServletRequest, byte[]) UserActionResponse
  - isValidImageFormat(byte[]) boolean
  + followUser(HttpServletRequest, Integer) UserActionResponse
  + unfollowUser(HttpServletRequest, Integer) UserActionResponse
}
class VerificationController {
  - UserRepository userRepository
  - PasswordEncoder passwordEncoder
  - EmailSenderService senderService
  + verifyAccount(String) ResponseEntity~String~
  + resetPassword(RegisterRequest) ResponseEntity~String~
  + changePassword(String, RegisterRequest) ResponseEntity~String~
}

AdminController "1" *--> "service 1" AdminService 
AdminService "1" *--> "commentRepository 1" CommentRepository 
AdminService "1" *--> "likeRepository 1" LikeRepository 
AdminService "1" *--> "postRepository 1" PostRepository 
AdminService "1" *--> "userRepository 1" UserRepository 
ApplicationConfig "1" *--> "userRepository 1" UserRepository 
AuthenticationController "1" *--> "service 1" AuthenticationService 
AuthenticationService "1" *--> "senderService 1" EmailSenderService 
AuthenticationService "1" *--> "jwtService 1" JwtService 
AuthenticationService "1" *--> "userRepository 1" UserRepository 
JwtAuthFilter "1" *--> "jwtService 1" JwtService 
PostComment "1" *--> "user 1" User 
PostComment "1" *--> "post 1" UserPost 
PostController "1" *--> "service 1" PostService 
PostLike "1" *--> "user 1" User 
PostLike "1" *--> "post 1" UserPost 
PostService "1" *--> "commentRepository 1" CommentRepository 
PostService "1" *--> "jwtService 1" JwtService 
PostService "1" *--> "likeRepository 1" LikeRepository 
PostService "1" *--> "postRepository 1" PostRepository 
PostService "1" *--> "userRepository 1" UserRepository 
RecommendedPostResponse "1" *--> "comments *" PostCommentResponse 
SecurityConfiguration "1" *--> "jwtAuthFilter 1" JwtAuthFilter 
User "1" *--> "role 1" Role 
UserController "1" *--> "service 1" UserService 
UserFollowerId "1" *--> "follower 1" User 
UserFollowers "1" *--> "id 1" UserFollowerId 
UserPost "1" *--> "comments *" PostComment 
UserPost "1" *--> "likes *" PostLike 
UserPost "1" *--> "user 1" User 
UserService "1" *--> "followerRepository 1" FollowerRepository 
UserService "1" *--> "jwtService 1" JwtService 
UserService "1" *--> "userRepository 1" UserRepository 
VerificationController "1" *--> "senderService 1" EmailSenderService 
VerificationController "1" *--> "userRepository 1" UserRepository 
⚠️ **GitHub.com Fallback** ⚠️