-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
2,146 additions
and
155 deletions.
There are no files selected for viewing
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
9 changes: 6 additions & 3 deletions
9
...erge/nsn/qanda_hub/QandAHubApplication.kt → ...n/com/serge/nsn/qahub/QAHubApplication.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
package com.serge.nsn.qanda_hub | ||
package com.serge.nsn.qahub | ||
|
||
import org.springframework.boot.autoconfigure.SpringBootApplication | ||
import org.springframework.boot.runApplication | ||
|
||
@SpringBootApplication | ||
|
||
class QandAHubApplication | ||
class QAHubApplication | ||
|
||
fun main(args: Array<String>) { | ||
runApplication<QandAHubApplication>(*args) | ||
runApplication<QAHubApplication>(*args) | ||
} | ||
|
||
//typealias Id = UUID | ||
//val id = Id() |
13 changes: 4 additions & 9 deletions
13
...da_hub/api/controller/AnswerController.kt → .../qahub/api/controller/AnswerController.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/kotlin/com/serge/nsn/qahub/api/controller/CommentController.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.serge.nsn.qahub.api.controller | ||
|
||
import com.serge.nsn.qahub.api.dto.CommentDto | ||
import com.serge.nsn.qahub.services.CommentService | ||
import org.springframework.web.bind.annotation.* | ||
|
||
@RestController | ||
@RequestMapping("/api/comment") | ||
class CommentController( | ||
private val commentService: CommentService | ||
) { | ||
|
||
@GetMapping("/all") | ||
fun allComments() = commentService.getAllComments() | ||
|
||
@GetMapping("/{id}") | ||
fun getComment(@PathVariable id: Long) = commentService.getComment(id) | ||
|
||
@PostMapping("/reply") | ||
fun reply(@RequestBody comment: CommentDto) = commentService.comment(comment) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.serge.nsn.qahub.api.dto | ||
|
||
import com.serge.nsn.qahub.data.entities.AnswerEntity | ||
|
||
class AnswerDto( | ||
val id: Long? = null, | ||
val content: String = "", | ||
) { | ||
constructor(answerEntity: AnswerEntity) : this( | ||
id = answerEntity.id, | ||
content = answerEntity.content | ||
) | ||
} |
2 changes: 1 addition & 1 deletion
2
...serge/nsn/qanda_hub/api/dto/CommentDto.kt → ...com/serge/nsn/qahub/api/dto/CommentDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 7 additions & 5 deletions
12
...erge/nsn/qanda_hub/api/dto/QuestionDto.kt → ...om/serge/nsn/qahub/api/dto/QuestionDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
package com.serge.nsn.qanda_hub.api.dto | ||
package com.serge.nsn.qahub.api.dto | ||
|
||
import com.serge.nsn.qanda_hub.data.entities.QuestionEntity | ||
import com.serge.nsn.qahub.data.entities.QuestionEntity | ||
|
||
class QuestionDto( | ||
val question_id: Long? = null, | ||
val id: Long? = null, | ||
val title: String = "", | ||
val content: String = "", | ||
val author: String = "", | ||
// val user: UserDto? = null | ||
) { | ||
constructor(questionEntity: QuestionEntity) : this( | ||
question_id = questionEntity.id, | ||
id = questionEntity.id, | ||
title = questionEntity.title, | ||
content = questionEntity.content, | ||
// user = UserDto(questionEntity.user) | ||
author = questionEntity.author, | ||
// user = questionEntity.user | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/main/kotlin/com/serge/nsn/qahub/api/model/LoginRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.serge.nsn.qahub.api.model | ||
|
||
class LoginRequest( | ||
val username: String, | ||
val password: String | ||
) |
3 changes: 3 additions & 0 deletions
3
src/main/kotlin/com/serge/nsn/qahub/api/model/LoginResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package com.serge.nsn.qahub.api.model | ||
|
||
data class LoginResponse(val accessToken: String) |
4 changes: 2 additions & 2 deletions
4
.../qanda_hub/configuration/QAUserDetails.kt → .../nsn/qahub/configuration/QAUserDetails.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...hub/configuration/QAUserDetailsService.kt → ...hub/configuration/QAUserDetailsService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ation/exceptions/UserNotFoundException.kt → ...ation/exceptions/UserNotFoundException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package com.serge.nsn.qanda_hub.configuration.exceptions | ||
package com.serge.nsn.qahub.configuration.exceptions | ||
|
||
class UserNotFoundException(message: String?) : RuntimeException(message) |
4 changes: 2 additions & 2 deletions
4
...figuration/jwt/JWTAuthenticationFilter.kt → ...figuration/jwt/JWTAuthenticationFilter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...qanda_hub/configuration/jwt/JWTService.kt → ...nsn/qahub/configuration/jwt/JWTService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ration/jwt/JwtAuthenticationEntryPoint.kt → ...ration/jwt/JwtAuthenticationEntryPoint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...n/qanda_hub/data/entities/AnswerEntity.kt → ...e/nsn/qahub/data/entities/AnswerEntity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
.../qanda_hub/data/entities/CommentEntity.kt → .../nsn/qahub/data/entities/CommentEntity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...nsn/qanda_hub/data/entities/UserEntity.kt → ...rge/nsn/qahub/data/entities/UserEntity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...hub/data/repositories/AnswerRepository.kt → ...hub/data/repositories/AnswerRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package com.serge.nsn.qanda_hub.data.repositories | ||
package com.serge.nsn.qahub.data.repositories | ||
|
||
import com.serge.nsn.qanda_hub.data.entities.AnswerEntity | ||
import com.serge.nsn.qahub.data.entities.AnswerEntity | ||
import org.springframework.data.jpa.repository.JpaRepository | ||
|
||
interface AnswerRepository : JpaRepository<AnswerEntity, Long> |
4 changes: 2 additions & 2 deletions
4
...ub/data/repositories/CommentRepository.kt → ...ub/data/repositories/CommentRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package com.serge.nsn.qanda_hub.data.repositories | ||
package com.serge.nsn.qahub.data.repositories | ||
|
||
import com.serge.nsn.qanda_hub.data.entities.CommentEntity | ||
import com.serge.nsn.qahub.data.entities.CommentEntity | ||
import org.springframework.data.jpa.repository.JpaRepository | ||
|
||
interface CommentRepository : JpaRepository<CommentEntity, Long> |
4 changes: 2 additions & 2 deletions
4
...b/data/repositories/QuestionRepository.kt → ...b/data/repositories/QuestionRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.