-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added config data api for parsing the mobile features
- Loading branch information
1 parent
8d635c2
commit 1c1541a
Showing
5 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
content/src/main/kotlin/com/alfresco/content/apis/MobileConfigApi.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.alfresco.content.apis | ||
|
||
import com.alfresco.content.models.MobileConfigData | ||
import retrofit2.http.GET | ||
import retrofit2.http.Headers | ||
import retrofit2.http.Url | ||
|
||
@JvmSuppressWildcards | ||
interface MobileConfigApi { | ||
|
||
@Headers( | ||
"Content-Type: application/json", | ||
) | ||
@GET | ||
suspend fun getMobileConfig(@Url url: String): MobileConfigData | ||
} |
33 changes: 33 additions & 0 deletions
33
content/src/main/kotlin/com/alfresco/content/models/MobileConfigData.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.alfresco.content.models | ||
|
||
import com.squareup.moshi.Json | ||
import com.squareup.moshi.JsonClass | ||
|
||
/** | ||
* @param featuresMobile | ||
*/ | ||
|
||
@JsonClass(generateAdapter = true) | ||
data class MobileConfigData( | ||
@Json(name = "features_mobile") @field:Json(name = "features_mobile") var featuresMobile: Features? = null, | ||
) | ||
|
||
/** | ||
* @param dynamicMenus | ||
*/ | ||
@JsonClass(generateAdapter = true) | ||
data class Features( | ||
@Json(name = "menu") @field:Json(name = "menu") var dynamicMenus: List<DynamicMenu>? = null, | ||
) | ||
|
||
/** | ||
* @param id | ||
* @param name | ||
* @param enabled | ||
*/ | ||
@JsonClass(generateAdapter = true) | ||
data class DynamicMenu( | ||
@Json(name = "id") @field:Json(name = "id") var id: String? = null, | ||
@Json(name = "name") @field:Json(name = "name") var name: String? = null, | ||
@Json(name = "enabled") @field:Json(name = "enabled") var enabled: Boolean? = null, | ||
) |