Replace NextNewsuser by a kotlin version with generated adapters

This commit is contained in:
Shinokuni 2020-01-11 18:31:59 +01:00
parent 192d3ca5dc
commit 6705b47df6
4 changed files with 20 additions and 60 deletions

View File

@ -7,15 +7,15 @@ import android.util.TimingLogger;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.readrops.app.utils.FeedInsertionResult;
import com.readrops.app.utils.ParsingResult;
import com.readrops.app.utils.Utils;
import com.readrops.app.utils.matchers.FeedMatcher;
import com.readrops.app.utils.matchers.ItemMatcher;
import com.readrops.readropsdb.entities.Feed; import com.readrops.readropsdb.entities.Feed;
import com.readrops.readropsdb.entities.Folder; import com.readrops.readropsdb.entities.Folder;
import com.readrops.readropsdb.entities.Item; import com.readrops.readropsdb.entities.Item;
import com.readrops.readropsdb.entities.account.Account; import com.readrops.readropsdb.entities.account.Account;
import com.readrops.app.utils.FeedInsertionResult;
import com.readrops.app.utils.matchers.FeedMatcher;
import com.readrops.app.utils.matchers.ItemMatcher;
import com.readrops.app.utils.ParsingResult;
import com.readrops.app.utils.Utils;
import com.readrops.readropslibrary.services.Credentials; import com.readrops.readropslibrary.services.Credentials;
import com.readrops.readropslibrary.services.SyncType; import com.readrops.readropslibrary.services.SyncType;
import com.readrops.readropslibrary.services.nextcloudnews.NextNewsAPI; import com.readrops.readropslibrary.services.nextcloudnews.NextNewsAPI;

View File

@ -41,6 +41,7 @@ public class NextNewsAPI extends API<NextNewsService> {
.build(); .build();
} }
@Nullable
public NextNewsUser login() throws IOException { public NextNewsUser login() throws IOException {
Response<NextNewsUser> response = api.getUser().execute(); Response<NextNewsUser> response = api.getUser().execute();

View File

@ -1,55 +0,0 @@
package com.readrops.readropslibrary.services.nextcloudnews.json;
public class NextNewsUser {
private String userId;
private String displayName;
private long lastLoginTimestamp;
private Avatar avatar;
public NextNewsUser() {
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
public long getLastLoginTimestamp() {
return lastLoginTimestamp;
}
public void setLastLoginTimestamp(long lastLoginTimestamp) {
this.lastLoginTimestamp = lastLoginTimestamp;
}
public Avatar getAvatar() {
return avatar;
}
public void setAvatar(Avatar avatar) {
this.avatar = avatar;
}
public class Avatar {
private String data;
private String mime;
}
}

View File

@ -0,0 +1,14 @@
package com.readrops.readropslibrary.services.nextcloudnews.json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class NextNewsUser(val userId: String,
val displayName: String,
val lastLoginTimestamp: Long,
val avatar: Avatar?) {
@JsonClass(generateAdapter = true)
data class Avatar(val data: String,
val mime: String)
}