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.
53 lines
1.6 KiB
53 lines
1.6 KiB
package com.community.pocket.data.main.forum;
|
|
|
|
import com.community.pocket.R;
|
|
import com.community.pocket.data.model.ForumHot;
|
|
import com.community.pocket.data.model.Hot;
|
|
import com.community.pocket.data.model.UserHot;
|
|
import com.community.pocket.ui.main.ui.forum.hot.ForumHotResponse;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
/**
|
|
* 热门动态接口请求
|
|
* TODO 完善逻辑
|
|
*/
|
|
public class ForumHotRequest {
|
|
private static volatile ForumHotRequest instance;
|
|
|
|
private ForumHotRequest() {
|
|
}
|
|
|
|
public static ForumHotRequest getInstance() {
|
|
if (instance == null) {
|
|
instance = new ForumHotRequest();
|
|
}
|
|
return instance;
|
|
}
|
|
|
|
//加载热门信息
|
|
public ForumHotResponse loadHot() {
|
|
List<UserHot> userHots = new ArrayList<>();
|
|
List<ForumHot> topicHots = new ArrayList<>();
|
|
List<ForumHot> activeHots = new ArrayList<>();
|
|
for (int i = 0; i < 3; i++) {
|
|
UserHot userHot = new UserHot();
|
|
userHot.setUserId(i);
|
|
userHot.setUserName("user" + i);
|
|
userHots.add(userHot);
|
|
ForumHot forumHot = new ForumHot();
|
|
forumHot.setForumId(i);
|
|
forumHot.setTitle("topIc" + i);
|
|
topicHots.add(forumHot);
|
|
ForumHot activeHot = new ForumHot();
|
|
activeHot.setForumId(i);
|
|
activeHot.setTitle("hot" + i);
|
|
activeHots.add(activeHot);
|
|
}
|
|
ForumHotResponse response = new ForumHotResponse();
|
|
response.setSuccess(R.string.load_hot_ok);
|
|
response.setBody(new Hot(userHots, topicHots, activeHots));
|
|
return response;
|
|
}
|
|
}
|
|
|