首页>代码>s2sh实现用户登录的增删改查简单实例>/ssh-new/src/com/action/UserAction.java
package com.action;

import java.util.List;

import com.entity.User;
import com.opensymphony.xwork2.ActionSupport;
import com.service.UserService;

public class UserAction extends ActionSupport{

	private List<User> users;
	private Integer id;
	private User user;
	private UserService userService;
	public List<User> getUsers() {
		return users;
	}
	public void setUsers(List<User> users) {
		this.users = users;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public UserService getUserService() {
		return userService;
	}
	public void setUserService(UserService userService) {
		this.userService = userService;
	}
	
	/**
	 * 查询所有
	 * 
	 * @return
	 */
	public String list(){
		users=userService.getUsers();
		return SUCCESS;
		
	}
	/**
	 * 删除
	 * @return
	 */
	public String delUser(){
		userService.deleteUser(id);
		return SUCCESS;
	}
	/**
	 * 添加
	 * @return
	 */
	public String addUser(){
		userService.saveUser(user);
		return SUCCESS;
	}
	/**
	 * 根据主键查询
	 * @return
	 */
	public String queryById(){
		user=userService.getUserById(id);
		return SUCCESS;
	}
	/**
	 * 更新
	 * @return
	 */
	public String updateUser(){
		userService.updateUser(user);
		return SUCCESS;
	}
	
}
最近下载更多
and123456  LV11 2022年2月11日
2050975749  LV5 2020年1月13日
涛涛8888  LV6 2019年7月2日
wangwangvic  LV3 2019年6月3日
aa991215  LV17 2019年6月1日
1206207437  LV8 2019年4月20日
18195087764  LV1 2018年12月31日
yuzikong001  LV7 2018年12月23日
SevenBlack  LV1 2018年9月27日
shaosiming  LV4 2018年8月15日
最近浏览更多
szqqqaaqqa  LV1 2024年6月20日
qiwwwww  LV2 2024年6月19日
uni-code_0123  LV1 2023年12月6日
暂无贡献等级
yut1an  LV2 2022年10月31日
yangMzz  LV2 2022年10月10日
谢谢谢谢谢谢你  LV6 2022年7月19日
naside  LV2 2022年6月26日
CHENHAOJUDA  LV10 2022年6月14日
多次抛弃前妻  LV4 2022年6月6日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友