Skip to content

Commit

Permalink
Removed unnecessary content from the Domain model
Browse files Browse the repository at this point in the history
  • Loading branch information
uo287545 committed Apr 8, 2024
1 parent 81dfb8c commit 7128d21
Showing 1 changed file with 0 additions and 304 deletions.
304 changes: 0 additions & 304 deletions docs/src/08_concepts.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -90,316 +90,12 @@ class RestApiAccessLog {
- details: String
}
interface JsonEntity {
+ toJson(): JsonNode
}
interface PlayerService {
+ addNewPlayer(dto: PlayerDto): Player
+ getUsers(): List<Player>
+ getUser(id: Long): Optional<Player>
+ getUserByEmail(email: String): Optional<Player>
+ getUserByUsername(username: String): Optional<Player>
+ getUsersByRole(role: String): List<Player>
+ generateapiKey(player: Player): void
}
interface RoleService {
+ addRole(role: RoleDto): Role
+ getRole(name: String): Role
+ getRoles(): List<Role>
}
interface AnswerService {
+ addNewAnswer(answer: Answer): void
+ getAnswerPerQuestion(question: Question): List<Answer>
+ getAnswer(id: Long): Optional<Answer>
}
interface ApiKeyService {
+ createApiKey(forPlayer: Player): ApiKey
+ getApiKey(apiKey: String): ApiKey
}
interface CategoryService {
+ addNewCategory(category: Category): void
+ getAllCategories(): List<Category>
+ getCategory(id: Long): Optional<Category>
+ getCategoryByName(geography: String): Category
}
interface QuestionService {
+ addNewQuestion(question: Question): void
+ getAllQuestions(): List<Question>
+ getQuestion(id: Long): Optional<Question>
}
interface RestApiService {
+ getPlayers(params: Map<String, String>): List<Player>
+ logAccess(apiKey: ApiKey, path: String, params: Map<String, String>): void
+ getQuestions(params: Map<String, String>): List<Question>
}
class CustomUserDetailsService {
- playerRepository: PlayerRepository
+ loadUserByUsername(username: String): UserDetails
+ mapRolesToAuthorities(roles: Collection<Role>): Collection< ? extends GrantedAuthority>
}
class InsertSampleDataService {
- playerService: PlayerService
- questionService: QuestionService
- categoryService: CategoryService
- questionRepository: QuestionRepository
- gameSessionRepository: GameSessionRepository
+ insertSampleQuestions(): void
}
class PlayerServiceImpl {
- playerRepository: PlayerRepository
- roleService: RoleService
- passwordEncoder: PasswordEncoder
+ addNewPlayer(dto: PlayerDto): Player
+ getUsers(): List<Player>
+ getUser(id: Long): Optional<Player>
+ getUserByEmail(email: String): Optional<Player>
+ getUserByUsername(username: String): Optional<Player>
+ getUsersByRole(role: String): List<Player>
+ generateApiKey(player: Player): void
}
class RoleServiceImpl {
- roleRepository: RoleRepository
+ addRole(role: RoleDto): Role
+ getRole(name: String): Role
+ getRoles(): List<Role>
}
class AnswerServiceImpl {
- answerRepository: AnswerRepository
+ addNewAnswer(answer: Answer): void
+ getAnswersPerQuestion(question: Question): List<Answer>
+ getAnswer(id: Long): Optional<Answer>
}
class ApiKeyServiceImpl {
- apiKeyRepository: ApiKeyRepository
+ createApiKey(forPlayer: Player): ApiKey
+ getApiKey(apiKey: String): ApiKey
}
class CategoryServiceImpl {
- categoryRepository: CategoryRepository
+ addNewCategory(category: Category): void
+ getAllCategories(): List<Category>
+ getCategory(id: Long): Optional<Category>
+ getCategoryByName(name: String): Category
+ init(): void
}
class QuestionServiceImpl {
- questionRepository: QuestionRepository
+ addNewQuestion(question: Question): void
+ getAllQuestions(): List<Question>
+ getQuestion(id: Long): Optional<Question>
}
class RestApiServiceImpl {
- playerService: PlayerService
- restApiLogRepository: RestApiLogRepository
- questionService: QuestionService
+ getPlayers(params: Map<String, String>): List<Player>
+ logAccess(apiKey: ApiKey, path: String, params: Map<String, String>): void
+ getQuestions(params: Map<String, String>): List<Question>
}
class PlayerDto {
- username: String
- email: String
- password: String
- passwordConfirm: String
- roles: String[]
}
class RoleDto {
- name: String
}
class AbstractGeographyGenerator {
+ getCategory(): Category
}
class BorderQuestionGenerator {
- usedCountries: Set<String>
+ getAllBorderingCountries(resultsNode: JsonNode, correctCountry: String): List<String>
+ selectRandomIncorrectBorderingCountries(allBorderingCountries: List<String>, correctCountry: String, count: int): List<String>
+ generateOptions(results: JsonNode, result: JsonNode): List<String>
+ generateCorrectAnswer(result: JsonNode): String
+ getQuestionSubject(result: JsonNode): String
+ getQuery(): String
}
class CapitalQuestionGenerator {
+ getQuery(): String
+ getAllCapitals(resultsNode: JsonNode, correctCapital: String): List<String>
+ selectRandomIncorrectCapitals(allCapitals: List<String>, correctCapital: String, count: int): List<String>
+ generateOptions(results: JsonNode, result: JsonNode): List<String>
+ generateCorrectAnswer(result: JsonNode): String
+ getQuestionSubject(result: JsonNode): String
}
class ContinentQuestionGeneration {
+ getAllContinents(resultsNode: JsonNode, correctContinent: String): List<String>
+ selectRandomIncorrectContinents(allContinents: List<String>, correctContinent: String, count: int): List<String>
+ generateOptions(results: JsonNode, result: JsonNode): List<String>
+ generateCorrectAnswer(result: JsonNode): String
+ getQuestionSubject(result: JsonNode): String
+ getQuery(): String
}
class AbstractQuestionGenerator {
- questions: List<Question>
- categoryService: CategoryService
- query: String
- statement: String
+ questionGenerator(statement: String, options: List<String>, correctAnswer: String, category: Category): void
+ getQuestions(): List<Question>
+ generateOptions(results: JsonNode, result: JsonNode): List<String>
+ generateCorrectAnswer(result: JsonNode): String
+ getQuestionSubject(result: JsonNode): String
}
interface QuestionGenerator {
+ getQuery(): String
+ getQuestions(): List<Question>
+ getCategory(): Category
}
class QuestionGeneratorTestController {
+ qgen: CapitalQuestionGenerator
+ test(): void
}
class SignUpValidator {
- playerService: PlayerService
+ supports(clazz: Class<?>): boolean
+ validate(target: Object, errors: Errors): void
}
JsonEntity <|.. Answer
JsonEntity <|.. Category
JsonEntity <|.. GameSession
JsonEntity <|.. Player
JsonEntity <|.. Question
AnswerService <|.. AnswerServiceImpl
ApiKeyService <|.. ApiKeyServiceImpl
CategoryService <|.. CategoryServiceImpl
PlayerService <|.. PlayerServiceImpl
QuestionService <|.. QuestionServiceImpl
RestApiService <|.. RestApiServiceImpl
RoleService <|.. RoleServiceImpl
AbstractGeographyGenerator --|> AbstractQuestionGenerator
BorderQuestionGenerator --|> AbstractGeographyGenerator
CapitalQuestionGenerator --|> AbstractGeographyGenerator
ContinentQuestionGeneration --|> AbstractGeographyGenerator
QuestionGenerator <|.. AbstractQuestionGenerator
RoleService ..> RoleDto
Role "*" - "*" Player
AnswerService ..> Answer
AnswerService ..> Question
ApiKeyService ..> Player
CategoryService ..> Category
PlayerService ..> PlayerDto
PlayerService ..> Player
QuestionService ..> Question
RestApiService ..> ApiKey
CustomUserDetailsService ..> Player
CustomUserDetailsService ..> Role
InsertSampleDataService "1" *- "1" PlayerService
InsertSampleDataService "1" *- "1" QuestionService
InsertSampleDataService "1" *- "1" CategoryService
InsertSampleDataService ..> PlayerDto
InsertSampleDataService ..> GameSession
InsertSampleDataService ..> QuestionGenerator
PlayerServiceImpl "1" *- "1" RoleService
PlayerServiceImpl "1" *- "1" PasswordEncoder
PlayerServiceImpl ..> Role
RestApiServiceImpl "1" *- "1" PlayerService
RestApiServiceImpl "1" *- "1" QuestionService
RestApiServiceImpl ..> Player
RestApiServiceImpl ..> Question
RestApiServiceImpl ..> Role
Answer "*" - "1" Question
ApiKey "1" - "1" Player
ApiKey "1" - "*" RestApiAccessLog
Category "1" - "*" Question
Player "1" - "*" GameSession
QuestionGeneratorTestController "1" *- "1" CapitalQuestionGenerator
QuestionGeneratorTestController ..> Question
AbstractQuestionGenerator "1" - "*" Question
AbstractQuestionGenerator "1" - "1" CategoryService
AbstractQuestionGenerator ..> Category
Validator <|.. SignUpValidator
SignUpValidator "1" - "1" PlayerService
SignUpValidator ..> PlayerDto
@enduml
----

