You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.4 KiB
44 lines
1.4 KiB
package com.community.pocket.data.main.forum;
|
|
|
|
import com.community.pocket.R;
|
|
import com.community.pocket.data.model.Forum;
|
|
import com.community.pocket.ui.main.ui.forum.news.ForumNewResponse;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.Random;
|
|
|
|
/**
|
|
* 最新帖子列表数据接口
|
|
* TODO 完善逻辑
|
|
*/
|
|
public class ForumNewRequest {
|
|
private static volatile ForumNewRequest instance;
|
|
|
|
private ForumNewRequest() {
|
|
}
|
|
|
|
public static ForumNewRequest getInstance() {
|
|
if (instance == null) {
|
|
instance = new ForumNewRequest();
|
|
}
|
|
return instance;
|
|
}
|
|
|
|
public ForumNewResponse loadForumNew() {
|
|
List<Forum> forumList = new ArrayList<>();
|
|
for (int i = 0; i < 10; i++) {
|
|
Forum forum = new Forum();
|
|
forum.setTitle("标题" + i);
|
|
forum.setContent("内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容");
|
|
forum.setUsername("发帖人" + i);
|
|
forum.setTime(System.currentTimeMillis());
|
|
forum.setReply(new Random().nextInt(100));
|
|
forumList.add(forum);
|
|
}
|
|
ForumNewResponse response = new ForumNewResponse();
|
|
response.setSuccess(R.string.load_forum_new_ok);
|
|
response.setBody(forumList);
|
|
return response;
|
|
}
|
|
}
|
|
|