首页>代码>S2SH开发的企业办公OA管理系统>/OA/src/com/oa/action/ReplyAction.java
package com.oa.action;

import java.util.Date;

import org.apache.struts2.ServletActionContext;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.oa.base.BaseAction;
import com.oa.domain.Reply;
import com.oa.domain.Topic;
import com.opensymphony.xwork2.ActionContext;
@Controller
@Scope("prototype")
public class ReplyAction extends BaseAction<Reply> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Long topicId;
	/**
	 * 发表回帖页面
	 * @return
	 * @throws Exception
	 */
	public String addUI() throws Exception {
		//准备数据
		Topic topic = topicService.findById(topicId);
		ActionContext.getContext().put("topic", topic);
		return "addUI";
	}
	/**
	 * 发表回帖
	 * @return
	 * @throws Exception
	 */
	public String add() throws Exception {
		//封装
		
		// >>> 表单字段  已经封装了 title  content
		model.setTopic(topicService.findById(topicId));
		// >>> 当前信息
		model.setAuthor(getCurrentUser());//当前用户
		model.setIpAddr(ServletActionContext.getRequest().getRemoteAddr());
		model.setPostTime(new Date());//当前时间
		//保存
		replyService.save(model);
		return "toTopicShow";//转到新回复所在主题的显示页面
	}
	// ===================================================
	public Long getTopicId() {
		return topicId;
	}
	public void setTopicId(Long topicId) {
		this.topicId = topicId;
	}
	
	

}
最近下载更多
xiaohuaidan455  LV2 2月21日
朱俪的邮件及存储  LV8 2023年4月28日
泓鼎168  LV20 2023年3月30日
wanglinddad  LV55 2022年5月26日
529948627  LV6 2022年3月14日
蛇蛇皮怪  LV14 2022年3月8日
微信网友_5845420553359360  LV4 2022年2月25日
juanito8396  LV6 2021年12月20日
and123456  LV11 2021年5月11日
shiyujir  LV7 2021年4月8日
最近浏览更多
xiaohuaidan455  LV2 2月21日
255921158  LV5 2024年12月20日
angaochong  LV5 2024年10月29日
栾庆浩 2024年10月29日
暂无贡献等级
lqzixi  LV4 2024年10月9日
krispeng  LV15 2024年8月12日
yunsgui  LV1 2024年6月25日
王子文 2024年6月16日
暂无贡献等级
lsglsg9  LV23 2024年5月30日
yangyuer  LV1 2024年4月26日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友