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

233 lines
4.7 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;
//@Column(unique = true, defaultValue = "0")
private int novelId;
2019-04-05 23:59:31 +08:00
private String name;
private String infoUrl;
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 smallNovelType;
2019-04-03 16:21:00 +08:00
private String author;
private String cover;
private String chapterName;
private String desc;
private String progress;
2019-04-03 16:21:00 +08:00
private long lastUpateTime;
2019-04-03 18:09:00 +08:00
private boolean isOnShelf; //是否入书架
private boolean isFinished; //是否完本
public String getInfoUrl() {
return infoUrl;
}
public void setInfoUrl(String infoUrl) {
this.infoUrl = infoUrl;
}
public String getSmallNovelType() {
return smallNovelType;
}
public void setSmallNovelType(String smallNovelType) {
this.smallNovelType = smallNovelType;
}
public String getChapterName() {
return chapterName;
}
public void setChapterName(String chapterName) {
this.chapterName = chapterName;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getProgress() {
return progress;
}
public void setProgress(String progress) {
this.progress = progress;
}
2019-04-08 23:16:20 +08:00
public int getTotalChapts() {
return totalChapts;
}
public void setTotalChapts(int totalChapts) {
this.totalChapts = totalChapts;
}
private int totalChapts;
2019-04-03 16:21:00 +08:00
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getNovelId() {
2019-04-03 16:21:00 +08:00
return novelId;
}
public void setNovelId(int novelId) {
2019-04-03 16:21:00 +08:00
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 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 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 novelId==0;
2019-04-06 23:04:42 +08:00
}
public static Novel getNovelBySvrId(int novelId){
2019-04-06 23:04:42 +08:00
List<Novel> nvs = LitePal.where("novelId=?",novelId+"").limit(1).find(Novel.class);
2019-04-06 23:04:42 +08:00
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
}