u
This commit is contained in:
parent
624d2fac8f
commit
56f91c0283
@ -24,6 +24,11 @@ public class MpNews implements MassTuple, NotifyTuple {
|
||||
|
||||
private static final long serialVersionUID = 8853054484809101524L;
|
||||
|
||||
/**
|
||||
* 允许最多的图文列表数
|
||||
*/
|
||||
private static final int MAX_ARTICLE_COUNT = 10;
|
||||
|
||||
@Override
|
||||
public String getMessageType() {
|
||||
return "mpnews";
|
||||
@ -82,7 +87,23 @@ public class MpNews implements MassTuple, NotifyTuple {
|
||||
return this;
|
||||
}
|
||||
|
||||
@JSONField(serialize = false)
|
||||
@XmlTransient
|
||||
public boolean isMaxCount() {
|
||||
return articles.size() == MAX_ARTICLE_COUNT;
|
||||
}
|
||||
|
||||
public List<MpArticle> getArticles() {
|
||||
if (articles.size() > MAX_ARTICLE_COUNT) {
|
||||
return articles.subList(0, MAX_ARTICLE_COUNT);
|
||||
} else {
|
||||
return articles;
|
||||
}
|
||||
}
|
||||
|
||||
@JSONField(serialize = false)
|
||||
@XmlTransient
|
||||
public List<MpArticle> getFullArticles() {
|
||||
return articles;
|
||||
}
|
||||
|
||||
|
||||
@ -29,6 +29,9 @@ public class News implements NotifyTuple {
|
||||
return "news";
|
||||
}
|
||||
|
||||
/**
|
||||
* 允许最多的图文列表数
|
||||
*/
|
||||
private static final int MAX_ARTICLE_COUNT = 10;
|
||||
|
||||
/**
|
||||
@ -88,6 +91,8 @@ public class News implements NotifyTuple {
|
||||
}
|
||||
}
|
||||
|
||||
@JSONField(serialize = false)
|
||||
@XmlTransient
|
||||
public List<Article> getFullArticles() {
|
||||
return articles;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user