Skip to content

Commit

Permalink
Move some models from :domain to :api module
Browse files Browse the repository at this point in the history
  • Loading branch information
SIKV committed Jun 28, 2024
1 parent 8949b18 commit 1ae9856
Show file tree
Hide file tree
Showing 21 changed files with 25 additions and 30 deletions.
1 change: 1 addition & 0 deletions api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
alias libs.plugins.android.library
alias libs.plugins.kotlin.android
alias libs.plugins.kotlin.parcelize
alias libs.plugins.kotlin.kapt
alias libs.plugins.hilt
}
Expand Down
6 changes: 3 additions & 3 deletions api/src/main/java/com/github/sikv/photos/api/PexelsApi.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.github.sikv.photos.api

import com.github.sikv.photos.domain.pexels.PexelsCuratedPhotosResponse
import com.github.sikv.photos.domain.pexels.PexelsPhoto
import com.github.sikv.photos.domain.pexels.PexelsSearchResponse
import com.github.sikv.photos.api.domain.pexels.PexelsCuratedPhotosResponse
import com.github.sikv.photos.api.domain.pexels.PexelsPhoto
import com.github.sikv.photos.api.domain.pexels.PexelsSearchResponse
import retrofit2.http.GET
import retrofit2.http.Path
import retrofit2.http.Query
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/java/com/github/sikv/photos/api/PixabayApi.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.github.sikv.photos.api

import com.github.sikv.photos.domain.pixabay.PixabaySearchResponse
import com.github.sikv.photos.api.domain.pixabay.PixabaySearchResponse
import retrofit2.http.GET
import retrofit2.http.Query

Expand Down
4 changes: 2 additions & 2 deletions api/src/main/java/com/github/sikv/photos/api/UnsplashApi.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.github.sikv.photos.api

import com.github.sikv.photos.domain.unsplash.UnsplashPhoto
import com.github.sikv.photos.domain.unsplash.UnsplashSearchResponse
import com.github.sikv.photos.api.domain.unsplash.UnsplashPhoto
import com.github.sikv.photos.api.domain.unsplash.UnsplashSearchResponse
import retrofit2.http.GET
import retrofit2.http.Path
import retrofit2.http.Query
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.github.sikv.photos.api.client

import com.github.sikv.photos.api.PexelsApi
import com.github.sikv.photos.domain.pexels.PexelsCuratedPhotosResponse
import com.github.sikv.photos.domain.pexels.PexelsPhoto
import com.github.sikv.photos.domain.pexels.PexelsSearchResponse
import com.github.sikv.photos.api.domain.pexels.PexelsCuratedPhotosResponse
import com.github.sikv.photos.api.domain.pexels.PexelsPhoto
import com.github.sikv.photos.api.domain.pexels.PexelsSearchResponse
import javax.inject.Inject
import javax.inject.Singleton

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.github.sikv.photos.api.client

import com.github.sikv.photos.api.PixabayApi
import com.github.sikv.photos.domain.pixabay.PixabaySearchResponse
import com.github.sikv.photos.api.domain.pixabay.PixabaySearchResponse
import javax.inject.Inject
import javax.inject.Singleton

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.github.sikv.photos.api.client

import com.github.sikv.photos.api.UnsplashApi
import com.github.sikv.photos.domain.unsplash.UnsplashPhoto
import com.github.sikv.photos.domain.unsplash.UnsplashSearchResponse
import com.github.sikv.photos.api.domain.unsplash.UnsplashPhoto
import com.github.sikv.photos.api.domain.unsplash.UnsplashSearchResponse
import javax.inject.Inject
import javax.inject.Singleton

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.sikv.photos.domain.pexels
package com.github.sikv.photos.api.domain.pexels

import com.google.gson.annotations.SerializedName

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.sikv.photos.domain.pexels
package com.github.sikv.photos.api.domain.pexels

import com.github.sikv.photos.domain.Photo
import com.github.sikv.photos.domain.PhotoSource
Expand Down Expand Up @@ -34,5 +34,4 @@ class PexelsPhoto(
override fun getPhotoPhotographerUrl(): String = photographerUrl

override fun getPhotoSource(): PhotoSource = PhotoSource.PEXELS
override fun isLocalPhoto(): Boolean = false
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.sikv.photos.domain.pexels
package com.github.sikv.photos.api.domain.pexels

import com.google.gson.annotations.SerializedName

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.sikv.photos.domain.pexels
package com.github.sikv.photos.api.domain.pexels

import android.os.Parcelable
import com.google.gson.annotations.SerializedName
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.sikv.photos.domain.pixabay
package com.github.sikv.photos.api.domain.pixabay

import com.github.sikv.photos.domain.Photo
import com.github.sikv.photos.domain.PhotoSource
Expand Down Expand Up @@ -40,5 +40,4 @@ class PixabayPhoto(
override fun getPhotoPhotographerImageUrl(): String = userImageUrl

override fun getPhotoSource(): PhotoSource = PhotoSource.PIXABAY
override fun isLocalPhoto(): Boolean = false
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.sikv.photos.domain.pixabay
package com.github.sikv.photos.api.domain.pixabay

import com.google.gson.annotations.SerializedName

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.sikv.photos.domain.unsplash
package com.github.sikv.photos.api.domain.unsplash

import android.os.Parcelable
import com.google.gson.annotations.SerializedName
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.sikv.photos.domain.unsplash
package com.github.sikv.photos.api.domain.unsplash

import com.github.sikv.photos.domain.Photo
import com.github.sikv.photos.domain.PhotoSource
Expand Down Expand Up @@ -32,5 +32,4 @@ class UnsplashPhoto(
override fun getPhotoPhotographerUrl(): String? = user.portfolioUrl

override fun getPhotoSource(): PhotoSource = PhotoSource.UNSPLASH
override fun isLocalPhoto(): Boolean = false
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.sikv.photos.domain.unsplash
package com.github.sikv.photos.api.domain.unsplash

import android.os.Parcelable
import com.google.gson.annotations.SerializedName
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.sikv.photos.domain.unsplash
package com.github.sikv.photos.api.domain.unsplash

import com.google.gson.annotations.SerializedName

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.sikv.photos.domain.unsplash
package com.github.sikv.photos.api.domain.unsplash

import android.os.Parcelable
import com.google.gson.annotations.SerializedName
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.sikv.photos.domain.unsplash
package com.github.sikv.photos.api.domain.unsplash

import android.os.Parcelable
import com.google.gson.annotations.SerializedName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,4 @@ class FavoritePhotoEntity(
override fun getPhotoPhotographerUrl(): String? = photographerUrl

override fun getPhotoSource(): PhotoSource = source
override fun isLocalPhoto(): Boolean = true
}
2 changes: 0 additions & 2 deletions domain/src/main/java/com/github/sikv/photos/domain/Photo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ abstract class Photo : Parcelable {

open fun getPhotoSource(): PhotoSource = PhotoSource.UNSPECIFIED

abstract fun isLocalPhoto(): Boolean

override fun equals(other: Any?): Boolean {
return if (other !is Photo) {
false
Expand Down

0 comments on commit 1ae9856

Please sign in to comment.