Compare commits

..

201 Commits

Author SHA1 Message Date
王壕 d909ce3be9 finally
3 years ago
王壕 8c679a7136 finally
3 years ago
王壕 75f618ba1a two
3 years ago
王壕 b72b6e7b9f one
3 years ago
王壕 d8d45ccf58 finallysrc
3 years ago
王壕 68c93ed5c4 1
3 years ago
王壕 ec30014e3a finally
3 years ago
王壕 b272217c86 latest
3 years ago
puhw8ejfm c3aee13020 Merge pull request '1.0' (#8) from develop into master
3 years ago
王壕 eebfa3cec5 13
3 years ago
王壕 1eb8e22332 Merge remote-tracking branch 'remotes/origin/王西霖.branch' into develop
3 years ago
王壕 7a82f2c89b Merge branch 'wyd_branch' into develop
3 years ago
王壕 34d081e868 Merge branch 'develop' into wsy_branch
3 years ago
王壕 664b4f70f2 Merge branch 'GYZ_branch' into develop
3 years ago
王壕 70a163d5cd Merge branch 'wangh_branch' into develop
3 years ago
王壕 29ea96a615 1
3 years ago
王壕 b4c3a71748 1
3 years ago
王壕 e058388cb3 wh
3 years ago
王壕 ea634a674c wxl
3 years ago
王壕 9be82fb13b wsy
3 years ago
王壕 85ea1cb4ee wxy
3 years ago
王壕 c1452783df wyd
3 years ago
王壕 2162d632bb wyd
3 years ago
王壕 0a867b0480 wxl
3 years ago
王壕 3719f76121 wxl
3 years ago
王壕 919bd2ccc1 wangh
3 years ago
王壕 0ca9f71446 wangh
3 years ago
wxLin 814d52eb5c 1111
3 years ago
王壕 6b78674dab jielong'
3 years ago
wangsiyu 8f4aaf384d 模版doc
3 years ago
wangsiyu ac8ea4b4b5 1
3 years ago
Your Name 50503c0cc7 时序图与用例描述对应
3 years ago
Your Name d66f9d5e42 用例描述11/18更新
3 years ago
王壕 38d80d8b32 数据模型.png
3 years ago
wxLin b9c802a40a 1111
3 years ago
王壕 a0a09f5ead update
3 years ago
wxLin fbb20a36bc 11111
3 years ago
wangsiyu 157bd0eb48 文档模版
3 years ago
wangsiyu 3049ca2a44 文档模版
3 years ago
wxLin 717727b70a 1111
3 years ago
wxLin c8079e9baa 1111
3 years ago
Your Name 38ed0ba9dc 无验证码
3 years ago
王壕 2477915abe kirito 1.0.1
3 years ago
王壕 0429442a80 修改
3 years ago
王壕 e4670a4379 kirito 1.0.0
3 years ago
wxLin 1f5918e81b 第一次修改
3 years ago
Your Name c6668a0e14 增加登录区分用户和管理员功能,同时设置用户权限
3 years ago
王壕 b9d71363fe kirito 1.0.0
3 years ago
王壕 1be5703c90 kirito 1.0.0
3 years ago
wxLin 1ef8c46760 00
3 years ago
王壕 415b87ee77 shangchuan
3 years ago
Your Name 57682e78bc 修改依赖以及配置
3 years ago
王壕 af575aa2d4 Merge branch '王西霖.branch' into wangh_branch
3 years ago
王壕 35fd05457e Merge remote-tracking branch 'origin/wangh_branch' into wangh_branch
3 years ago
王壕 99c41f6cf3 shangchuan
3 years ago
王壕 d21056fdcb Merge remote-tracking branch 'remotes/origin/王西霖.branch' into wangh_branch
3 years ago
wxLin b83ac8008c Merge branch 'wsy_branch' into 王西霖.branch
3 years ago
wxLin 06790aeb4f 111
3 years ago
JoeyG b5d2602192 123
3 years ago
Your Name 5087a09c70 调整文件发布及在进度页面显示问题
3 years ago
Your Name ea67192ba8 调整界面更新问题
3 years ago
Your Name 69dd1db0b7 调整任务提交无法打开问题
3 years ago
Your Name f41fd9dc5e 调整用户绑定问题
3 years ago
Your Name 1d0d12b1f6 重做3.0
3 years ago
王壕 fc72af05ab fali
3 years ago
王壕 dbaaa0459c test wx minigram/.eslintrc.js
3 years ago
王壕 5f8cedc18d shangchuan
3 years ago
wxLin b28a786e70 任务提交部分代码
3 years ago
wxLin f997737018 111
3 years ago
Your Name 3ceaf3a189 用户绑定
3 years ago
王壕 d8cb47d9e3 1
3 years ago
Your Name 352f14e5df +
3 years ago
王壕 a4dcc40d60 1
3 years ago
Your Name a5e145d9d2 班级通2.0.zip
3 years ago
wxLin b65073ba33 111
3 years ago
wsy 9efdd1e20d 用例模型10.11
3 years ago
Your Name abbe1178a3 1
3 years ago
王壕 971b9c3338 1
3 years ago
wxLin a547c2715a 111
3 years ago
wsy 4f657e45d9 修改了
3 years ago
王壕 5da4f99707 数据模型.png
3 years ago
wxLin b0e177f4f5 我尽力了
3 years ago
wxLin 0c2ae9f649 初版,明天再更新一下具体的变量内容
3 years ago
王壕 d8a155e1f1 1
3 years ago
Your Name 8fa2d90747 11
3 years ago
王壕 f653b17853 ControllerText.java
3 years ago
Your Name 2e02b734d2 班级通
3 years ago
Your Name a2c22401f1 数据统计部分已更改
3 years ago
Your Name d1df15b0e9 时序图已替换
3 years ago
Your Name 8fed3b9e85 时序图已更新
3 years ago
Your Name 778b293d9c Merge branch 'wsy_branch' of https://bdgit.educoder.net/puhw8ejfm/project into wsy_branch
3 years ago
Your Name 5d5ae65e90 已修改
3 years ago
wxLin 8cd13ba58c 大家加油
3 years ago
王壕 c4f35b70b4 web/.gitignore
3 years ago
wsy 836a980e41 二阶段修改意见
3 years ago
Your Name 0ed49c92e8 1
3 years ago
王壕 e102b549e2 1`
3 years ago
王壕 0a9748a208 为User类添加学号,权限,姓名属性,方便用户绑定
3 years ago
王壕 730d2ba4e0 Merge branch 'wangh_branch' of https://bdgit.educoder.net/puhw8ejfm/project into wangh_branch
3 years ago
王壕 59f55fdb9a 新增springdoc
3 years ago
wxLin e61c5390c7 111
3 years ago
王壕 a3e85432cc 新增springdoc
3 years ago
王壕 2c15d4f95b 111
3 years ago
王壕 e9bd79b231 code
3 years ago
王壕 f556daac82 wx
3 years ago
Your Name 709a700480 界面
3 years ago
王壕 7608cd12ef 初始框架
3 years ago
王壕 e5623802a5 test/java/com/example/demo/DemoApplicationTests.java
3 years ago
王壕 19f76a8ccb test
3 years ago
王壕 8cd6f9b706 体系结构模型
3 years ago
王壕 34ae96c9ae 需求模型
3 years ago
王壕 18b67bee21 Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
王壕 1f50b3e7f7 需求模型
3 years ago
王壕 d862860a53 需求模型
3 years ago
王壕 41a5679270 1
3 years ago
王壕 772c01be2b 1
3 years ago
wsy 9521290293 Merge branch 'master' of https://bdgit.educoder.net/puhw8ejfm/project into wsy_branch
3 years ago
王壕 d6d8d32e28 Merge branch 'GYZ_branch' into develop
3 years ago
wxLin 2ba819be78 Merge branch '王西霖.branch' of https://bdgit.educoder.net/puhw8ejfm/project into 王西霖.branch
3 years ago
wxLin dc446e47bf 3333
3 years ago
JoeyG 81e70ad5b9 逻辑视图
3 years ago
王壕 417a01c6d6 Merge branch 'wsy_branch' into develop
3 years ago
王壕 9e89549a8a Merge branch 'wyd_branch' into develop
3 years ago
王壕 01c9ce6449 Merge remote-tracking branch 'remotes/origin/王西霖.branch' into develop
3 years ago
王壕 f8d0dc6086 Merge remote-tracking branch 'remotes/origin/GYZ_branch' into develop
3 years ago
王壕 f554e4ec9a Merge branch 'GYZ_branch' into develop
3 years ago
wxLin 4dfcfac342 333
3 years ago
wsy 8426685d9c 已修改
3 years ago
Your Name b5594cef54 11
3 years ago
wsy 2d7111a9e9 一轮修改意见
3 years ago
wsy f6a78f468e 用户界面流顺序图
3 years ago
wxLin 1e2796bbed 222
3 years ago
wxLin 8f15946848 222
3 years ago
wxLin 3c48e67587 111
3 years ago
Your Name 8750954d69 2
3 years ago
Your Name 023f86d2db 1
3 years ago
Your Name 24fab9bbbf 增加登录界面
3 years ago
wxLin 07a9b3534f 111
3 years ago
wxLin 524caa1bcc 11更新了
3 years ago
Your Name c65fcd8cde 界面图
3 years ago
王壕 72f1398aa9 开发视图.png
3 years ago
Your Name 5bc204c4e4 design
3 years ago
Your Name 9cee3d7e99 design
3 years ago
wsy dc3a9e8305 试试
3 years ago
wxLin 34c674ead5 时序图已经更新好了
3 years ago
王壕 3b2850a040 Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
王壕 69e29ade54 Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
wsy 8e118496ef 把矩形删了,格式调了调,还没加<<extend>>关系,等用例描述完善后,再加
3 years ago
wsy 474d6dd9d7 Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
wsy 198a4c73d1 把接口删了 用例图不应该出现接口
3 years ago
wxLin 2855be6777 Merge branch '王西霖.branch' of https://bdgit.educoder.net/puhw8ejfm/project into 王西霖.branch
3 years ago
wxLin 297c481571 1
3 years ago
王壕 0454f42f94 Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
王壕 d48db6aebe Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
puhw8ejfm d88c643d7a Update 软件需求模型.md
3 years ago
王壕 7529749c50 Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
王壕 dffc1844a3 Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
王壕 abdd21c4a6 Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
wsy a2a9356db3 Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
wsy 91322f90c8 Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
wsy dccdb5f666 用例图
3 years ago
王壕 a4693a07b4 Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
王壕 e827eb90b6 Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
王壕 c1c9ac2f2f Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
王壕 53089383d1 Merge branch 'GYZ_branch' into develop
3 years ago
puhw8ejfm 8df47db160 Merge pull request 'test' (#5) from GYZ_branch into develop
3 years ago
puhw8ejfm 12e86728de Update 软件需求模型.md
3 years ago
王壕 dde9f2809a 2
3 years ago
王壕 9409ffe58f Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
王壕 7c2a600831 Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
王壕 3ff206144b Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
王壕 a5daee9230 Merge remote-tracking branch 'remotes/origin/王西霖.branch' into develop
3 years ago
王壕 f1b23ff8a1 Merge remote-tracking branch 'remotes/origin/王西霖.branch' into develop
3 years ago
王壕 0a35ea42c3 Merge branch '王西霖.branch' of https://bdgit.educoder.net/puhw8ejfm/project into 王西霖.branch
3 years ago
wxLin 9729e9a554 Merge branch '王西霖.branch' of https://bdgit.educoder.net/puhw8ejfm/project into 王西霖.branch
3 years ago
wxLin 5731625fd5 Merge branch '王西霖.branch' of https://bdgit.educoder.net/puhw8ejfm/project into 王西霖.branch
3 years ago
wxLin 2508356745 Signed-off-by: wxLin <908127472@qq.com>
3 years ago
puhw8ejfm f17f8168bc Delete 'demo.py'
3 years ago
王壕 01abbacc4d 1
3 years ago
王壕 0de209cd44 Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
王壕 f46d7d69b1 Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
王壕 8d9efb721e Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
Your Name ff93918445 Merge branch 'wyd_branch' into develop
3 years ago
wsy 95ede9da6d 1
3 years ago
Your Name 6364d45ffa Merge branch 'wyd_branch' into develop
3 years ago
Your Name a0fc9ac7dc Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
王壕 04c1d61063 Squashed commit of the following:
3 years ago
王壕 1a91633546 test
3 years ago
Your Name ec2a8d21c4 Merge branch 'wyd_branch' into develop
3 years ago
Your Name ffad823f75 demo1
3 years ago
Your Name 5378b74451 erge branch 'wyd_branch' into develop
3 years ago
王壕 8b4d7508c2 Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
王壕 e6f45b0f10 Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
王壕 ebc6bc86f4 Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
王壕 047bf6f33a Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
王壕 634fdf842a Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
王壕 98b5b3e521 Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
王壕 b0a6c9f3aa Merge branch 'develop' of https://bdgit.educoder.net/puhw8ejfm/project into develop
3 years ago
王壕 06e482c538 test1
3 years ago
王壕 78c2d7964e 1
3 years ago
王壕 f1fb535cc0 new
3 years ago

@ -1,2 +1,26 @@
# project
# 班级通软件系统
本项目是Springboot+web端+小程序端的一个帮助班级管理, 方便班委操作的软件系统。
### 说明代码审计工具不能正确识别小程序的代码量我们实际编写的代码量应该是后端3200行左右+小程序端2000行左右不包含开源框架代码
## 相关文件介绍
-doc文件夹存放的是软件设计和开发过程中的系统相关文档
-model 存放软件设计过程中的UML模型
-src存放软件源代码包括后端和web端源代码classhelper小程序端源码minigram和mysql数据库配置文件script.sql
-other存放汇报PPT和自评报告
## 软件配置环境
后端要求JDK1.8
mysql要求版本5.7以上
小程序端使用微信开发者平台即可

@ -1,290 +0,0 @@
# 软件需求模型
**(用例描述交互和性能缺失)**
## 一、用例图
![image-20220927130526005](..\model\image-20220927130526005.png)
## 二、用例分析及时序图
性能要求要求系统能满足100个人同时使用页面反应时间不能超过6秒
### 1.用例描述:账户登录
业务目标:管理员或用户登录
执行者:用户
前置条件:微信开放平台返回凭证信息
后置条件:记录并绑定用户登录凭证
基本动作序列:
\1. 用户打开登录界面
\2. 申请微信登录授权
\3. 微信开放平台验证信息
\4. 系统显示登录界面
5后台数据保存数据
拓展交互动作序列:
a1.用户或管理员登录web端
a2.系统显示登录页面
a3.用户或管理员扫描二维码进行登录
a4.微信端进行确认
![登录.drawio](model/登录.drawio.png)
### 2.用例描述:用户绑定
业务目标:用户微信绑定个人信息
执行者:用户
前置条件:用户已注册
后置条件:保存用户信息
基本动作序列:
\1. 用户填写学号和姓名
\2. 系统验证信息
\3. 保存用户信息
拓展交互动作序列:
a1.用户学号有重复现象,系统显示输入错误
a2.用户选择重新输入,系统显示绑定界面
a3.系统将所输入的信息存入数据库
![用户绑定.drawio](model/用户绑定.drawio.png)
### 3.用例描述:发布任务
业务目标:管理员发布常规任务
执行者:管理员
前置条件:管理员登录
后置条件:任务发送完毕,系统有记录和显示
基本动作序列:
\1. 老师请求发布任务
\2. 系统显示发布任务界面
\3. 系统请求管理员输入预发布任务
\4. 系统显示发布的任务
拓展交互动作序列:
a1.任务提交时间已过期
a2.管理员选择重新发布任务
a3.系统显示任务成功发布
![发布任务.drawio](model/发布任务.drawio.png)
### 4.用例描述:消息管理
业务目标:管理员查看用户任务完成情况,用户查询管理员发布的任务
执行者:管理员用户
前置条件:用户和管理员已登录
后置条件:系统成功显示任务信息
基本动作序列:
\1. 管理员和用户查看任务信息
\2. 系统显示所查询任务
\3. 管理员和用户查询某项任务明细
\4. 系统显示该信息进度和明细
拓展交互动作序列:
A. 执行者是用户
a1.用户查看管理员发布的任务、通知
a2.系统显示该学生查询内容
B. 执行者是管理员
b1.管理员查询用户上传任务情况
b2.系统显示用户上传任务情况
b3.管理员请求删除已过时信息
b4.系统显示已删除过时信息
![消息管理.drawio](model/消息管理.drawio.png)
### 5.用例描述:任务提交
业务目标:用户和管理员发布提交任务
执行者:用户 管理员
前置条件:用于已完成任务
后置条件:用户提交后,系统数据库存储文件
基本动作序列:
\1. 学生登录系统
\2. 学生完成任务
\3. 学生点击上传按钮
\4. 系统显示上传结果菜单
\5. 成功上传文件
拓展交互动作序列:
a1.学生未按时提交实验结果
a2.系统提示已过期
![任务提交.drawio](model/任务提交.drawio.png)
### 6.用例描述:成员管理
业务目标:管理员增加删除新管理员和用户
执行者:管理员
前置条件:管理员登录认证
后置条件:系统记录管理员信息
基本动作序列:
管理员输入 ID ,密码,登陆系统。
1.管理员登录系统
2.系统显示管理员控制界面。
3.管理员点击控制界面的“添加管理员”按钮。
4.系统弹出添加管理员界面。
5.管理员输入新管理员 ID 。
6.管理员点击添加新管理员界面上的“确认添加”按钮,添加管理员界面关闭,新管理员添加成功。
拓展交互动作序列:
A.添加的管理员 ID 已经存在。
B.系统显示输入错误
C.管理员重新输入
D.系统保存管理员信息
![成员管理.drawio](model/成员管理.drawio.png)
### 7.用例描述:接龙
业务目标:管理员发布接龙,用户点击接龙按钮即可完成接龙
执行者:管理员用户
前置条件:用户和管理员已登录
后置条件:系统保存接龙信息
基本动作序列:
1.管理员登录系统
2.管理员发布接龙
3.用户登录系统
4.用户点击接龙按钮
5.系统根据用户绑定ID填入接龙表格完成接龙
拓展交互动作序列:
1A. 管理员点击导出
1B. 系统将接龙以excel表格导出
![接龙.drawio](model/接龙.drawio.png)
### 8.用例描述:后台管理
业务目标:管理员管理员查看用户进度,和导出任务文件
执行者:管理员
前置条件:管理员已登录认证
后置条件:系统保存和导出任务文件
基本动作序列:
1.管理员登录系统
2.管理员点击查看进度按钮
3.系统显示任务进度和明细
4.管理员点击导出文件
5.系统将文件导出
拓展交互动作序列:
a1.管理员点击查看进度
a2.系统显示完成任务进度
a3.管理员在未完成任务人员界面点击提醒
a4.系统通过弹窗对未完成任务人员进行提醒
![后台管理.drawio](model/后台管理.drawio.png)
## 三、分析类图
![分析类图2](model/分析类图2.png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -2,6 +2,18 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<profiles>
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<sonar.host.url>http://127.0.0.1:9000</sonar.host.url>
</properties>
</profile>
</profiles>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>

@ -0,0 +1,107 @@
package com.example.demo.common;
/**
* @Description:
*
*
*
* 200
* 500msg
* 501beanmap
* 502token
* 555
*/
public class GlobalResult {
// 响应业务状态
private Integer status;
// 响应消息
private String msg;
// 响应中的数据
private Object data;
private String ok; // 不使用
public static GlobalResult build(Integer status, String msg, Object data) {
return new GlobalResult(status, msg, data);
}
public static GlobalResult ok(Object data) {
return new GlobalResult(data);
}
public static GlobalResult ok() {
return new GlobalResult(null);
}
public static GlobalResult errorMsg(String msg) {
return new GlobalResult(500, msg, null);
}
public static GlobalResult errorMap(Object data) {
return new GlobalResult(501, "error", data);
}
public static GlobalResult errorTokenMsg(String msg) {
return new GlobalResult(502, msg, null);
}
public static GlobalResult errorException(String msg) {
return new GlobalResult(555, msg, null);
}
public GlobalResult() {
}
public GlobalResult(Integer status, String msg, Object data) {
this.status = status;
this.msg = msg;
this.data = data;
}
public GlobalResult(Object data) {
this.status = 200;
this.msg = "OK";
this.data = data;
}
public Boolean isOK() {
return this.status == 200;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
public String getOk() {
return ok;
}
public void setOk(String ok) {
this.ok = ok;
}
}

@ -0,0 +1,135 @@
package com.example.demo.common;
import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class HttpClientUtil {
public static String doGet(String url, Map<String, String> param) {
// 创建Httpclient对象
CloseableHttpClient httpclient = HttpClients.createDefault();
String resultString = "";
CloseableHttpResponse response = null;
try {
// 创建uri
URIBuilder builder = new URIBuilder(url);
if (param != null) {
for (String key : param.keySet()) {
builder.addParameter(key, param.get(key));
}
}
URI uri = builder.build();
// 创建http GET请求
HttpGet httpGet = new HttpGet(uri);
// 执行请求
response = httpclient.execute(httpGet);
// 判断返回状态是否为200
if (response.getStatusLine().getStatusCode() == 200) {
resultString = EntityUtils.toString(response.getEntity(), "UTF-8");
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (response != null) {
response.close();
}
httpclient.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return resultString;
}
public static String doGet(String url) {
return doGet(url, null);
}
public static String doPost(String url, Map<String, String> param) {
// 创建Httpclient对象
CloseableHttpClient httpClient = HttpClients.createDefault();
CloseableHttpResponse response = null;
String resultString = "";
try {
// 创建Http Post请求
HttpPost httpPost = new HttpPost(url);
// 创建参数列表
if (param != null) {
List<NameValuePair> paramList = new ArrayList<>();
for (String key : param.keySet()) {
paramList.add(new BasicNameValuePair(key, param.get(key)));
}
// 模拟表单
UrlEncodedFormEntity entity = new UrlEncodedFormEntity(paramList);
httpPost.setEntity(entity);
}
// 执行http请求
response = httpClient.execute(httpPost);
resultString = EntityUtils.toString(response.getEntity(), "utf-8");
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
response.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return resultString;
}
public static String doPost(String url) {
return doPost(url, null);
}
public static String doPostJson(String url, String json) {
// 创建Httpclient对象
CloseableHttpClient httpClient = HttpClients.createDefault();
CloseableHttpResponse response = null;
String resultString = "";
try {
// 创建Http Post请求
HttpPost httpPost = new HttpPost(url);
// 创建请求内容
StringEntity entity = new StringEntity(json, ContentType.APPLICATION_JSON);
httpPost.setEntity(entity);
// 执行http请求
response = httpClient.execute(httpPost);
resultString = EntityUtils.toString(response.getEntity(), "utf-8");
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
response.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return resultString;
}
}

@ -0,0 +1,73 @@
package com.example.demo.common;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
import java.util.Map;
public class HttpGetUtil {
public static String httpRequestToString(String url,
Map params, String type) {
String result = null;
try {
InputStream is = httpRequestToStream(url, params, type);
BufferedReader in = new BufferedReader(new InputStreamReader(is,
"UTF-8"));
StringBuffer buffer = new StringBuffer();
String line = "";
while ((line = in.readLine()) != null) {
buffer.append(line);
}
result = buffer.toString();
} catch (Exception e) {
return null;
}
System.out.println(result);
return result;
}
private static InputStream httpRequestToStream(String url,
Map params, String type) {
InputStream is = null;
try {
String parameters = "";
boolean hasParams = false;
for (Object key : params.keySet()) {
String value = URLEncoder.encode((String) params.get(key), "UTF-8");
parameters += key + "=" + value + "&";
hasParams = true;
}
if (hasParams) {
parameters = parameters.substring(0, parameters.length()-1);
}
url += "?"+ parameters;
System.out.println(url);
URL u = new URL(url);
HttpURLConnection conn = (HttpURLConnection) u.openConnection();
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setRequestProperty("Accept-Charset", "UTF-8");
conn.setRequestProperty("contentType", "utf-8");
conn.setConnectTimeout(50000);
conn.setReadTimeout(50000);
conn.setDoInput(true);
//设置请求方式默认为GET
conn.setRequestMethod(type);
is = conn.getInputStream();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return is;
}
}

@ -0,0 +1,4 @@
package com.example.demo.common;
public class UploadFileTool {
}

@ -0,0 +1,69 @@
package com.example.demo.common;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.shiro.codec.Base64;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.security.AlgorithmParameters;
import java.security.Security;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
public class WechatUtil {
public static JSONObject getSessionKeyOrOpenId(String code) {
String requestUrl = "https://api.weixin.qq.com/sns/jscode2session";
Map<String, String> requestUrlParam = new HashMap<>();
// https://mp.weixin.qq.com/wxopen/devprofile?action=get_profile&token=164113089&lang=zh_CN
//小程序appId
requestUrlParam.put("wx08c675f6ba5b2cdc", "wx08c675f6ba5b2cdc");
//小程序secret
requestUrlParam.put("0c28388c09ff373d391fe66d085dd39d", "0c28388c09ff373d391fe66d085dd39d");
//小程序端返回的code
requestUrlParam.put("js_code", code);
//默认参数
requestUrlParam.put("grant_type", "authorization_code");
//发送post请求读取调用微信接口获取openid用户唯一标识
JSONObject jsonObject = JSON.parseObject(HttpClientUtil.doPost(requestUrl, requestUrlParam));
return jsonObject;
}
public static JSONObject getUserInfo(String encryptedData, String sessionKey, String iv) {
// 被加密的数据
byte[] dataByte = Base64.decode(encryptedData);
// 加密秘钥
byte[] keyByte = Base64.decode(sessionKey);
// 偏移量
byte[] ivByte = Base64.decode(iv);
try {
// 如果密钥不足16位那么就补足. 这个if 中的内容很重要
int base = 16;
if (keyByte.length % base != 0) {
int groups = keyByte.length / base + (keyByte.length % base != 0 ? 1 : 0);
byte[] temp = new byte[groups * base];
Arrays.fill(temp, (byte) 0);
System.arraycopy(keyByte, 0, temp, 0, keyByte.length);
keyByte = temp;
}
// 初始化
Security.addProvider(new BouncyCastleProvider());
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7Padding", "BC");
SecretKeySpec spec = new SecretKeySpec(keyByte, "AES");
AlgorithmParameters parameters = AlgorithmParameters.getInstance("AES");
parameters.init(new IvParameterSpec(ivByte));
cipher.init(Cipher.DECRYPT_MODE, spec, parameters);// 初始化
byte[] resultByte = cipher.doFinal(dataByte);
if (null != resultByte && resultByte.length > 0) {
String result = new String(resultByte, "UTF-8");
return JSON.parseObject(result);
}
} catch (Exception e) {
}
return null;
}
}

@ -0,0 +1,143 @@
package com.example.demo.common;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
public class ZipUtils {
private static final int BUFFER_SIZE = 2 * 1024;
/**
* ZIP 1
*
* @param srcDir
* @param out
* @param KeepDirStructure ,true:;
* false:(,)
* @throws RuntimeException
*/
public static void toZip(String srcDir, OutputStream out, boolean KeepDirStructure)
throws RuntimeException {
long start = System.currentTimeMillis();
ZipOutputStream zos = null;
try {
zos = new ZipOutputStream(out);
File sourceFile = new File(srcDir);
compress(sourceFile, zos, sourceFile.getName(), KeepDirStructure);
long end = System.currentTimeMillis();
System.out.println("压缩完成,耗时:" + (end - start) + " ms");
} catch (Exception e) {
throw new RuntimeException("zip error from ZipUtils", e);
} finally {
if (zos != null) {
try {
zos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
/**
* ZIP 2
*
* @param srcFiles
* @param out
* @throws RuntimeException
*/
public static void toZip(List<File> srcFiles, OutputStream out) throws RuntimeException {
long start = System.currentTimeMillis();
ZipOutputStream zos = null;
try {
zos = new ZipOutputStream(out);
for (File srcFile : srcFiles) {
byte[] buf = new byte[BUFFER_SIZE];
zos.putNextEntry(new ZipEntry(srcFile.getName()));
int len;
FileInputStream in = new FileInputStream(srcFile);
while ((len = in.read(buf)) != -1) {
zos.write(buf, 0, len);
}
zos.closeEntry();
in.close();
}
long end = System.currentTimeMillis();
System.out.println("压缩完成,耗时:" + (end - start) + " ms");
} catch (Exception e) {
throw new RuntimeException("zip error from ZipUtils", e);
} finally {
if (zos != null) {
try {
zos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
/**
*
*
* @param sourceFile
* @param zos zip
* @param name
* @param KeepDirStructure ,true:;
* false:(,)
* @throws Exception
*/
private static void compress(File sourceFile, ZipOutputStream zos, String name,
boolean KeepDirStructure) throws Exception {
byte[] buf = new byte[BUFFER_SIZE];
if (sourceFile.isFile()) {
// 向zip输出流中添加一个zip实体构造器中name为zip实体的文件的名字
zos.putNextEntry(new ZipEntry(name));
// copy文件到zip输出流中
int len;
FileInputStream in = new FileInputStream(sourceFile);
while ((len = in.read(buf)) != -1) {
zos.write(buf, 0, len);
}
// Complete the entry
zos.closeEntry();
in.close();
} else {
File[] listFiles = sourceFile.listFiles();
if (listFiles == null || listFiles.length == 0) {
// 需要保留原来的文件结构时,需要对空文件夹进行处理
if (KeepDirStructure) {
// 空文件夹的处理
zos.putNextEntry(new ZipEntry(name + "/"));
// 没有文件不需要文件的copy
zos.closeEntry();
}
} else {
for (File file : listFiles) {
// 判断是否需要保留原来的文件结构
if (KeepDirStructure) {
// 注意file.getName()前面需要带上父文件夹的名字加一斜杠,
// 不然最后压缩包中就不能保留原来的文件结构,即:所有文件都跑到压缩包根目录下了
compress(file, zos, name + "/" + file.getName(), KeepDirStructure);
} else {
compress(file, zos, file.getName(), KeepDirStructure);
}
}
}
}
}
public static void main(String[] args) throws Exception {
/** 测试压缩方法1 */
FileOutputStream fos1 = new FileOutputStream(new File("./test.zip"));
ZipUtils.toZip("C:\\Users\\1\\OneDrive - sliverki\\学习", fos1, true);
}
}

@ -0,0 +1,47 @@
package com.example.demo.common.util;
public class FormatResponseUtil {
/**
*
*/
public static ResponseResult formatResponse() {
ResponseResult result = null;
return formatResponse(result);
}
private static ResponseResult formatResponse(ResponseResult result) {
if (result == null) {
result = new ResponseResult(true, "请求成功", null);
}
return result;
}
/**
* ,
*/
public static ResponseResult formatResponse(Object object) {
return new ResponseResult(true, "请求成功", object);
}
/**
*
*/
public static ResponseResult formatResponse(String msg, Object object) {
return new ResponseResult(true, msg, object);
}
/**
*
*/
public static ResponseResult error(Exception e) {
return new ResponseResult(false, e.getMessage());
}
/**
*
*/
public static ResponseResult error(String exception) {
return new ResponseResult(false, exception);
}
}

@ -0,0 +1,34 @@
package com.example.demo.common.util;
import lombok.Data;
@Data
public class ResponseResult {
/**
*
*/
private boolean success;
/**
*
*/
private String msg;
/**
*
*/
private Object data;
public ResponseResult(boolean success, String msg, Object data) {
this.success = success;
this.msg = msg;
this.data = data;
}
public ResponseResult(boolean code, String msg) {
this.success = success;
this.msg = msg;
}
public ResponseResult(boolean success) {
this.success = success;
}
}

@ -0,0 +1,21 @@
package com.example.demo.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class MyMvcConfig implements WebMvcConfigurer {
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/").setViewName("index");
registry.addViewController("/index.html").setViewName("index");
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new LoginHandleInterceptor()).addPathPatterns("/resource").excludePathPatterns("/index.html","dashboard","/","/login","/css/**","/js/**","/img/**");
}
}

@ -0,0 +1,31 @@
package com.example.demo.config;
import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springdoc.core.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* SpringDoc API
* Created by kirito on 2022/10/2.
*/
@Configuration
public class SpringDocConfig {
/**
*
* @return
*/
@Bean
public GroupedOpenApi publicApi() {
return GroupedOpenApi.builder()
.group("") //分组
.pathsToMatch("") //匹配url路径
.build();
}
}

@ -0,0 +1,33 @@
package com.example.demo.config.config;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import com.example.demo.domain.Task;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
@Component
public class BaseEntityMetaObjectHandler implements MetaObjectHandler {
@Override
public void insertFill(MetaObject metaObject) {
// 创建时间自动填充
if (metaObject.hasSetter(Task.CREATE_TIME) && ObjectUtil.isNull(getFieldValByName(Task.CREATE_TIME, metaObject))) {
this.strictInsertFill(metaObject, Task.CREATE_TIME, LocalDateTime.class, LocalDateTime.now());
}
}
@Override
public void updateFill(MetaObject metaObject) {
//修改时间自动填充
if (metaObject.hasSetter(Task.MODIFIED_TIME) && ObjectUtil.isNull(getFieldValByName(Task.MODIFIED_TIME, metaObject))) {
this.strictUpdateFill(metaObject, Task.MODIFIED_TIME, LocalDateTime.class, LocalDateTime.now());
}
}
}

@ -0,0 +1,27 @@
package com.example.demo.config.config;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* MybatisPlus
*
* @author huang
* @since 2022-03-18
*/
@Configuration
public class MybatisPlusConfig {
/**
*
*/
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
return interceptor;
}
}

@ -0,0 +1,42 @@
package com.example.demo.controller;
import com.example.demo.common.util.FormatResponseUtil;
import com.example.demo.common.util.ResponseResult;
import com.example.demo.domain.Dragon;
import com.example.demo.service.impl.DragonServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/dragon")
public class DragonController {
@Autowired
DragonServiceImpl dragonService;
@GetMapping("/dragonList")
public ResponseResult queryAll() {
return FormatResponseUtil.formatResponse(dragonService.queryAll());
}
@PostMapping("/addDragon")
public ResponseResult addDragon(@RequestBody Dragon dragon) {
//System.out.println("1111111111");
return FormatResponseUtil.formatResponse(dragonService.save(dragon));
}
@DeleteMapping("/delete")//这里执行的是物理删除
public ResponseResult delTDragonById(Integer id) {
return FormatResponseUtil.formatResponse(dragonService.delDragonById(id));
}
@GetMapping("/one")
public ResponseResult queryById(int id) {
return FormatResponseUtil.formatResponse(dragonService.queryDragonById(id));
}
@PostMapping("/dragonInfo")
public ResponseResult updateArea(@RequestBody Dragon dragon) {
return FormatResponseUtil.formatResponse(dragonService.updateById(dragon));
}
}

@ -0,0 +1,134 @@
package com.example.demo.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo.domain.Dragonson;
import com.example.demo.domain.Taskson;
import com.example.demo.domain.User;
import com.example.demo.mapper.DragonsonMapper;
import com.example.demo.mapper.TasksonMapper;
import com.example.demo.mapper.UserMapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.http.impl.bootstrap.HttpServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Date;
import java.util.List;
@Tag(name = "任务上传", description = " ")
@RestController
public class TaskuploadController {
@Autowired
private TasksonMapper tasksonMapper;
@Autowired
private UserMapper userMapper;
@Autowired
private DragonsonMapper dragonsonMapper;
@RequestMapping(value = "/taskupload", method = RequestMethod.POST)
@Operation(summary = "任务上传接口")
public String taskupload(HttpServletRequest request,
@RequestParam(name = "skey", required = true) String skey,
@RequestParam(name = "Task_id", required = true) Integer Taskid) {
//skey 查表
System.out.println(skey);
QueryWrapper<User> queryWrapper = new QueryWrapper<>();
queryWrapper.like("skey", skey);
User user = this.userMapper.selectOne(queryWrapper);
System.out.println(user);
QueryWrapper<Taskson> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.like("studentnumber", user.getStudentNumber());
queryWrapper1.like("Task_id", Taskid); //任务表(需修改)
Taskson taskson = this.tasksonMapper.selectOne(queryWrapper1);
if (taskson == null) {
taskson = new Taskson();
taskson.setTaskid(Taskid);//任务id需修改
taskson.setStudentnumber(user.getStudentNumber());
this.tasksonMapper.insert(taskson);
}
//文件接收
taskson = this.tasksonMapper.selectOne(queryWrapper1);
List<MultipartFile> files = ((MultipartHttpServletRequest) request).getFiles("file");
String type = files.get(0).getOriginalFilename().split("\\.")[1];
MultipartFile file = null;
FileOutputStream stream = null;
Path fapath = Paths.get("E:\\git\\project\\src\\demo\\target" + "\\" + taskson.getTaskid());
try {
Files.createDirectories(fapath);
} catch (IOException e) {
e.printStackTrace();
}
String path = "E:\\git\\project\\src\\demo\\target" + "\\" + taskson.getTaskid() + "\\" + taskson.getStudentnumber() + "." + type;
try {
stream = new FileOutputStream(path);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
for (int i = 0; i < files.size(); ++i) {
file = files.get(i);
if (!file.isEmpty()) {
try {
byte[] bytes = file.getBytes();
stream.write(bytes);
stream.close();
} catch (Exception e) {
stream = null;
return "You failed to upload " + i + " => "
+ e.getMessage();
}
} else {
return "You failed to upload " + i
+ " because the file was empty.";
}
}
System.out.println("upload success");
taskson.setFilepath(path);
taskson.setFinishtime(new Date());
this.tasksonMapper.updateById(taskson);
return "upload successful";
}
@RequestMapping(value = "/uploadDragon",method = RequestMethod.POST)
public String uploaddragon(HttpServletRequest request,
@RequestParam(name = "skey", required = true) String skey,
@RequestParam(name = "dragonid", required = true) Integer dragonid,
@RequestParam(name = "text", required = true) String text) {
QueryWrapper<User> queryWrapper = new QueryWrapper<>();
queryWrapper.like("skey", skey);
User user = this.userMapper.selectOne(queryWrapper);
QueryWrapper<Dragonson> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.like("studentnumber", user.getStudentNumber());
queryWrapper1.like("dragon_id", dragonid);
Dragonson dragonson = this.dragonsonMapper.selectOne(queryWrapper1);
if (dragonson == null) {
dragonson = new Dragonson();
dragonson.setDragonid(dragonid);
dragonson.setStudentnumber(user.getStudentNumber());
this.dragonsonMapper.insert(dragonson);
}
System.out.println(text);
dragonson = this.dragonsonMapper.selectOne(queryWrapper1);
dragonson.setFinishtime(new Date());
dragonson.setText(text);
this.dragonsonMapper.updateById(dragonson);
return "success";
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save