package com.scs.web.peopleInfo;
import com.scs.po.Activity;
import com.scs.po.Club;
import com.scs.po.New;
import com.scs.service.ActivityService;
import com.scs.service.ClubService;
import com.scs.service.NewService;
import com.scs.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.web.PageableDefault;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import javax.servlet.http.HttpSession;
import java.util.Date;
import java.util.List;
@Controller
@RequestMapping("/peopleInfo/clubManager")
public class MyclubController {
@Autowired
private UserService userService;
@Autowired
private ActivityService activityService;
@Autowired
private NewService newService;
@Autowired
private ClubService clubService;
private Long getClubId(HttpSession httpSession){
List<Club> myclub = (List<Club>) httpSession.getAttribute("myclub");
return myclub.get(0).getId();
}
@GetMapping("/members")
public String members(@PageableDefault(size = 10,sort = {"grade"},direction = Sort.Direction.ASC) Pageable pageable,
HttpSession httpSession, Model model){
Long myClubId = getClubId(httpSession);
model.addAttribute("page",userService.getUsersByClubId(myClubId,pageable));
return "peopleInfo/clubManager/members";
}
@GetMapping("/members/{userid}/delete")
public String deleteMember(@PathVariable Long userid,RedirectAttributes attributes,HttpSession httpSession){
Long clubId = getClubId(httpSession);
clubService.removeUser(userid,clubId);
attributes.addFlashAttribute("message","操作成功!");
return "redirect:/peopleInfo/clubManager/members";
}
@GetMapping("/activitys")
public String activitys(@PageableDefault(size = 1,sort = {"activitytime"},direction = Sort.Direction.DESC) Pageable pageable,
HttpSession httpSession, Model model){
Long myClubId = getClubId(httpSession);
model.addAttribute("page",activityService.listActivitiesByClubId(myClubId,pageable));
return "peopleInfo/clubManager/activitys";
}
@GetMapping("/activity-input")
public String activity(Model model){
model.addAttribute("activity",new Activity());
return "peopleInfo/clubManager/activity-input";
}
@PostMapping("/activity/input")
public String activityInput(@ModelAttribute Activity activity , RedirectAttributes attributes, HttpSession httpSession){
Long clubId = getClubId(httpSession);
activity.setClub(clubService.getClubByClubId(clubId));
Activity a;
a= activityService.saveActivity(activity);
if (a == null) {
attributes.addFlashAttribute("message","操作失败");
}else {
attributes.addFlashAttribute("message","操作成功");
}
return "redirect:/peopleInfo/clubManager/activitys";
}
@GetMapping("/activity/{id}")
public String activityEdit(@PathVariable Long id,Model model){
model.addAttribute("activity",activityService.getActivity(id));
return "peopleInfo/clubManager/activity-input";
}
@GetMapping("/activity/{id}/delete")
public String activityDelete(@PathVariable Long id ,RedirectAttributes attributes){
activityService.deleteActivity(id);
attributes.addFlashAttribute("message","操作成功");
return "redirect:/peopleInfo/clubManager/activitys";
}
@GetMapping("/news")
public String news(@PageableDefault(size = 1,sort = {"publishtime"},direction = Sort.Direction.DESC) Pageable pageable,
HttpSession httpSession, Model model){
Long myClubId = getClubId(httpSession);
model.addAttribute("page",newService.listNewsByClubId(myClubId,pageable));
return "peopleInfo/clubManager/news";
}
@GetMapping("/new-input")
public String newInput(Model model){
model.addAttribute("mynew",new New());
return "peopleInfo/clubManager/new-input";
}
@PostMapping("/new/input")
public String newInput(@ModelAttribute New mynew , RedirectAttributes attributes, HttpSession httpSession){
Long clubId = getClubId(httpSession);
mynew.setClub(clubService.getClubByClubId(clubId));
New a;
a= newService.saveNew(mynew);
if (a == null) {
attributes.addFlashAttribute("message","操作失败");
}else {
attributes.addFlashAttribute("message","操作成功");
}
return "redirect:/peopleInfo/clubManager/news";
}
@GetMapping("/new/{id}")
public String newEdit(@PathVariable Long id,Model model){
model.addAttribute("mynew",newService.getActivity(id));
return "peopleInfo/clubManager/new-input";
}
@GetMapping("/new/{id}/delete")
public String newDelete(@PathVariable Long id ,RedirectAttributes attributes){
newService.deleteActivity(id);
attributes.addFlashAttribute("message","操作成功");
return "redirect:/peopleInfo/clubManager/news";
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
基于SpringBoot的社团管理系统.zip
共574个文件
js:195个
html:125个
xml:96个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 126 浏览量
2023-06-27
11:20:07
上传
评论
收藏 13.18MB ZIP 举报
温馨提示
本资源中的源码都是经过本地编译过可运行的,下载后按照文档配置好环境就可以运行。资源项目的难度比较适中,内容都是经过助教老师审定过的,应该能够满足学习、使用需求,如果有需要的话可以放心下载使用。有任何问题也可以随时私信博主,博主会第一时间给您解答!!! 本资源中的源码都是经过本地编译过可运行的,下载后按照文档配置好环境就可以运行。资源项目的难度比较适中,内容都是经过助教老师审定过的,应该能够满足学习、使用需求,如果有需要的话可以放心下载使用。有任何问题也可以随时私信博主,博主会第一时间给您解答!!! 本资源中的源码都是经过本地编译过可运行的,下载后按照文档配置好环境就可以运行。资源项目的难度比较适中,内容都是经过助教老师审定过的,应该能够满足学习、使用需求,如果有需要的话可以放心下载使用。有任何问题也可以随时私信博主,博主会第一时间给您解答!!!
资源推荐
资源详情
资源评论
收起资源包目录
基于SpringBoot的社团管理系统.zip (574个子文件)
AUTHORS 6KB
bootstrap.min.css 138KB
editormd.css 76KB
animate.css 68KB
editormd.min.css 60KB
editormd.preview.css 55KB
editormd.preview.min.css 44KB
main.css 42KB
ambiance.css 26KB
line-icons.css 14KB
responsive.css 8KB
codemirror.css 8KB
magnific-popup.css 7KB
nivo-lightbox.css 6KB
codemirror.min.css 5KB
mdn-like.css 5KB
solarized.css 5KB
menu_sideslide.css 4KB
merge.css 3KB
me.css 3KB
lint.css 3KB
xq-dark.css 3KB
owl.carousel.css 2KB
lesser-dark.css 2KB
pastel-on-dark.css 2KB
xq-light.css 2KB
tomorrow-night-eighties.css 2KB
editormd.logo.css 2KB
erlang-dark.css 2KB
zenburn.css 2KB
twilight.css 2KB
midnight.css 2KB
vibrant-ink.css 2KB
mbo.css 2KB
base16-dark.css 2KB
base16-light.css 2KB
tern.css 2KB
3024-night.css 2KB
paraiso-dark.css 2KB
paraiso-light.css 2KB
tomorrow-night-bright.css 2KB
3024-day.css 2KB
blackboard.css 2KB
colorforth.css 2KB
owl.theme.css 2KB
editormd.logo.min.css 2KB
the-matrix.css 2KB
night.css 2KB
rubyblue.css 2KB
monokai.css 1KB
cobalt.css 1KB
simplescrollbars.css 1KB
eclipse.css 1KB
neo.css 932B
elegant.css 768B
neat.css 693B
show-hint.css 662B
qi.css 575B
dialog.css 502B
tiki.css 440B
foldgutter.css 435B
tiddlywiki.css 220B
matchesonscrollbar.css 188B
fullscreen.css 116B
ambiance-mobile.css 103B
LineIcons.eot 99KB
fontawesome-webfont.eot 59KB
editormd-logo.eot 1KB
loading@3x.gif 21KB
loading@2x.gif 16KB
loading.gif 8KB
.gitignore 117B
.gitignore 32B
scala.html 28KB
activity.html 24KB
new.html 24KB
club.html 23KB
index.html 22KB
index.html 17KB
index.html 17KB
index.html 13KB
index.html 13KB
index.html 11KB
index.html 10KB
index.html 9KB
news.html 9KB
register.html 9KB
members.html 9KB
index.html 8KB
info.html 8KB
activity-input.html 8KB
index.html 8KB
allNews.html 7KB
club-create.html 7KB
joinActivities.html 7KB
index.html 7KB
index.html 7KB
login.html 6KB
allClubs.html 6KB
index.html 6KB
共 574 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
白话机器学习
- 粉丝: 1w+
- 资源: 7671
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- (源码)基于ROS的eDVS转速测量系统.zip
- DU562音频处理芯片-音频音效解决方案
- (源码)基于Spring Boot和Apache Shiro的权限管理系统.zip
- JAVA的SpringBoot2前后端分离单商户B2C商城源码数据库 MySQL源码类型 WebForm
- (源码)基于C++插件开发框架的QQBot插件系统.zip
- (源码)基于Spring Boot框架的酒店管理系统.zip
- Vue.js框架入门与高级特性详解及应用实践.pdf
- 自定义精简版dubbo,运用spring自定义标签、netty、zookeeper、ImportBeanDefinition实现
- (源码)基于Arduino和NodeRed的智能村落监控系统.zip
- 【java毕业设计】SpringBoot+Vue毕业设计论文管理系统 源码+sql脚本+论文 完整版
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功