mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 10:37:05 +05:30
refactor: move Tags from api to model module
This commit is contained in:
parent
85c11e0e80
commit
f17375e9e1
4 changed files with 7 additions and 7 deletions
|
@ -7,9 +7,9 @@
|
|||
package dev.msfjarvis.claw.api
|
||||
|
||||
import com.slack.eithernet.ApiResult
|
||||
import dev.msfjarvis.claw.api.util.Tags
|
||||
import dev.msfjarvis.claw.model.LobstersPost
|
||||
import dev.msfjarvis.claw.model.LobstersPostDetails
|
||||
import dev.msfjarvis.claw.model.Tags
|
||||
import dev.msfjarvis.claw.model.User
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.Path
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2023 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
package dev.msfjarvis.claw.api.util
|
||||
|
||||
class Tags {
|
||||
private var tags: MutableList<String> = emptyList<String>().toMutableList()
|
||||
|
||||
fun addTag(tag: String) {
|
||||
this.tags.add(tag)
|
||||
}
|
||||
|
||||
fun removeTag(tag: String) {
|
||||
this.tags.remove(tag)
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return tags.joinToString(",")
|
||||
}
|
||||
}
|
|
@ -8,9 +8,9 @@ package dev.msfjarvis.claw.api
|
|||
|
||||
import com.slack.eithernet.ApiResult.Success
|
||||
import com.slack.eithernet.test.newEitherNetController
|
||||
import dev.msfjarvis.claw.api.util.Tags
|
||||
import dev.msfjarvis.claw.model.LobstersPost
|
||||
import dev.msfjarvis.claw.model.LobstersPostDetails
|
||||
import dev.msfjarvis.claw.model.Tags
|
||||
import dev.msfjarvis.claw.model.User
|
||||
import io.kotest.core.spec.style.FunSpec
|
||||
import io.kotest.matchers.collections.shouldHaveSize
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue