/** * Filename: weibo→com.weibo.happy.action→FavoritesAction.java * Description: * Copyright: Copyright (c)2011 * Company: Idcorner * @author: happy qiaolevip@gmail.com * @version: 1.0 * Create at: 2:51:24 PM * * Modification History: * Date Author Version Description * ------------------------------------------------------------------ * 2:51:24 PM Joe 1.0 1.0 Version */ package com.weibo.happy.action.favorites; import java.util.List; import java.util.Map; import org.apache.struts2.interceptor.SessionAware; import weibo4j.Status; import weibo4j.User; import weibo4j.http.AccessToken; import com.opensymphony.xwork2.ActionSupport; import com.weibo.happy.dao.FavoritesDAO; /** * @author happy * */ public class FavoritesAction extends ActionSupport implements SessionAware { /** * */ private static final long serialVersionUID = 7232681032563165972L; private FavoritesDAO dao = new FavoritesDAO(); private List<Status> list; private User user; private Map<String, Object> session; private String id; private Status status; /** * @return the status */ public Status getStatus() { return status; } /** * @param status * the status to set */ public void setStatus(Status status) { this.status = status; } /** * @return the dao */ public FavoritesDAO getDao() { return dao; } /** * @param dao * the dao to set */ public void setDao(FavoritesDAO dao) { this.dao = dao; } /** * @return the list */ public List<Status> getList() { return list; } /** * @param list * the list to set */ public void setList(List<Status> list) { this.list = list; } /** * @return the user */ public User getUser() { return user; } /** * @param user * the user to set */ public void setUser(User user) { this.user = user; } /** * @return the id */ public String getId() { return id; } /** * @param id * the id to set */ public void setId(String id) { this.id = id; } /* * (non-Javadoc) * * @see * org.apache.struts2.interceptor.SessionAware#setSession(java.util.Map) */ @Override public void setSession(Map<String, Object> session) { this.session = session; } public String execute() { AccessToken accessToken = (AccessToken) this.session.get("accessToken"); list = dao.getFavorites(accessToken); return SUCCESS; } /** * 收藏一条微博消息(添加收藏) * * @return */ public String createFavorite() { AccessToken accessToken = (AccessToken) this.session.get("accessToken"); status = dao.createFavorite(accessToken, id); return "createFavorite"; } }
最近下载更多
ccccccc1 LV1
2023年12月27日
三十一 LV2
2023年6月28日
微信网友_6488247163490304 LV1
2023年5月23日
zhicheng1 LV6
2023年5月15日
1241312369 LV1
2022年4月8日
13112360 LV2
2022年3月18日
光 LV1
2021年12月19日
文茂思 LV2
2021年10月14日
Mayoubin2001 LV21
2021年6月9日
Lbrap123 LV1
2021年5月7日
最近浏览更多
ccccccc1 LV1
2023年12月26日
三十一 LV2
2023年6月28日
罗清晨 LV11
2023年6月20日
zzhua195 LV6
2023年5月29日
微信网友_6488247163490304 LV1
2023年5月23日
zhicheng1 LV6
2023年5月15日
科技家 LV2
2023年3月15日
zl2569837365 LV1
2023年3月14日
95959595959 LV13
2023年2月7日
wangyz LV8
2022年12月23日