package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.XueshenghuichengyuanEntity;
import com.entity.view.XueshenghuichengyuanView;
import com.service.XueshenghuichengyuanService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 学生会成员
* 后端接口
* @author
* @email
* @date 2021-04-25 23:56:10
*/
@RestController
@RequestMapping("/xueshenghuichengyuan")
public class XueshenghuichengyuanController {
@Autowired
private XueshenghuichengyuanService xueshenghuichengyuanService;
@Autowired
private TokenService tokenService;
/**
* 登录
*/
@IgnoreAuth
@RequestMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
XueshenghuichengyuanEntity user = xueshenghuichengyuanService.selectOne(new EntityWrapper<XueshenghuichengyuanEntity>().eq("chengyuanzhanghao", username));
if(user==null || !user.getMima().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(user.getId(), username,"xueshenghuichengyuan", "学生会成员" );
return R.ok().put("token", token);
}
/**
* 注册
*/
@IgnoreAuth
@RequestMapping("/register")
public R register(@RequestBody XueshenghuichengyuanEntity xueshenghuichengyuan){
//ValidatorUtils.validateEntity(xueshenghuichengyuan);
XueshenghuichengyuanEntity user = xueshenghuichengyuanService.selectOne(new EntityWrapper<XueshenghuichengyuanEntity>().eq("chengyuanzhanghao", xueshenghuichengyuan.getChengyuanzhanghao()));
if(user!=null) {
return R.error("注册用户已存在");
}
Long uId = new Date().getTime();
xueshenghuichengyuan.setId(uId);
xueshenghuichengyuanService.insert(xueshenghuichengyuan);
return R.ok();
}
/**
* 退出
*/
@RequestMapping("/logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
/**
* 获取用户的session用户信息
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Long id = (Long)request.getSession().getAttribute("userId");
XueshenghuichengyuanEntity user = xueshenghuichengyuanService.selectById(id);
return R.ok().put("data", user);
}
/**
* 密码重置
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
XueshenghuichengyuanEntity user = xueshenghuichengyuanService.selectOne(new EntityWrapper<XueshenghuichengyuanEntity>().eq("chengyuanzhanghao", username));
if(user==null) {
return R.error("账号不存在");
}
user.setMima("123456");
xueshenghuichengyuanService.updateById(user);
return R.ok("密码已重置为:123456");
}
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,XueshenghuichengyuanEntity xueshenghuichengyuan,
HttpServletRequest request){
EntityWrapper<XueshenghuichengyuanEntity> ew = new EntityWrapper<XueshenghuichengyuanEntity>();
PageUtils page = xueshenghuichengyuanService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xueshenghuichengyuan), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,XueshenghuichengyuanEntity xueshenghuichengyuan,
HttpServletRequest request){
EntityWrapper<XueshenghuichengyuanEntity> ew = new EntityWrapper<XueshenghuichengyuanEntity>();
PageUtils page = xueshenghuichengyuanService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xueshenghuichengyuan), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( XueshenghuichengyuanEntity xueshenghuichengyuan){
EntityWrapper<XueshenghuichengyuanEntity> ew = new EntityWrapper<XueshenghuichengyuanEntity>();
ew.allEq(MPUtil.allEQMapPre( xueshenghuichengyuan, "xueshenghuichengyuan"));
return R.ok().put("data", xueshenghuichengyuanService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(XueshenghuichengyuanEntity xueshenghuichengyuan){
EntityWrapper< XueshenghuichengyuanEntity> ew = new EntityWrapper< XueshenghuichengyuanEntity>();
ew.allEq(MPUtil.allEQMapPre( xueshenghuichengyuan, "xueshenghuichengyuan"));
XueshenghuichengyuanView xueshenghuichengyuanView = xueshenghuichengyuanService.selectView(ew);
return R.ok("查询学生会成员成功").put("data", xueshenghuichengyuanView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
XueshenghuichengyuanEntity xueshenghuichengyuan = xueshenghuichengyuanService.selectById(id);
return R.ok().put("data", xueshenghuichengyuan);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
XueshenghuichengyuanEntity xueshenghuichengyuan = xueshenghuichengyuanService.selectById(id);
return R.ok().put("data", xueshenghuichengyuan);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody XueshenghuichengyuanEntity xueshenghuichengyuan, HttpServletRequest request){
xueshenghuichengyuan.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(xueshenghuichengyuan);
XueshenghuichengyuanEntity user = xueshenghuichengyuanService.selectOne(new EntityWrapper<XueshenghuichengyuanEntity>().eq("chengyuanzhanghao", xueshenghuichengyuan.getChengyuanzhanghao()));
if(user!=null) {
return R.error("用户已存在");
}
xueshenghuichengyuan.setId(new Date().getTime());
xueshenghuichengyuanService.insert(xueshenghuichengyuan);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody XueshenghuichengyuanEntity xueshenghuichengyuan, HttpServletRequest request){
xueshenghuichengyuan.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(xueshenghuichengyuan);
XueshenghuichengyuanEntity user = xueshenghuichengyuanService.selectOne(new EntityWrapper<XueshenghuichengyuanEntity>().eq("chengyuanzhanghao", xueshenghuichengyuan.getChengyuanzhanghao()));
if(user!=null) {
return R.error("用户已存在");
}
xueshenghuichengyuan.setId(new Date(
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
Java学生会管理系统是一个基于Java开发的学生组织管理软件,旨在帮助学校或大学的学生会进行高效、便捷的管理工作。该系统提供了一系列功能模块,包括成员管理、活动管理、通知发布、财务管理等,以满足学生会各方面的需求。 系统主要包括以下几个核心功能模块: 成员管理:学生会成员信息的录入、修改和查询,包括学生姓名、班级、联系方式等。管理员可以轻松管理学生会成员名单,并对成员信息进行统计分析。 活动管理:学生会活动的发布、报名和签到等功能。学生会可以在系统中创建活动,并通过通知功能向成员发送活动邀请和提醒。成员可以在系统中报名参加活动,并通过二维码或签到表进行签到记录。 通知发布:学生会可以通过系统向成员发布通知、公告和重要消息,包括会议通知、活动通知、学术讲座等。成员可以及时查看通知内容,并提供反馈和回复。 财务管理:学生会财务收支的记录和统计分析。管理员可以在系统中录入学生会的收入和支出信息,系统会自动生成相应的财务报表,方便学生会进行财务管理和决策。 权限管理:系统提供不同级别的权限管理,包括管理员、干事和普通成员等角色。管理员可以对系统进行配置和管理,而普通成员只能查看相
资源推荐
资源详情
资源评论
收起资源包目录
Java学生会管理系统 (477个子文件)
3-build.bat 15B
2-run.bat 14B
1-install.bat 12B
.classpath 1KB
org.eclipse.wst.common.component 689B
org.eclipse.wst.jsdt.ui.superType.container 49B
bootstrap.css 143KB
bootstrap.min.css 118KB
glyphicons-halflings-regular.eot 20KB
.gitignore 10B
index.html 552B
favicon.ico 4KB
XueshenghuichengyuanController.java 10KB
TuanweilaoshiController.java 9KB
XueshengController.java 9KB
CommonController.java 8KB
TuanrihuodongController.java 8KB
XuefenzhengmingController.java 7KB
HuashishenqingController.java 7KB
ShijianbaomingController.java 7KB
ZhuchirenshenqingController.java 7KB
BaomingController.java 7KB
BumenwendangController.java 7KB
JiemuqingdanController.java 7KB
JingfeishenqingController.java 7KB
ShehuishijianController.java 7KB
JingfeifafangController.java 7KB
QingjiaController.java 7KB
HuodongController.java 7KB
WendangfenleiController.java 7KB
KaoqinController.java 7KB
BumenController.java 6KB
TuanrihuodongEntity.java 6KB
UserController.java 5KB
MPUtil.java 5KB
BaomingEntity.java 5KB
HuashishenqingEntity.java 5KB
TuanrihuodongModel.java 5KB
TuanrihuodongVO.java 5KB
HuodongEntity.java 4KB
JiemuqingdanEntity.java 4KB
JingfeishenqingEntity.java 4KB
XuefenzhengmingEntity.java 4KB
ShijianbaomingEntity.java 4KB
ZhuchirenshenqingEntity.java 4KB
BumenwendangEntity.java 4KB
QingjiaEntity.java 4KB
XueshenghuichengyuanEntity.java 4KB
XueshengEntity.java 4KB
BaomingModel.java 4KB
BaomingVO.java 4KB
ShehuishijianEntity.java 4KB
BaiduUtil.java 4KB
HuashishenqingModel.java 4KB
TuanweilaoshiEntity.java 4KB
JingfeifafangEntity.java 4KB
HuashishenqingVO.java 4KB
KaoqinEntity.java 3KB
HuodongModel.java 3KB
ConfigController.java 3KB
HuodongVO.java 3KB
AuthorizationInterceptor.java 3KB
QingjiaModel.java 3KB
BumenwendangModel.java 3KB
XuefenzhengmingModel.java 3KB
JiemuqingdanModel.java 3KB
ShijianbaomingModel.java 3KB
JingfeishenqingModel.java 3KB
QingjiaVO.java 3KB
BumenwendangVO.java 3KB
FileController.java 3KB
ZhuchirenshenqingModel.java 3KB
XuefenzhengmingVO.java 3KB
XueshengModel.java 3KB
JiemuqingdanVO.java 3KB
ShijianbaomingVO.java 3KB
JingfeishenqingVO.java 3KB
ZhuchirenshenqingVO.java 3KB
XueshenghuichengyuanModel.java 3KB
XueshengVO.java 3KB
Query.java 3KB
XueshenghuichengyuanVO.java 3KB
ShehuishijianModel.java 2KB
TokenServiceImpl.java 2KB
ShehuishijianVO.java 2KB
TuanweilaoshiModel.java 2KB
JingfeifafangModel.java 2KB
TuanweilaoshiVO.java 2KB
JingfeifafangVO.java 2KB
TokenEntity.java 2KB
XueshenghuichengyuanServiceImpl.java 2KB
ZhuchirenshenqingServiceImpl.java 2KB
WendangfenleiEntity.java 2KB
KaoqinModel.java 2KB
JingfeishenqingServiceImpl.java 2KB
XuefenzhengmingServiceImpl.java 2KB
ShijianbaomingServiceImpl.java 2KB
HuashishenqingServiceImpl.java 2KB
TuanrihuodongServiceImpl.java 2KB
WendangfenleiServiceImpl.java 2KB
共 477 条
- 1
- 2
- 3
- 4
- 5
资源评论
童小纯
- 粉丝: 3w+
- 资源: 289
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功