package foot.ball.controller;
import java.io.File;
import java.io.IOException;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import foot.ball.bean.Game;
import foot.ball.bean.Gif;
import foot.ball.bean.LiveWord;
import foot.ball.service.CodeService;
import foot.ball.service.GameService;
import foot.ball.service.GifService;
import foot.ball.service.LiveWordService;
import foot.ball.util.DateFormatUtil;
import foot.ball.util.UUIDUtil;
@Controller
public class GameController {
@Autowired
public GameService gameService;
@Autowired
public CodeService codeService;
@Autowired
public LiveWordService liveWordService;
@Autowired
public GifService gifService;
//赛事管理员页面显示比赛列表
@RequestMapping("/game/getAll.do")
public ModelAndView getAll(HttpServletRequest request){
ModelAndView mav = new ModelAndView();
List<Game> gameList = gameService.getAll();
for(int i=0;i<gameList.size();i++){
gameList.get(i).setGameType(codeService.getByCodeTypeAndCodeKey("gameType", gameList.get(i).getGameType()));
gameList.get(i).setGameState(codeService.getByCodeTypeAndCodeKey("gameState", gameList.get(i).getGameState()));
}
request.getSession().setAttribute("gameList", gameList);
mav.setViewName("manager/gameManager");
return mav;
}
//跳转至赛事添加页面
@RequestMapping("/game/toAdd.do")
public ModelAndView toAdd(HttpServletRequest request){
ModelAndView mav = new ModelAndView();
request.getSession().setAttribute("gameTypeList", codeService.getByCodeType("gameType"));
mav.setViewName("manager/addGame");
return mav;
}
//添加比赛
@RequestMapping("/game/addGame.do")
public String addGame(HttpServletRequest request){
Game game = new Game();
game.setGameId(UUIDUtil.getUUID());
game.setHomeTeam(request.getParameter("homeTeam"));
game.setGuestTeam(request.getParameter("guestTeam"));
game.setFumble("0");
game.setGoal("0");
game.setGameState("A");
game.setGameType(request.getParameter("gameType"));
String gameTime = request.getParameter("year")+"-"+request.getParameter("month")+"-"+
request.getParameter("day")+" "+request.getParameter("hour")+":"+request.getParameter("minute");
game.setGameTime(gameTime);
gameService.add(game);
return "redirect:/game/getAll.do";
}
//跳转赛事更新页
@RequestMapping("/game/toUpdate.do")
public ModelAndView toUpdate(HttpServletRequest request){
ModelAndView mav = new ModelAndView();
Game game = gameService.getById(request.getParameter("gameId"));
game.setGameState(codeService.getByCodeTypeAndCodeKey("gameState", game.getGameState()));
game.setGameType(codeService.getByCodeTypeAndCodeKey("gameType", game.getGameType()));
request.getSession().setAttribute("game", game);
mav.setViewName("manager/updateGame");
return mav;
}
//修改赛事
@RequestMapping("/game/updateGame.do")
public String update(HttpServletRequest request){
Game game = gameService.getById(request.getParameter("gameId"));
game.setGoal(request.getParameter("goal"));
game.setFumble(request.getParameter("fumble"));
gameService.update(game);
return "redirect:/game/getAll.do";
}
//删除比赛
@RequestMapping("/game/delete.do")
public String delete(HttpServletRequest request){
gameService.delete(request.getParameter("gameId"));
return "redirect:/game/getAll.do";
}
//管理员进入赛事直播页面
@RequestMapping("/game/toLive.do")
public ModelAndView toLive(HttpServletRequest request){
ModelAndView mav = new ModelAndView();
Game game = gameService.getById(request.getParameter("gameId"));
game.setGameType(codeService.getByCodeTypeAndCodeKey("gameType", game.getGameType()));
game.setGameState(codeService.getByCodeTypeAndCodeKey("gameState", game.getGameState()));
request.getSession().setAttribute("game",game);
mav.setViewName("manager/liveGame");
return mav;
}
//比赛开始
@RequestMapping("/game/ks.do")
public ModelAndView ks(HttpServletRequest request){
ModelAndView mav = new ModelAndView();
Game game = gameService.getById(request.getParameter("gameId"));
game.setGameState("B");
gameService.updateGameState(game);
Game game1 = gameService.getById(request.getParameter("gameId"));
game1.setGameType(codeService.getByCodeTypeAndCodeKey("gameType", game1.getGameType()));
game1.setGameState(codeService.getByCodeTypeAndCodeKey("gameState", game1.getGameState()));
request.getSession().setAttribute("game", game1);
mav.setViewName("manager/liveGame");
return mav;
}
//中场
@RequestMapping("/game/zc.do")
public ModelAndView zc(HttpServletRequest request){
ModelAndView mav = new ModelAndView();
Game game = gameService.getById(request.getParameter("gameId"));
game.setGameState("C");
gameService.updateGameState(game);
Game game1 = gameService.getById(request.getParameter("gameId"));
game1.setGameType(codeService.getByCodeTypeAndCodeKey("gameType", game1.getGameType()));
game1.setGameState(codeService.getByCodeTypeAndCodeKey("gameState", game1.getGameState()));
request.getSession().setAttribute("game", game1);
mav.setViewName("manager/liveGame");
return mav;
}
//下半场
@RequestMapping("/game/xbc.do")
public ModelAndView xbc(HttpServletRequest request){
ModelAndView mav = new ModelAndView();
Game game = gameService.getById(request.getParameter("gameId"));
game.setGameState("D");
gameService.updateGameState(game);
Game game1 = gameService.getById(request.getParameter("gameId"));
game1.setGameType(codeService.getByCodeTypeAndCodeKey("gameType", game1.getGameType()));
game1.setGameState(codeService.getByCodeTypeAndCodeKey("gameState", game1.getGameState()));
request.getSession().setAttribute("game", game1);
mav.setViewName("manager/liveGame");
return mav;
}
//结束
@RequestMapping("/game/js.do")
public String js(HttpServletRequest request){
Game game = gameService.getById(request.getParameter("gameId"));
game.setGameState("E");
gameService.updateGameState(game);
request.getSession().setAttribute("game", gameService.getById(request.getParameter("gameId")));
return "redirect:/game/getAll.do";
}
//进入图片直播
@RequestMapping("/game/ft.do")
public ModelAndView ft(HttpServletRequest request){
ModelAndView mav = new ModelAndView();
Game game = gameService.getById(request.getParameter("gameId"));
game.setGameType(codeService.getByCodeTypeAndCodeKey("gameType", game.getGameType()));
game.setGameState(codeService.getByCodeTypeAndCodeKey("gameState", game.getGameState()));
request.getSession().setAttribute("game",game);
mav.setViewName("manager/gifGame");
return mav;
}
//文字直播
@RequestMapping("/game/liveGame.do")
public ModelAndView liveGame(HttpServletRequest request){
ModelAndView mav = new ModelAndView();
LiveWord liveWord = new LiveWord();
liveWord.setGameId(request.getParameter("gameId"));
liveWord.setLiveId(UUIDUtil.getUUID());
liveWord.setLiveTime(DateFormatUtil.getDateAndTime());
liveWord.setLiveWord(request.getParameter("liveWord"));
liveWordService.add(liveWord);
mav.setViewName("manager/liveGame");
return mav;
}
//图片直播
@RequestMapping("/game/gifGame.do")
public String gifGame(HttpServletRequest request,MultipartFile gifFile) throws IllegalStateException, IOException{
Game game = gameService.getById(request.getParameter("gameId"));
game.setGameType(codeService.getByCodeTypeAndCodeKey("gameType", game.getGameType()));
game.setGameState(codeService.getBy
没有合适的资源?快使用搜索试试~ 我知道了~
毕业设计:基于JavaWeb的足球网平台设计.zip
共262个文件
jar:66个
jsp:54个
java:42个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 147 浏览量
2023-11-27
22:46:10
上传
评论
收藏 33.38MB ZIP 举报
温馨提示
1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 -------- 下载后请首先打开README.md文件(如有),仅供学习参考, 切勿用于商业用途。
资源推荐
资源详情
资源评论
收起资源包目录
毕业设计:基于JavaWeb的足球网平台设计.zip (262个子文件)
.classpath 4KB
org.eclipse.wst.common.component 563B
bootstrap.css 144KB
bootstrap.css 144KB
style.css 47KB
style.css 47KB
popuo-box.css 7KB
popuo-box.css 7KB
style1.css 2KB
style1.css 2KB
footballDaochu.dmp 1.46MB
.gitignore 59B
ojdbc8.jar 3.85MB
ojdbc8.jar 3.85MB
aspectjweaver-1.6.11.jar 1.61MB
aspectjweaver-1.6.11.jar 1.61MB
spring-web-5.0.3.RELEASE.jar 1.19MB
spring-web-5.0.3.RELEASE.jar 1.19MB
spring-core-5.0.3.RELEASE.jar 1.16MB
spring-core-5.0.3.RELEASE.jar 1.16MB
spring-context-5.0.3.RELEASE.jar 1.03MB
spring-context-5.0.3.RELEASE.jar 1.03MB
spring-webmvc-5.0.3.RELEASE.jar 765KB
spring-webmvc-5.0.3.RELEASE.jar 765KB
mybatis-3.2.7.jar 696KB
mybatis-3.2.7.jar 696KB
javassist-3.17.1-GA.jar 695KB
javassist-3.17.1-GA.jar 695KB
log4j-core-2.0-rc1.jar 686KB
log4j-core-2.0-rc1.jar 686KB
spring-beans-5.0.3.RELEASE.jar 640KB
spring-beans-5.0.3.RELEASE.jar 640KB
spring-test-5.0.3.RELEASE.jar 577KB
spring-test-5.0.3.RELEASE.jar 577KB
log4j-1.2.17.jar 478KB
log4j-1.2.17.jar 478KB
jstl-1.2.jar 405KB
jstl-1.2.jar 405KB
spring-jdbc-5.0.3.RELEASE.jar 382KB
spring-jdbc-5.0.3.RELEASE.jar 382KB
spring-aop-5.0.3.RELEASE.jar 352KB
spring-aop-5.0.3.RELEASE.jar 352KB
cglib-2.2.2.jar 280KB
cglib-2.2.2.jar 280KB
spring-expression-5.0.3.RELEASE.jar 257KB
spring-expression-5.0.3.RELEASE.jar 257KB
spring-tx-5.0.3.RELEASE.jar 243KB
spring-tx-5.0.3.RELEASE.jar 243KB
junit-4.9.jar 243KB
junit-4.9.jar 243KB
spring-orm-5.0.3.RELEASE.jar 181KB
spring-orm-5.0.3.RELEASE.jar 181KB
commons-io-2.4.jar 181KB
commons-io-2.4.jar 181KB
spring-context-support-5.0.3.RELEASE.jar 168KB
spring-context-support-5.0.3.RELEASE.jar 168KB
commons-dbcp-1.2.2.jar 119KB
commons-dbcp-1.2.2.jar 119KB
log4j-api-2.0-rc1.jar 113KB
log4j-api-2.0-rc1.jar 113KB
commons-pool-1.3.jar 61KB
commons-pool-1.3.jar 61KB
commons-logging-1.1.1.jar 59KB
commons-logging-1.1.1.jar 59KB
commons-fileupload-1.2.2.jar 58KB
commons-fileupload-1.2.2.jar 58KB
mybatis-spring-1.2.2.jar 48KB
mybatis-spring-1.2.2.jar 48KB
asm-3.3.1.jar 43KB
asm-3.3.1.jar 43KB
spring-aspects-5.0.3.RELEASE.jar 40KB
spring-aspects-5.0.3.RELEASE.jar 40KB
slf4j-api-1.7.5.jar 25KB
slf4j-api-1.7.5.jar 25KB
slf4j-log4j12-1.7.5.jar 9KB
slf4j-log4j12-1.7.5.jar 9KB
aopalliance-1.0.jar 4KB
aopalliance-1.0.jar 4KB
GameController.java 14KB
NewsController.java 10KB
UserController.java 8KB
ClubController.java 8KB
News.java 2KB
Club.java 2KB
Game.java 2KB
Comment.java 1KB
NewsServiceImpl.java 1KB
User.java 1KB
UserServiceImpl.java 1KB
GameServiceImpl.java 913B
Code.java 908B
LiveWord.java 904B
CodeServiceImpl.java 885B
Gif.java 867B
ClubServiceImpl.java 830B
LiveWordServiceImpl.java 807B
CommentServiceImpl.java 786B
GifServiceImpl.java 714B
UserMapper.java 541B
ForumController.java 512B
共 262 条
- 1
- 2
- 3
资源评论
程皮
- 粉丝: 279
- 资源: 2566
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Java语言实现养老院信息管理系统(SQL Server数据库)
- 社区居民诊疗健康-JAVA-基于SpringBoot的社区居民诊疗健康管理系统设计与实现(毕业论文)
- ChromeSetup.zip
- 大黄蜂V14旋翼机3D
- 体育购物商城-JAVA-基于springboot的体育购物商城设计与实现(毕业论文)
- 三保一评关系与区别分析
- 星形发动机3D 星形发动机
- 机考样例(学生).zip
- Day-05 Vue22222222222
- 经过数据增强后番茄叶片病害识别,约45000张数据,已标注
- 商用密码技术及产品介绍
- CC2530无线zigbee裸机代码实现WIFI ESP8266上传数据到服务器.zip
- 文物管理系统-JAVA-基于springboot的文物管理系统的设计与实现(毕业论文)
- 店铺数据采集系统项目全套技术资料.zip
- 数据安全基础介绍;数据安全概念
- 目标检测数据集: 果树上的tomato西红柿图像检测数据【VOC标注格式、包含数据和标签】
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功