pda/zhuike/.svn/pristine/67/67cc8d8ee13a2fe7fb3b4349600...

137 lines
3.4 KiB
Plaintext
Raw Normal View History

2024-02-06 22:23:29 +08:00
package com.novelbook.android.db;
import com.novelbook.android.bean.RegexOnMulu;
import org.litepal.LitePal;
import org.litepal.annotation.Column;
import org.litepal.crud.LitePalSupport;
import java.util.List;
public class SiteRule extends LitePalSupport {
private int id;
private String name;
@Column(unique = true, nullable = false)
private String domain;
private String encoding;
// private String chapterUrlRegexOnMulu;
private RegexOnMulu[] chapterUrlRegexOnMulu;
private String chapterContentDumpRegex;
private String chapterContentRegex;
private String muluUrlPattern;
private String chapterUrlPattern;
private long miniInterval4AccessChapter;
private String[] headers;
private String[] userAgents;
public String[] getUserAgents() {
return userAgents;
}
public void setUserAgents(String[] userAgents) {
this.userAgents = userAgents;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getEncoding() {
return encoding;
}
public void setEncoding(String encoding) {
this.encoding = encoding;
}
public String getChapterContentRegex() {
return chapterContentRegex;
}
public void setChapterContentRegex(String chapterContentRegex) {
this.chapterContentRegex = chapterContentRegex;
}
public RegexOnMulu[] getChapterUrlRegexOnMulu() {
return chapterUrlRegexOnMulu;
}
public void setChapterUrlRegexOnMulu(RegexOnMulu[] chapterUrlRegexOnMulu) {
this.chapterUrlRegexOnMulu = chapterUrlRegexOnMulu;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
/* public String getChapterUrlRegexOnMulu() {
return chapterUrlRegexOnMulu;
}
public void setChapterUrlRegexOnMulu(String chapterUrlRegexOnMulu) {
this.chapterUrlRegexOnMulu = chapterUrlRegexOnMulu;
}
*/
public String getChapterContentDumpRegex() {
return chapterContentDumpRegex;
}
public void setChapterContentDumpRegex(String chapterContentDumpRegex) {
this.chapterContentDumpRegex = chapterContentDumpRegex;
}
public String getMuluUrlPattern() {
return muluUrlPattern;
}
public void setMuluUrlPattern(String muluUrlPattern) {
this.muluUrlPattern = muluUrlPattern;
}
public String getChapterUrlPattern() {
return chapterUrlPattern;
}
public void setChapterUrlPattern(String chapterUrlPattern) {
this.chapterUrlPattern = chapterUrlPattern;
}
public long getMiniInterval4AccessChapter() {
return miniInterval4AccessChapter;
}
public void setMiniInterval4AccessChapter(long miniInterval4AccessChapter) {
this.miniInterval4AccessChapter = miniInterval4AccessChapter;
}
public String[] getHeaders() {
return headers;
}
public void setHeaders(String[] headers) {
this.headers = headers;
}
public static SiteRule getSiteRuleByDomain(String domain){
List<SiteRule> rules = LitePal.where("domain = ?",domain).limit(1).find(SiteRule.class);
SiteRule sr = rules.size()> 0 ? rules.get(0): null;
return sr;
}
}