mirror of https://github.com/usbharu/Hideout.git
feat: 投稿に直接返信できるように
This commit is contained in:
parent
57afdcdd7b
commit
975fd5160b
|
@ -23,7 +23,7 @@ class PublishController(
|
|||
private val userRegisterLocalPostApplicationService: RegisterLocalPostApplicationService
|
||||
) {
|
||||
@GetMapping("/publish")
|
||||
suspend fun publish(model: Model,@RequestParam replyTo: Long?,@RequestParam repost: Long?): String {
|
||||
suspend fun publish(model: Model, @RequestParam("reply_to") replyTo: Long?, @RequestParam repost: Long?): String {
|
||||
val principal = springSecurityFormLoginPrincipalContextHolder.getPrincipal()
|
||||
|
||||
if (principal.userDetailId == null) {
|
||||
|
@ -36,7 +36,7 @@ class PublishController(
|
|||
val userDetail = getUserDetailApplicationService.execute(GetUserDetail(principal.userDetailId!!.id), principal)
|
||||
model.addAttribute("instance", instance)
|
||||
model.addAttribute("user", userDetail)
|
||||
model.addAttribute("form", PublishPost(replyTo = replyTo, repost = repost))
|
||||
model.addAttribute("form", PublishPost(reply_to = replyTo, repost = repost))
|
||||
return "post-postForm"
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ class PublishController(
|
|||
overview = publishPost.overview,
|
||||
visibility = Visibility.valueOf(publishPost.visibility.uppercase()),
|
||||
repostId = publishPost.repost,
|
||||
replyId = publishPost.replyTo,
|
||||
replyId = publishPost.reply_to,
|
||||
sensitive = false,
|
||||
mediaIds = emptyList()
|
||||
)
|
||||
|
|
|
@ -4,6 +4,6 @@ data class PublishPost(
|
|||
var status: String? = null,
|
||||
var overview: String? = null,
|
||||
var visibility: String = "PUBLIC",
|
||||
var replyTo: Long? = null,
|
||||
var reply_to: Long? = null,
|
||||
var repost: Long? = null
|
||||
)
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
|
||||
<div class="post-controller" th:fragment="single-post-controller(post)">
|
||||
<!--/*@thymesVar id="post" type="dev.usbharu.hideout.core.application.post.PostDetail"*/-->
|
||||
<a th:href="${'/publish?reply_to=' + post.id}">Reply</a>
|
||||
<a th:href="${post.apId}">
|
||||
<time th:datetime="${post.createdAt}" th:text="${#temporals.format(post.createdAt, 'yyyy-MM-dd HH:mm')}"></time>
|
||||
</a>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<form action="/publish" method="post" th:action="@{/publish}" th:object="${form}">
|
||||
<div>
|
||||
<label for="status-form-replyto" th:text="#{post-form.new-posts-replyTo}">Reply to</label>
|
||||
<input id="status-form-replyto" name="reply_to" type="number" th:value="${form.replyTo}">
|
||||
<input id="status-form-replyto" name="reply_to" th:value="${form.reply_to}" type="number">
|
||||
</div>
|
||||
<div>
|
||||
<label for="status-form-repost" th:text="#{post-form.new-posts.repost}">Repost</label>
|
||||
|
|
Loading…
Reference in New Issue