pda/zhuike/src/main/java/com/novelbook/android/db/Novel.java

214 lines
4.4 KiB
Java
Raw Normal View History

2019-04-03 16:21:00 +08:00
package com.novelbook.android.db;
2019-04-06 23:04:42 +08:00
import android.text.TextUtils;
import org.litepal.LitePal;
2019-04-05 23:59:31 +08:00
import org.litepal.annotation.Column;
2019-04-03 16:21:00 +08:00
import org.litepal.crud.LitePalSupport;
2019-04-06 23:04:42 +08:00
import org.w3c.dom.Text;
2019-04-03 16:21:00 +08:00
import java.io.Serializable;
2019-04-06 23:04:42 +08:00
import java.util.List;
2019-04-03 16:21:00 +08:00
public class Novel extends LitePalSupport implements Serializable{
private int id;
2019-04-05 23:59:31 +08:00
@Column(unique = true, nullable = true)
2019-04-03 16:21:00 +08:00
private String novelId;
2019-04-05 23:59:31 +08:00
private String name;
2019-04-03 16:21:00 +08:00
private String domain;
private String muluUrl;
private String novelPath;
private long lastReadPos;
2019-04-05 23:59:31 +08:00
private int lastReadChapt=1;
2019-04-03 16:21:00 +08:00
private String charset;
private String novelType;
private String novelType2;
private String author;
private String cover;
private String lastestChapterName;
private String description;
private long lastUpateTime;
2019-04-03 18:09:00 +08:00
private boolean isOnShelf; //是否入书架
private boolean isFinished; //是否完本
2019-04-08 23:16:20 +08:00
public int getTotalChapts() {
return totalChapts;
}
public void setTotalChapts(int totalChapts) {
this.totalChapts = totalChapts;
}
private int totalChapts=1000;
2019-04-03 18:09:00 +08:00
2019-04-03 16:21:00 +08:00
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getNovelId() {
return novelId;
}
public void setNovelId(String novelId) {
this.novelId = novelId;
}
2019-04-05 23:59:31 +08:00
public String getName() {
return name;
2019-04-03 16:21:00 +08:00
}
2019-04-05 23:59:31 +08:00
public void setName(String novelName) {
this.name = novelName;
2019-04-03 16:21:00 +08:00
}
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
public String getMuluUrl() {
return muluUrl;
}
public void setMuluUrl(String muluUrl) {
this.muluUrl = muluUrl;
}
public String getNovelPath() {
return novelPath;
}
public void setNovelPath(String novelPath) {
this.novelPath = novelPath;
}
public long getLastReadPos() {
return lastReadPos;
}
public void setLastReadPos(long lastReadPos) {
this.lastReadPos = lastReadPos;
}
2019-04-05 23:59:31 +08:00
public int getLastReadChapt() {
2019-04-03 16:21:00 +08:00
return lastReadChapt;
}
2019-04-05 23:59:31 +08:00
public void setLastReadChapt(int lastReadChapt) {
2019-04-03 16:21:00 +08:00
this.lastReadChapt = lastReadChapt;
}
public String getCharset() {
return charset;
}
public void setCharset(String charset) {
this.charset = charset;
}
public String getNovelType() {
return novelType;
}
public void setNovelType(String novelType) {
this.novelType = novelType;
}
public String getNovelType2() {
return novelType2;
}
public void setNovelType2(String novelType2) {
this.novelType2 = novelType2;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getCover() {
return cover;
}
public void setCover(String cover) {
this.cover = cover;
}
public String getLastestChapterName() {
return lastestChapterName;
}
public void setLastestChapterName(String lastestChapterName) {
this.lastestChapterName = lastestChapterName;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public long getLastUpateTime() {
return lastUpateTime;
}
public void setLastUpateTime(long lastUpateTime) {
this.lastUpateTime = lastUpateTime;
}
2019-04-03 18:09:00 +08:00
public boolean isOnShelf() {
return isOnShelf;
}
2019-04-03 16:21:00 +08:00
2019-04-03 18:09:00 +08:00
public void setOnShelf(boolean onShelf) {
isOnShelf = onShelf;
}
2019-04-03 16:21:00 +08:00
2019-04-03 18:09:00 +08:00
public boolean isFinished() {
return isFinished;
}
2019-04-03 16:21:00 +08:00
2019-04-03 18:09:00 +08:00
public void setFinished(boolean finished) {
isFinished = finished;
}
2019-04-06 23:04:42 +08:00
public boolean isLocalBook(){
return TextUtils.isEmpty(novelId);
}
public static Novel getNovelBySvrId(String novelId){
List<Novel> nvs = LitePal.where("novelId=?",novelId).limit(1).find(Novel.class);
if(nvs.size()>0){
return nvs.get(0);
}
return null;
}
public static List<Novel> getNovelsOnShelf(){
return LitePal.where("isOnShelf=?","1").find(Novel.class);
}
public static List<Novel> getLocalNovels(){
return LitePal.where("novelPath !=? ","").find(Novel.class);
}
2019-04-03 16:21:00 +08:00
}