ajaxmyaccountdetailaction.java

来自「因为许多人出去吃饭都一个人付帐」· Java 代码 · 共 81 行

JAVA
81
字号
package cn.com.sdcncsi.lunch.balance.action;

import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.interceptor.SessionAware;

import cn.com.sdcncsi.lunch.balance.service.AccountDetailService;
import cn.com.sdcncsi.lunch.balance.service.CheckDetailService;
import cn.com.sdcncsi.lunch.domain.User;
import cn.com.sdcncsi.lunch.utils.Constants;
//import cn.com.sdcncsi.lunch.balance.service.CheckOutService;

import com.opensymphony.xwork2.ActionSupport;

public class AjaxMyAccountDetailAction extends ActionSupport implements SessionAware {

	private AccountDetailService accountDetailService = null;
	private static Log logger = LogFactory.getLog(AjaxMyAccountDetailAction.class.getName());
	
	/* (non-Javadoc)
	 * @see com.opensymphony.xwork2.ActionSupport#execute()
	 */
	@Override
	public String execute() {
		// TODO Auto-generated method stub
		try{
			User user = new User();
			user.setId(userId);
			setJsonModel(accountDetailService.getAccountDetailsByUser(user));
			logger.debug("json:"+getJsonModel());
		}catch(Exception e){
			e.printStackTrace();
		}
		return SUCCESS;
	}
	
	public void setAccountDetailService(AccountDetailService accountDetailService){
		this.accountDetailService = accountDetailService;
	}
	
	private Object jsonModel;
	private Map session;
	private Integer userId;

	/**
	 * @return the jsonModel
	 */
	public Object getJsonModel() {
		return jsonModel;
	}

	/**
	 * @param jsonModel the jsonModel to set
	 */
	public void setJsonModel(Object jsonModel) {
		this.jsonModel = jsonModel;
	}

	public void setSession(Map session) {
		// TODO Auto-generated method stub
		this.session = session;
	}

	/**
	 * @return the userId
	 */
	public Integer getUserId() {
		return userId;
	}

	/**
	 * @param userId the userId to set
	 */
	public void setUserId(Integer userId) {
		this.userId = userId;
	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?