mirror of https://github.com/usbharu/Hideout.git
Apply suggestions from code review
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
4a25c4290e
commit
5530ad7320
|
@ -56,7 +56,6 @@ class APNoteServiceImpl(
|
||||||
|
|
||||||
) : APNoteService {
|
) : APNoteService {
|
||||||
|
|
||||||
|
|
||||||
private val logger = LoggerFactory.getLogger(APNoteServiceImpl::class.java)
|
private val logger = LoggerFactory.getLogger(APNoteServiceImpl::class.java)
|
||||||
|
|
||||||
override suspend fun fetchNote(url: String, targetActor: String?): Note {
|
override suspend fun fetchNote(url: String, targetActor: String?): Note {
|
||||||
|
@ -144,7 +143,6 @@ class APNoteServiceImpl(
|
||||||
override suspend fun fetchNote(note: Note, targetActor: String?): Note =
|
override suspend fun fetchNote(note: Note, targetActor: String?): Note =
|
||||||
saveIfMissing(note, targetActor, note.id ?: throw IllegalArgumentException("note.id is null"))
|
saveIfMissing(note, targetActor, note.id ?: throw IllegalArgumentException("note.id is null"))
|
||||||
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val public: String = "https://www.w3.org/ns/activitystreams#Public"
|
const val public: String = "https://www.w3.org/ns/activitystreams#Public"
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,6 @@ class ApNoteJobServiceImpl(
|
||||||
private val transaction: Transaction
|
private val transaction: Transaction
|
||||||
) : ApNoteJobService {
|
) : ApNoteJobService {
|
||||||
override suspend fun createNoteJob(props: JobProps<DeliverPostJob>) {
|
override suspend fun createNoteJob(props: JobProps<DeliverPostJob>) {
|
||||||
|
|
||||||
val actor = props[DeliverPostJob.actor]
|
val actor = props[DeliverPostJob.actor]
|
||||||
val create = objectMapper.readValue<Create>(props[DeliverPostJob.create])
|
val create = objectMapper.readValue<Create>(props[DeliverPostJob.create])
|
||||||
transaction.transaction {
|
transaction.transaction {
|
||||||
|
|
|
@ -22,7 +22,6 @@ class PostServiceImpl(
|
||||||
private val apSendCreateService: ApSendCreateService
|
private val apSendCreateService: ApSendCreateService
|
||||||
) : PostService {
|
) : PostService {
|
||||||
|
|
||||||
|
|
||||||
override suspend fun createLocal(post: PostCreateDto): Post {
|
override suspend fun createLocal(post: PostCreateDto): Post {
|
||||||
logger.info("START Create Local Post user: {}, media: {}", post.userId, post.mediaIds.size)
|
logger.info("START Create Local Post user: {}, media: {}", post.userId, post.mediaIds.size)
|
||||||
val create = internalCreate(post, true)
|
val create = internalCreate(post, true)
|
||||||
|
@ -38,7 +37,6 @@ class PostServiceImpl(
|
||||||
return createdPost
|
return createdPost
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private suspend fun internalCreate(post: Post, isLocal: Boolean): Post {
|
private suspend fun internalCreate(post: Post, isLocal: Boolean): Post {
|
||||||
val save = try {
|
val save = try {
|
||||||
postRepository.save(post)
|
postRepository.save(post)
|
||||||
|
|
Loading…
Reference in New Issue