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.
48 lines
1.4 KiB
48 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.my.ForumMyResponse;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.Random;
|
|
|
|
/**
|
|
* 我的帖子请求接口
|
|
* TODO 完善逻辑
|
|
*/
|
|
public class ForumMyRequest {
|
|
private static volatile ForumMyRequest instance;
|
|
|
|
private ForumMyRequest() {
|
|
}
|
|
|
|
public static ForumMyRequest getInstance() {
|
|
if (instance == null) {
|
|
instance = new ForumMyRequest();
|
|
}
|
|
return instance;
|
|
}
|
|
|
|
/**
|
|
* @return 加载我的帖子
|
|
*/
|
|
public ForumMyResponse loadForumMy() {
|
|
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);
|
|
}
|
|
ForumMyResponse response = new ForumMyResponse();
|
|
response.setSuccess(R.string.load_forum_my_ok);
|
|
response.setBody(forumList);
|
|
return response;
|
|
}
|
|
}
|
|
|