mirror of https://github.com/usbharu/Hideout.git
style: fix lint (CI)
This commit is contained in:
parent
0c3e69a7e4
commit
cf1327eae4
|
@ -43,4 +43,4 @@ class TimelineRelationshipUnfollowSubscriber(
|
||||||
companion object {
|
companion object {
|
||||||
private val logger = LoggerFactory.getLogger(TimelineRelationshipUnfollowSubscriber::class.java)
|
private val logger = LoggerFactory.getLogger(TimelineRelationshipUnfollowSubscriber::class.java)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,10 +13,10 @@ import org.springframework.stereotype.Service
|
||||||
@Service
|
@Service
|
||||||
class UserGetTimelinesApplicationService(transaction: Transaction, private val timelineRepository: TimelineRepository) :
|
class UserGetTimelinesApplicationService(transaction: Transaction, private val timelineRepository: TimelineRepository) :
|
||||||
AbstractApplicationService<GetTimelines, List<Timeline>>(
|
AbstractApplicationService<GetTimelines, List<Timeline>>(
|
||||||
transaction, logger
|
transaction,
|
||||||
|
logger
|
||||||
) {
|
) {
|
||||||
override suspend fun internalExecute(command: GetTimelines, principal: Principal): List<Timeline> {
|
override suspend fun internalExecute(command: GetTimelines, principal: Principal): List<Timeline> {
|
||||||
|
|
||||||
val userDetailId = UserDetailId(command.userDetailId)
|
val userDetailId = UserDetailId(command.userDetailId)
|
||||||
|
|
||||||
val timelineVisibility = if (userDetailId == principal.userDetailId) {
|
val timelineVisibility = if (userDetailId == principal.userDetailId) {
|
||||||
|
@ -34,4 +34,4 @@ class UserGetTimelinesApplicationService(transaction: Transaction, private val t
|
||||||
companion object {
|
companion object {
|
||||||
private val logger = LoggerFactory.getLogger(UserGetTimelinesApplicationService::class.java)
|
private val logger = LoggerFactory.getLogger(UserGetTimelinesApplicationService::class.java)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,15 +16,20 @@ class UserRemoveTimelineRelationshipApplicationService(
|
||||||
private val timelineRepository: TimelineRepository
|
private val timelineRepository: TimelineRepository
|
||||||
) :
|
) :
|
||||||
LocalUserAbstractApplicationService<RemoveTimelineRelationship, Unit>(
|
LocalUserAbstractApplicationService<RemoveTimelineRelationship, Unit>(
|
||||||
transaction, logger
|
transaction,
|
||||||
|
logger
|
||||||
) {
|
) {
|
||||||
|
|
||||||
override suspend fun internalExecute(command: RemoveTimelineRelationship, principal: LocalUser) {
|
override suspend fun internalExecute(command: RemoveTimelineRelationship, principal: LocalUser) {
|
||||||
val timelineRelationship = (timelineRelationshipRepository.findById(command.timelineRelationshipId)
|
val timelineRelationship = (
|
||||||
?: throw IllegalArgumentException("TimelineRelationship ${command.timelineRelationshipId} not found."))
|
timelineRelationshipRepository.findById(command.timelineRelationshipId)
|
||||||
|
?: throw IllegalArgumentException("TimelineRelationship ${command.timelineRelationshipId} not found.")
|
||||||
|
)
|
||||||
|
|
||||||
val timeline = (timelineRepository.findById(timelineRelationship.timelineId)
|
val timeline = (
|
||||||
?: throw IllegalArgumentException("Timeline ${timelineRelationship.timelineId} not found."))
|
timelineRepository.findById(timelineRelationship.timelineId)
|
||||||
|
?: throw IllegalArgumentException("Timeline ${timelineRelationship.timelineId} not found.")
|
||||||
|
)
|
||||||
|
|
||||||
if (timeline.userDetailId != principal.userDetailId) {
|
if (timeline.userDetailId != principal.userDetailId) {
|
||||||
throw PermissionDeniedException()
|
throw PermissionDeniedException()
|
||||||
|
@ -36,4 +41,4 @@ class UserRemoveTimelineRelationshipApplicationService(
|
||||||
companion object {
|
companion object {
|
||||||
private val logger = LoggerFactory.getLogger(UserRemoveTimelineRelationshipApplicationService::class.java)
|
private val logger = LoggerFactory.getLogger(UserRemoveTimelineRelationshipApplicationService::class.java)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,6 @@ class Relationship(
|
||||||
val relationshipEventFactory = RelationshipEventFactory(this)
|
val relationshipEventFactory = RelationshipEventFactory(this)
|
||||||
addDomainEvent(relationshipEventFactory.createEvent(RelationshipEvent.UNFOLLOW))
|
addDomainEvent(relationshipEventFactory.createEvent(RelationshipEvent.UNFOLLOW))
|
||||||
addDomainEvent(relationshipEventFactory.createEvent(RelationshipEvent.UNFOLLOW_REQUEST))
|
addDomainEvent(relationshipEventFactory.createEvent(RelationshipEvent.UNFOLLOW_REQUEST))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun block() {
|
fun block() {
|
||||||
|
|
|
@ -57,7 +57,6 @@ class UserController(
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
model.addAttribute("relationship", relationship)
|
model.addAttribute("relationship", relationship)
|
||||||
model.addAttribute(
|
model.addAttribute(
|
||||||
"userTimeline",
|
"userTimeline",
|
||||||
|
|
Loading…
Reference in New Issue