package com.ideabobo.action;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import javax.swing.*;
import org.springframework.stereotype.Controller;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.ideabobo.model.Beizhu;
import com.ideabobo.model.Huodong;
import com.ideabobo.model.Message;
import com.ideabobo.model.Posts;
import com.ideabobo.model.Qunzu;
import com.ideabobo.model.Record;
import com.ideabobo.model.Replay;
import com.ideabobo.model.User;
import com.ideabobo.model.Yzmessage;
import com.ideabobo.service.BaseService;
import com.ideabobo.service.PostsService;
import com.ideabobo.service.ReplayService;
import com.ideabobo.service.UserService;
import com.ideabobo.util.GetNowTime;
import com.ideabobo.util.IdeaAction;
@Controller
public class WehallAction extends IdeaAction {
@Resource
private BaseService baseService;
@Resource
private UserService userService;
@Resource
private PostsService postsService;
@Resource
private ReplayService replayService;
public Gson gson = new Gson();
private static final long serialVersionUID = -3218238026025256103L;
public String wehall(){
// String openid = request.getParameter("openid");
// session.put("openid", openid);
return SUCCESS;
}
public void login(){
String username = request.getParameter("username");
String passwd = request.getParameter("passwd");
User user = new User();
user.setPasswd(passwd);
user.setUsername(encodeGet(username));
User r = userService.find(user);
if(r!=null){
renderJsonpObj(r);
}else{
renderJsonpString("fail");
}
}
public void listNotice(){
renderJsonpObj(baseService.list("from Notice"));
}
public void resetPasswd(){
String username = request.getParameter("username");
username = encodeGet(username);
List<User> users = baseService.list("from User t where t.username='"+username+"'");
if(users!=null){
User user = users.get(0);
user.setPasswd(request.getParameter("passwd"));
baseService.update(user);
renderJsonpObj(user);
}else{
renderJsonpString("");
}
}
public void checkUser(){
User u = new User();
String username = request.getParameter("username");
u.setUsername(username);
User r = userService.find(u);
if(r!=null){
renderJsonpString("fail");
}else{
renderJsonpString("success");
}
}
public void updateUser(){
String tel = request.getParameter("tel");
String qq = request.getParameter("qq");
String wechat = request.getParameter("wechat");
String email = request.getParameter("email");
String birth = request.getParameter("birth");
String sex = request.getParameter("sex");
String fname = request.getParameter("fname");
String yuanxi = request.getParameter("yuanxi");
String zhuanye = request.getParameter("zhuanye");
String nianji = request.getParameter("nianji");
String xuehao = request.getParameter("xuehao");
String id = request.getParameter("id");
User user = userService.find(id);
user.setId(Integer.parseInt(id));
user.setTel(tel);
user.setWechat(wechat);
user.setQq(qq);
user.setEmail(email);
user.setBirth(birth);
user.setSex(encodeGet(sex));
user.setFname(encodeGet(fname));
user.setYuanxi(encodeGet(yuanxi));
user.setXuehao(xuehao);
user.setNianji(encodeGet(nianji));
user.setZhuanye(encodeGet(zhuanye));
userService.update(user);
renderJsonpString("success");
}
public void changePasswd(){
String passwd = request.getParameter("passwd");
String id = request.getParameter("id");
User user = userService.find(id);
user.setPasswd(passwd);
userService.update(user);
renderJsonpString("success");
}
public void register(){
User user = (User) getByRequest(new User(), true);
userService.save(user);
renderJsonpString("success");
}
public void getUser(){
String id = request.getParameter("id");
User u = (User) baseService.find(Integer.parseInt(id), User.class);
renderJsonpObj(u);
}
public void addPosts(){
Posts p = (Posts) getByRequest(new Posts(), true);
String ndate = GetNowTime.getNowTimeEn();
p.setNdate(ndate);
postsService.save(p);
renderJsonpString("success");
}
public void listPosts(){
String hql = "from Posts t where 1=1";
String type = request.getParameter("type");
String uid = request.getParameter("uid");
String pid = request.getParameter("pid");
if(type!=null && !type.equals("")){
hql+=" and t.type="+type;
}
if(uid!=null && !uid.equals("")){
hql+=" and t.uid='"+uid+"'";
}
if(pid!=null && !pid.equals("")){
hql+=" and t.pid='"+pid+"'";
}
renderJsonpObj(baseService.list(hql));
}
public void listPostsFriend(){
String hql = "from Posts t where 1=1";
String uid = request.getParameter("uid");
User u =(User) baseService.find(Integer.parseInt(uid), User.class);
String friends = u.getFids();
if(friends==null || friends.equals("")){
friends = uid;
}else{
friends+=","+uid;
}
hql+=" and t.uid in ("+friends+")";
hql+=" and t.type=1";
renderJsonpObj(baseService.list(hql));
}
public void listReplay(){
String hql = "from Replay t where 1=1";
String pid = request.getParameter("pid");
String type = request.getParameter("type");
if(pid!=null && !pid.equals("")){
hql+=" and t.pid='"+pid+"'";
}
if(type!=null && !type.equals("")){
hql+=" and t.type="+type;
}
renderJsonpObj(baseService.list(hql));
}
public void deleteReplay(){
String id = request.getParameter("id");
baseService.delete(Integer.parseInt(id), Replay.class);
renderJsonpString("0");
}
public void deletePosts(){
String id = request.getParameter("id");
postsService.delete(Integer.parseInt(id));
renderJsonpString("success");
}
public void addReplay(){
Replay r = (Replay) getByRequest(new Replay(), true);
String ndate = GetNowTime.getNowTimeEn();
r.setNdate(ndate);
replayService.save(r);
renderJsonpString("success");
}
public void delPosts(){
String id = request.getParameter("id");
baseService.delete(Integer.parseInt(id), Posts.class);
renderJsonpString("success");
}
/**
* 列出所有协会
*/
public void listQunzu(){
String hql = "from Qunzu t where 1=1";
String type = request.getParameter("type");
if(type!=null && !type.equals("")){
type = encodeGet(type);
hql+=" and t.type like '%"+type+"%'";
}
renderJsonpObj(baseService.list(hql));
}
/**
* 列出协会成员
*/
public void listQunzuUser(){
String qid = request.getParameter("qid");
ArrayList<User> rlist = new ArrayList<User>();
ArrayList<User> list = (ArrayList<User>) baseService.list("from User t where t.qids!=null and t.qids !=''");
for(int i=0;i<list.size();i++){
User u = list.get(i);
String qids = u.getQids();
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
基于Android的校园协会交流App开发(源码+数据库+演示视频).rar 【项目技术】 android+java 【实现功能】 主要包括以下功能: 1.用户注册和登陆:用户可以通过注册获取权限并登陆App,其中区别普通用户和管理员两种权限,对应不同的登陆界面及操作权限; 2.协会聊天功能:用户加入协会群,可以在协会群聊天,私信其他用户; 3.协会创建功能:管理员可以创建协会,设置群头像、群公告等; 4.二维码推介功能:App可以生成二维码,用户可以通过扫描快速加入协会.。
资源推荐
资源详情
资源评论
收起资源包目录
基于Android的校园协会交流App开发(源码+数据库+演示视频).rar (1951个子文件)
resources.ap_ 2.03MB
Shetuan333xiehuihuodongnewsClient.apk 2.61MB
gradlew.bat 2KB
jarlist.cache 120B
IdeaAction.class 18KB
WehallAction.class 18KB
MyObj.class 13KB
FileTool.class 11KB
BaseServiceImp.class 11KB
StringUtil.class 9KB
Plugs.class 7KB
NoticeAction.class 6KB
NoticeServiceImp.class 5KB
ReplayServiceImp.class 5KB
MessageServiceImp.class 5KB
QunzuServiceImp.class 5KB
PostsServiceImp.class 5KB
UserServiceImp.class 5KB
TypeServiceImp.class 5KB
User.class 5KB
UserAction.class 4KB
GetNowTime.class 4KB
MessageAction.class 3KB
ReplayAction.class 3KB
QunzuAction.class 3KB
PostsAction.class 3KB
CopyFile.class 3KB
TypeAction.class 3KB
Yzmessage.class 3KB
Posts.class 3KB
Message.class 3KB
BaiduLocation.class 3KB
Huodong.class 2KB
Qunzu.class 2KB
IndexAction.class 2KB
BaiduLocation$MyLocationListener.class 2KB
Command.class 2KB
Replay.class 2KB
Record.class 2KB
DownloadAction.class 2KB
MainActivity.class 2KB
Notice.class 2KB
Beizhu.class 1KB
Page.class 1KB
Type.class 1KB
MyObj$1.class 1017B
SessionStorage.class 950B
BaseService.class 919B
ReplayService.class 703B
NoticeService.class 703B
Page2.class 574B
MessageService.class 569B
PostsService.class 555B
QunzuService.class 555B
TypeService.class 548B
UserService.class 548B
UploadAction.class 521B
R.class 471B
R$string.class 466B
R$drawable.class 394B
R$xml.class 381B
BuildConfig.class 341B
R$attr.class 334B
.classpath 1KB
.classpath 475B
org.eclipse.wst.common.component 495B
org.eclipse.wst.jsdt.ui.superType.container 49B
jquery.mobile-1.4.5.css 234KB
jquery.mobile-1.4.5.css 234KB
jquery.mobile.inline-svg-1.4.5.css 222KB
jquery.mobile.inline-svg-1.4.5.css 222KB
jquery.mobile.min.css 216KB
jquery.mobile-1.4.5.min.css 203KB
jquery.mobile-1.4.5.min.css 203KB
jquery.mobile-1.4.5.min.css 203KB
jquery.mobile-1.4.5.min.css 203KB
jquery.mobile-1.4.3.min.css 202KB
jquery.mobile-1.4.3.min.css 202KB
jquery.mobile.inline-svg-1.4.5.min.css 191KB
jquery.mobile.inline-svg-1.4.5.min.css 191KB
jquery.mobile.flatui.css 163KB
jquery.mobile.flatui.css 163KB
jquery.mobile.flatui.css 163KB
jquery.mobile.inline-png-1.4.5.css 146KB
jquery.mobile.inline-png-1.4.5.css 146KB
jquery.mobile.icons-1.4.5.css 126KB
jquery.mobile.icons-1.4.5.css 126KB
jquery.mobile.icons.min.css 124KB
jquery.mobile.icons-1.4.5.min.css 124KB
jquery.mobile.icons.min.css 124KB
jquery.mobile.icons-1.4.5.min.css 124KB
jquery.mobile.skyd-1.4.5.css 120KB
jquery.mobile.skyd-1.4.5.css 120KB
jquery.mobile.external-png-1.4.5.css 119KB
jquery.mobile.external-png-1.4.5.css 119KB
jquery.mobile.inline-png-1.4.5.min.css 115KB
jquery.mobile.inline-png-1.4.5.min.css 115KB
jquery.mobile.structure-1.4.5.css 89KB
jquery.mobile.structure-1.4.5.css 89KB
jquery.mobile.external-png-1.4.5.min.css 89KB
共 1951 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
- 彼岸4042024-03-23资源内容总结的很到位,内容详实,很受用,学到了~
职场程序猿
- 粉丝: 6177
- 资源: 3706
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功