package cn.user.action; import java.util.List; import com.opensymphony.xwork2.Action; import cn.user.model.User; import cn.user.service.UserService; public class UserAction { private UserService userService = new UserService(); private User user; private List<User> users; /** * 添加用户信息 * @return */ public String addUser(){ this.userService.add(user); return "success"; } /** * 获取用户信息列表 * @return */ public String getAll(){ users = userService.findAll(); return Action.SUCCESS; } /** * 修改用户信息 * @return */ public String change(){ int result = userService.changUser(user); if(result > 0){ return "success"; }else{ return "error"; } } /** * 到修改页面 * @return */ public String toChange(){ user = this.userService.findOne(user.getId()); return "success"; } /** * 删除用户信息 * @return */ public String remove(){ int result = this.userService.remove(user.getId()); if(result > 0){ return Action.SUCCESS; } return Action.ERROR; } public UserService getUserService() { return userService; } public void setUserService(UserService userService) { this.userService = userService; } public User getUser() { return user; } public void setUser(User user) { this.user = user; } public List<User> getUsers() { return users; } public void setUsers(List<User> users) { this.users = users; } }

1938953205 LV1
2022年5月18日
There,there LV1
2021年12月14日
and123456 LV11
2021年10月22日
htdncccc LV1
2021年5月31日
dangzhongan LV3
2020年10月12日
yang2001 LV5
2020年9月16日
liuwenlong LV20
2020年7月10日
haitao793 LV3
2020年7月9日
13035212816 LV1
2020年6月30日
qq2528732622 LV8
2020年6月15日

NHealers LV5
2024年9月19日
Qolmen LV12
2024年1月9日
uni-code_0123 LV1
2023年11月29日
wzh200808
2022年11月7日
暂无贡献等级
Yaolinchen
2022年9月26日
暂无贡献等级
谢谢谢谢谢谢你 LV6
2022年7月12日
lingtiejing LV15
2022年6月10日
1938953205 LV1
2022年5月18日
1306878374 LV13
2022年4月11日
过过成功尺寸 LV7
2021年12月21日