refactor: move Tags from api to model module

This commit is contained in:
Harsh Shandilya 2023-02-22 00:22:44 +05:30
parent 85c11e0e80
commit f17375e9e1
No known key found for this signature in database
4 changed files with 7 additions and 7 deletions

View file

@ -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

View file

@ -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(",")
}
}

View file

@ -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