mirror of https://github.com/readrops/Readrops.git
Replace NextNewsuser by a kotlin version with generated adapters
This commit is contained in:
parent
192d3ca5dc
commit
6705b47df6
|
@ -7,15 +7,15 @@ import android.util.TimingLogger;
|
|||
import androidx.annotation.NonNull;
|
||||
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.Folder;
|
||||
import com.readrops.readropsdb.entities.Item;
|
||||
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.SyncType;
|
||||
import com.readrops.readropslibrary.services.nextcloudnews.NextNewsAPI;
|
||||
|
|
|
@ -41,6 +41,7 @@ public class NextNewsAPI extends API<NextNewsService> {
|
|||
.build();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public NextNewsUser login() throws IOException {
|
||||
Response<NextNewsUser> response = api.getUser().execute();
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
|
@ -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)
|
||||
}
|
Loading…
Reference in New Issue