[plantuml, domain-model-2, svg]
----
@startuml
class AnswerDto {
- id: Long
- text: String
- correct: boolean
}
class CategoryDto {
- id: Long
- name: String
- description: String
- questions: List<QuestionDto>
}
class QuestionDto {
- id: Long
- statement: String
- options: List<AnswerDto>
- correctAnswer: AnswerDto
- category: CategoryDto
}
class SecurityConfig {
- userDetailsService: UserDetailsService
- customAuthenticationFailureHandler: CustomAuthenticationFailureHandler
+ passwordEncoder(): PasswordEncoder
+ filterChain(http: HttpSecurity): SecurityFilterChain
+ configureGlobal(auth: AuthenticationManagerBuilder): void
+ isAuthenticated(): boolean
}
class CustomAuthenticationFailureHandler {
+ onAuthenticationFailure(request: HttpServletRequest, responde: HttpServletResponse, exception: AuthenticationException): void
}
class CustomConfiguration {
+ localeResolver(): LocaleResolver
+ localeChangeInterceptor(): LocaleChangeInterceptor
+ addInterceptors(registry: InterceptorRegistry): void
}
class WiqEs04bApplication {
+ main(args: String[]): void
}
CategoryDto "1" - "*" QuestionDto
QuestionDto "1" *- "*" AnswerDto
SecurityConfig "1" *- "1" UserDetailsService
SecurityConfig "1" *- "1" CustomAuthenticationFailureHandler
CustomAuthenticationFailureHandler --|> SimpleUrlAuthenticationFailureHandler
WebMvcConfigurer <|.. CustomConfiguration
@enduml
----
Expand Down

0 comments on commit 7128d21

Please sign in to comment.