Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
御承扬
Campus
提交
c7d6feb0
C
Campus
项目概览
御承扬
/
Campus
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
Campus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c7d6feb0
编写于
1月 29, 2021
作者:
7
7wc98#14
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
commit
上级
2628748c
变更
15
显示空白变更内容
内联
并排
Showing
15 changed file
with
326 addition
and
26 deletion
+326
-26
src/main/java/com/pyc/campus/controller/AdminController.java
src/main/java/com/pyc/campus/controller/AdminController.java
+26
-8
src/main/java/com/pyc/campus/controller/QuestionController.java
...in/java/com/pyc/campus/controller/QuestionController.java
+19
-5
src/main/java/com/pyc/campus/controller/StudentController.java
...ain/java/com/pyc/campus/controller/StudentController.java
+20
-5
src/main/java/com/pyc/campus/dao/QuestionRepository.java
src/main/java/com/pyc/campus/dao/QuestionRepository.java
+3
-1
src/main/java/com/pyc/campus/dao/StudentRepository.java
src/main/java/com/pyc/campus/dao/StudentRepository.java
+4
-3
src/main/java/com/pyc/campus/domain/Grade.java
src/main/java/com/pyc/campus/domain/Grade.java
+1
-0
src/main/java/com/pyc/campus/domain/Question.java
src/main/java/com/pyc/campus/domain/Question.java
+21
-1
src/main/java/com/pyc/campus/domain/Student.java
src/main/java/com/pyc/campus/domain/Student.java
+27
-1
src/main/java/com/pyc/campus/service/QuestionService.java
src/main/java/com/pyc/campus/service/QuestionService.java
+21
-0
src/main/java/com/pyc/campus/service/StudentService.java
src/main/java/com/pyc/campus/service/StudentService.java
+20
-0
src/main/java/com/pyc/campus/service/impl/QuestionServiceImpl.java
...java/com/pyc/campus/service/impl/QuestionServiceImpl.java
+43
-0
src/main/java/com/pyc/campus/service/impl/StudentServiceImpl.java
.../java/com/pyc/campus/service/impl/StudentServiceImpl.java
+44
-0
src/main/resources/templates/page/BrowserQuestion.html
src/main/resources/templates/page/BrowserQuestion.html
+36
-0
src/main/resources/templates/page/ManageUser.html
src/main/resources/templates/page/ManageUser.html
+36
-0
src/main/resources/templates/page/QueryGrade.html
src/main/resources/templates/page/QueryGrade.html
+5
-2
未找到文件。
src/main/java/com/pyc/campus/controller/AdminController.java
浏览文件 @
c7d6feb0
...
...
@@ -8,6 +8,11 @@ import com.pyc.campus.domain.Grade;
import
com.pyc.campus.domain.Msg
;
import
com.pyc.campus.domain.Question
;
import
com.pyc.campus.domain.Student
;
import
com.pyc.campus.service.StudentService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.security.core.context.SecurityContextImpl
;
import
org.springframework.security.core.userdetails.UserDetails
;
...
...
@@ -39,13 +44,16 @@ public class AdminController {
final
QuestionRepository
questionRepository
;
final
SysUserRepository
sysUserRepository
;
final
StudentService
studentService
;
public
AdminController
(
StudentRepository
studentRepository
,
GradeRepository
gradeRepository
,
SysUserRepository
sysUserRepository
,
QuestionRepository
questionRepository
){
GradeRepository
gradeRepository
,
SysUserRepository
sysUserRepository
,
QuestionRepository
questionRepository
,
StudentService
studentService
){
this
.
studentRepository
=
studentRepository
;
this
.
gradeRepository
=
gradeRepository
;
this
.
sysUserRepository
=
sysUserRepository
;
this
.
questionRepository
=
questionRepository
;
this
.
studentService
=
studentService
;
}
@RequestMapping
(
"/admin"
)
public
String
admin
(
Model
model
,
HttpSession
session
){
...
...
@@ -57,25 +65,35 @@ public class AdminController {
}
@RequestMapping
(
"/delStuByStuId"
)
public
String
delStuByStuId
(
Model
model
,
HttpSession
session
,
@RequestParam
(
value
=
"studentId"
,
required
=
false
)
String
stuId
){
public
String
delStuByStuId
(
Model
model
,
HttpSession
session
,
@RequestParam
(
value
=
"studentId"
,
required
=
false
)
String
stuId
,
@RequestParam
(
value
=
"pageNum"
,
defaultValue
=
"0"
)
int
pageNum
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
int
pageSize
){
studentRepository
.
delByStudentID
(
stuId
);
sysUserRepository
.
delByUsername
(
stuId
);
List
<
Student
>
students
=
studentRepository
.
findAll
(
);
Page
<
Student
>
students
=
studentService
.
getStudentList
(
pageNum
,
pageSize
);
model
.
addAttribute
(
"students"
,
students
);
model
.
addAttribute
(
"prefix"
,
"/delStuByStuId"
);
return
"page/ManageUser"
;
}
@RequestMapping
(
"/manageUser"
)
public
String
findUserExceptCurUser
(
Model
model
,
HttpSession
session
){
List
<
Student
>
students
=
studentRepository
.
findAll
();
public
String
findUserExceptCurUser
(
Model
model
,
HttpSession
session
,
@RequestParam
(
value
=
"pageNum"
,
defaultValue
=
"0"
)
int
pageNum
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
int
pageSize
){
Page
<
Student
>
students
=
studentService
.
getStudentList
(
pageNum
,
pageSize
);
model
.
addAttribute
(
"prefix"
,
"/manageUser"
);
model
.
addAttribute
(
"students"
,
students
);
return
"page/ManageUser"
;
}
@RequestMapping
(
"/findUserByStudentIDLike"
)
public
String
findUserByStudentIDLike
(
Model
model
,
HttpSession
session
,
@RequestParam
(
value
=
"ClassPrefix"
,
required
=
false
)
String
classPrefix
){
List
<
Student
>
students
=
studentRepository
.
query01
(
classPrefix
+
'%'
);
@RequestParam
(
value
=
"ClassPrefix"
,
required
=
false
)
String
classPrefix
,
@RequestParam
(
value
=
"pageNum"
,
defaultValue
=
"0"
)
int
pageNum
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
int
pageSize
){
Page
<
Student
>
students
=
studentService
.
getStudentListByStuIdLike
(
pageNum
,
pageSize
,
classPrefix
);
model
.
addAttribute
(
"students"
,
students
);
model
.
addAttribute
(
"prefix"
,
"/findUserByStudentIDLike"
);
return
"page/ManageUser"
;
}
...
...
src/main/java/com/pyc/campus/controller/QuestionController.java
浏览文件 @
c7d6feb0
...
...
@@ -4,6 +4,11 @@ import com.pyc.campus.config.MailConfig;
import
com.pyc.campus.dao.QuestionRepository
;
import
com.pyc.campus.domain.Msg
;
import
com.pyc.campus.domain.Question
;
import
com.pyc.campus.service.QuestionService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.mail.SimpleMailMessage
;
import
org.springframework.mail.javamail.JavaMailSender
;
...
...
@@ -31,20 +36,29 @@ public class QuestionController {
final
QuestionRepository
questionRepository
;
public
QuestionController
(
QuestionRepository
questionRepository
){
final
QuestionService
questionService
;
public
QuestionController
(
QuestionRepository
questionRepository
,
QuestionService
questionService
){
this
.
questionRepository
=
questionRepository
;
this
.
questionService
=
questionService
;
}
@RequestMapping
(
"/toBrowserQuestion"
)
public
String
toBrowserQuestion
(
Model
model
,
HttpSession
session
){
List
<
Question
>
questions
=
questionRepository
.
findAll
();
public
String
toBrowserQuestion
(
Model
model
,
HttpSession
session
,
@RequestParam
(
value
=
"pageNum"
,
defaultValue
=
"0"
)
int
pageNum
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
int
pageSize
){
Page
<
Question
>
questions
=
questionService
.
getQuestionList
(
pageNum
,
pageSize
);
model
.
addAttribute
(
"prefix"
,
"/toBrowserQuestion"
);
model
.
addAttribute
(
"questions"
,
questions
);
return
"page/BrowserQuestion"
;
}
@RequestMapping
(
"/queryByQuestionType"
)
public
String
queryByQuestionType
(
Model
model
,
HttpSession
session
,
@RequestParam
(
value
=
"TypeOfQuestion"
,
required
=
false
)
String
type
){
List
<
Question
>
questions
=
questionRepository
.
findAllByType
(
type
);
@RequestParam
(
value
=
"TypeOfQuestion"
,
required
=
false
)
String
type
,
@RequestParam
(
value
=
"pageNum"
,
defaultValue
=
"0"
)
int
pageNum
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
int
pageSize
){
Page
<
Question
>
questions
=
questionService
.
getQuestionListByType
(
pageNum
,
pageSize
,
type
);
model
.
addAttribute
(
"prefix"
,
"/queryByQuestionType"
);
model
.
addAttribute
(
"questions"
,
questions
);
return
"page/BrowserQuestion"
;
}
...
...
src/main/java/com/pyc/campus/controller/StudentController.java
浏览文件 @
c7d6feb0
...
...
@@ -3,6 +3,11 @@ package com.pyc.campus.controller;
import
com.pyc.campus.dao.StudentRepository
;
import
com.pyc.campus.domain.Msg
;
import
com.pyc.campus.domain.Student
;
import
com.pyc.campus.service.StudentService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.security.core.context.SecurityContextImpl
;
import
org.springframework.security.core.userdetails.UserDetails
;
...
...
@@ -31,8 +36,12 @@ public class StudentController {
final
StudentRepository
studentRepository
;
public
StudentController
(
StudentRepository
studentRepository
){
final
StudentService
studentService
;
public
StudentController
(
StudentRepository
studentRepository
,
StudentService
studentService
){
this
.
studentRepository
=
studentRepository
;
this
.
studentService
=
studentService
;
}
@RequestMapping
(
"/userCenter"
)
...
...
@@ -123,7 +132,9 @@ public class StudentController {
@RequestMapping
(
"/saveFrozenInTrue"
)
public
String
saveFrozenInTrue
(
Model
model
,
HttpSession
session
,
@RequestParam
(
value
=
"studentId"
,
required
=
false
)
String
studentID
){
@RequestParam
(
value
=
"studentId"
,
required
=
false
)
String
studentID
,
@RequestParam
(
value
=
"pageNum"
,
defaultValue
=
"0"
)
int
pageNum
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
int
pageSize
){
int
t
=
studentRepository
.
saveFrozen
(
true
,
studentID
);
if
(
t
!=
0
){
System
.
out
.
println
(
"更新成功!"
);
...
...
@@ -132,7 +143,8 @@ public class StudentController {
{
System
.
out
.
println
(
"更新失败!"
);
}
List
<
Student
>
students
=
studentRepository
.
findAll
();
Page
<
Student
>
students
=
studentService
.
getStudentList
(
pageNum
,
pageSize
);
model
.
addAttribute
(
"prefix"
,
"/saveFrozenInTrue"
);
model
.
addAttribute
(
"students"
,
students
);
return
"page/ManageUser"
;
...
...
@@ -140,7 +152,9 @@ public class StudentController {
@RequestMapping
(
"/saveFrozenInFalse"
)
public
String
saveFrozenInFalse
(
Model
model
,
HttpSession
session
,
@RequestParam
(
value
=
"studentId"
,
required
=
false
)
String
studentID
){
@RequestParam
(
value
=
"studentId"
,
required
=
false
)
String
studentID
,
@RequestParam
(
value
=
"pageNum"
,
defaultValue
=
"0"
)
int
pageNum
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
int
pageSize
){
int
t
=
studentRepository
.
saveFrozen
(
false
,
studentID
);
if
(
t
!=
0
){
...
...
@@ -150,7 +164,8 @@ public class StudentController {
{
System
.
out
.
println
(
"更新失败!"
);
}
List
<
Student
>
students
=
studentRepository
.
findAll
();
Page
<
Student
>
students
=
studentService
.
getStudentList
(
pageNum
,
pageSize
);
model
.
addAttribute
(
"prefix"
,
"/saveFrozenInFalse"
);
model
.
addAttribute
(
"students"
,
students
);
return
"page/ManageUser"
;
...
...
src/main/java/com/pyc/campus/dao/QuestionRepository.java
浏览文件 @
c7d6feb0
...
...
@@ -9,11 +9,13 @@
package
com.pyc.campus.dao
;
import
com.pyc.campus.domain.Question
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
java.util.List
;
public
interface
QuestionRepository
extends
JpaRepository
<
Question
,
Long
>
{
List
<
Question
>
findAll
();
List
<
Question
>
findAllByType
(
String
type
);
Page
<
Question
>
findAllByType
(
String
type
,
Pageable
p
);
}
src/main/java/com/pyc/campus/dao/StudentRepository.java
浏览文件 @
c7d6feb0
...
...
@@ -8,6 +8,8 @@
package
com.pyc.campus.dao
;
import
com.pyc.campus.domain.Student
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.Modifying
;
import
org.springframework.data.jpa.repository.Query
;
...
...
@@ -41,10 +43,9 @@ public interface StudentRepository extends JpaRepository<Student,Long> {
@Query
(
"select s from Student s where s.studentID=?1"
)
Student
getOnlineStatus
(
String
studentID
);
// 根据Student ID前缀查询
@Modifying
@Transactional
@Query
(
"select s from Student s where s.studentID like ?1"
)
List
<
Student
>
query01
(
String
classPrefix
);
Page
<
Student
>
query01
(
String
classPrefix
,
Pageable
p
);
@Modifying
@Transactional
@Query
(
"delete from Student where studentID=?1"
)
...
...
src/main/java/com/pyc/campus/domain/Grade.java
浏览文件 @
c7d6feb0
...
...
@@ -15,6 +15,7 @@ import java.io.Serializable;
@Entity
public
class
Grade
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
long
id
;
...
...
src/main/java/com/pyc/campus/domain/Question.java
浏览文件 @
c7d6feb0
...
...
@@ -7,19 +7,27 @@
package
com.pyc.campus.domain
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
java.io.Serializable
;
@Entity
public
class
Question
{
public
class
Question
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
private
long
id
;
@Column
(
nullable
=
true
,
unique
=
true
)
private
String
publisher
;
// 申请人
@Column
(
nullable
=
true
,
unique
=
true
)
private
String
mail
;
// 邮箱
@Column
(
nullable
=
true
,
unique
=
true
)
private
String
type
;
// 问题类型
@Column
(
nullable
=
true
,
unique
=
true
)
private
String
content
;
// 问题内容
@Column
(
nullable
=
true
,
unique
=
true
)
private
String
reward
;
// 悬赏
public
Question
(){
super
();
...
...
@@ -82,4 +90,16 @@ public class Question {
public
String
getType
()
{
return
type
;
}
@Override
public
String
toString
()
{
return
"Question{"
+
"id="
+
id
+
", publisher='"
+
publisher
+
'\''
+
", mail='"
+
mail
+
'\''
+
", type='"
+
type
+
'\''
+
", content='"
+
content
+
'\''
+
", reward='"
+
reward
+
'\''
+
'}'
;
}
}
src/main/java/com/pyc/campus/domain/Student.java
浏览文件 @
c7d6feb0
...
...
@@ -7,22 +7,33 @@
package
com.pyc.campus.domain
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
java.io.Serializable
;
@Entity
public
class
Student
{
public
class
Student
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
private
Long
id
;
@Column
(
nullable
=
true
,
unique
=
true
)
private
String
name
;
@Column
(
nullable
=
true
,
unique
=
true
)
private
String
studentID
;
@Column
(
nullable
=
true
,
unique
=
true
)
private
String
password
;
@Column
(
nullable
=
true
,
unique
=
true
)
private
String
weChat
;
@Column
(
nullable
=
true
,
unique
=
true
)
private
String
QQ
;
@Column
(
nullable
=
true
,
unique
=
true
)
private
int
admin
;
@Column
(
nullable
=
true
,
unique
=
true
)
private
boolean
onlineStatus
;
@Column
(
nullable
=
true
,
unique
=
true
)
private
boolean
frozen
;
public
Student
()
{
...
...
@@ -112,4 +123,19 @@ public class Student {
public
String
getWeChat
()
{
return
weChat
;
}
@Override
public
String
toString
()
{
return
"Student{"
+
"id="
+
id
+
", name='"
+
name
+
'\''
+
", studentID='"
+
studentID
+
'\''
+
", password='"
+
password
+
'\''
+
", weChat='"
+
weChat
+
'\''
+
", QQ='"
+
QQ
+
'\''
+
", admin="
+
admin
+
", onlineStatus="
+
onlineStatus
+
", frozen="
+
frozen
+
'}'
;
}
}
src/main/java/com/pyc/campus/service/QuestionService.java
0 → 100644
浏览文件 @
c7d6feb0
package
com.pyc.campus.service
;
import
com.pyc.campus.domain.Question
;
import
org.springframework.data.domain.Page
;
/**
* @author 御承扬
* @product IntelliJ IDEA
* @project campus
* @file QuestionService
* @pack com.pyc.campus.service
* @date 2021/1/29
* @time 14:58
* @E-mail 2923616405@qq.com
**/
public
interface
QuestionService
{
Page
<
Question
>
getQuestionList
(
int
pageNum
,
int
pageSize
);
Page
<
Question
>
getQuestionListByType
(
int
pageNum
,
int
pageSize
,
String
type
);
}
src/main/java/com/pyc/campus/service/StudentService.java
0 → 100644
浏览文件 @
c7d6feb0
package
com.pyc.campus.service
;
import
com.pyc.campus.domain.Student
;
import
org.springframework.data.domain.Page
;
/**
* @author 御承扬
* @product IntelliJ IDEA
* @project campus
* @file StudentService
* @pack com.pyc.campus.service
* @date 2021/1/29
* @time 14:44
* @E-mail 2923616405@qq.com
**/
public
interface
StudentService
{
Page
<
Student
>
getStudentList
(
int
pageNum
,
int
pageSize
);
Page
<
Student
>
getStudentListByStuIdLike
(
int
pageNum
,
int
pageSize
,
String
like
);
}
src/main/java/com/pyc/campus/service/impl/QuestionServiceImpl.java
0 → 100644
浏览文件 @
c7d6feb0
package
com.pyc.campus.service.impl
;
import
com.pyc.campus.dao.QuestionRepository
;
import
com.pyc.campus.domain.Question
;
import
com.pyc.campus.service.QuestionService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.stereotype.Service
;
/**
* @author 御承扬
* @product IntelliJ IDEA
* @project campus
* @file QuestionServiceImpl
* @pack com.pyc.campus.service.impl
* @date 2021/1/29
* @time 15:00
* @E-mail 2923616405@qq.com
**/
@Service
public
class
QuestionServiceImpl
implements
QuestionService
{
final
QuestionRepository
questionRepository
;
public
QuestionServiceImpl
(
QuestionRepository
questionRepository
)
{
this
.
questionRepository
=
questionRepository
;
}
@Override
public
Page
<
Question
>
getQuestionList
(
int
pageNum
,
int
pageSize
)
{
Pageable
pageable
=
PageRequest
.
of
(
pageNum
,
pageSize
);
return
questionRepository
.
findAll
(
pageable
);
}
@Override
public
Page
<
Question
>
getQuestionListByType
(
int
pageNum
,
int
pageSize
,
String
type
)
{
Pageable
pageable
=
PageRequest
.
of
(
pageNum
,
pageSize
);
return
questionRepository
.
findAllByType
(
type
,
pageable
);
}
}
src/main/java/com/pyc/campus/service/impl/StudentServiceImpl.java
0 → 100644
浏览文件 @
c7d6feb0
package
com.pyc.campus.service.impl
;
import
com.pyc.campus.dao.StudentRepository
;
import
com.pyc.campus.domain.Student
;
import
com.pyc.campus.service.StudentService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.stereotype.Service
;
/**
* @author 御承扬
* @product IntelliJ IDEA
* @project campus
* @file StudentServiceImpl
* @pack com.pyc.campus.service.impl
* @date 2021/1/29
* @time 14:46
* @E-mail 2923616405@qq.com
**/
@Service
public
class
StudentServiceImpl
implements
StudentService
{
final
StudentRepository
studentRepository
;
public
StudentServiceImpl
(
StudentRepository
studentRepository
)
{
this
.
studentRepository
=
studentRepository
;
}
@Override
public
Page
<
Student
>
getStudentList
(
int
pageNum
,
int
pageSize
)
{
Pageable
pageable
=
PageRequest
.
of
(
pageNum
,
pageSize
);
return
studentRepository
.
findAll
(
pageable
);
}
@Override
public
Page
<
Student
>
getStudentListByStuIdLike
(
int
pageNum
,
int
pageSize
,
String
like
)
{
Pageable
pageable
=
PageRequest
.
of
(
pageNum
,
pageSize
);
return
studentRepository
.
query01
(
like
,
pageable
);
}
}
src/main/resources/templates/page/BrowserQuestion.html
浏览文件 @
c7d6feb0
...
...
@@ -94,6 +94,7 @@
<table
class=
"table table-striped"
>
<thead>
<tr>
<th>
序号
</th>
<th>
发布者
</th>
<th>
邮箱
</th>
<th>
问题类型
</th>
...
...
@@ -103,6 +104,7 @@
</thead>
<tbody
th:if=
"${not #lists.isEmpty(questions)}"
>
<tr
th:each=
"question:${questions}"
>
<th
scope=
"row"
th:text=
"${questionStat.index + 1}"
>
1
</th>
<td
th:text=
"${question.getPublisher()}"
></td>
<td
th:text=
"${question.mail}"
></td>
<td
th:text=
"${question.type}"
></td>
...
...
@@ -111,6 +113,40 @@
</tr>
</tbody>
</table>
<div
class=
"modal-footer no-margin-top"
>
<ul
class=
"pagination pull-right no-margin"
>
<!-- 首页 -->
<li>
<a
th:href=
"${prefix}+'?pageNum=0'"
>
首页
</a>
</li>
<!-- 上一页 -->
<li
th:if=
"${questions.hasPrevious()}"
>
<!--/*@thymesVar id="previousPageable" type="org.springframework.data.domain.Page"*/-->
<a
th:href=
"${prefix}+'?pageNum=' + ${questions.previousPageable().getPageNumber()}"
th:text=
"上一页"
></a>
</li>
<!-- 中间页 -->
<li
th:each=
"pageNum:${#numbers.sequence(0, questions.getTotalPages() - 1)}"
>
<a
th:href=
"${prefix}+'?pageNum=' + ${pageNum}"
th:text=
"${pageNum + 1}"
th:if=
"${pageNum ne questions.pageable.getPageNumber()}"
></a>
<a
th:href=
"${prefix}+'?pageNum=' + ${pageNum}"
th:text=
"${pageNum + 1}"
th:if=
"${pageNum eq questions.pageable.getPageNumber()}"
th:style=
"'font-weight:bold;background: #6faed9;'"
></a>
</li>
<!-- 下一页 -->
<li
th:if=
"${questions.hasNext()}"
>
<a
th:href=
"${prefix}+'?pageNum=' + ${questions.nextPageable().getPageNumber()}"
th:text=
"下一页"
></a>
</li>
<!-- 尾页 -->
<li>
<a
th:href=
"${prefix}+'?pageNum=' + ${questions.getTotalPages() - 1}"
>
尾页
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
...
...
src/main/resources/templates/page/ManageUser.html
浏览文件 @
c7d6feb0
...
...
@@ -154,6 +154,7 @@
<table
class=
"table table-striped table-hover"
>
<thead>
<tr>
<th>
序号
</th>
<th>
姓名
</th>
<th>
学号
</th>
<th>
QQ
</th>
...
...
@@ -164,6 +165,7 @@
</thead>
<tbody
th:if=
"${not #lists.isEmpty(students)}"
>
<tr
th:each=
"student:${students}"
>
<th
scope=
"row"
th:text=
"${studentStat.index + 1}"
>
1
</th>
<td
th:text=
"${student.getName()}"
></td>
<td
th:text=
"${student.getStudentID()}"
></td>
<td
th:text=
"${student.getQQ()}"
></td>
...
...
@@ -173,6 +175,40 @@
</tr>
</tbody>
</table>
<div
class=
"modal-footer no-margin-top"
>
<ul
class=
"pagination pull-right no-margin"
>
<!-- 首页 -->
<li>
<a
th:href=
"${prefix}+'?pageNum=0'"
>
首页
</a>
</li>
<!-- 上一页 -->
<li
th:if=
"${students.hasPrevious()}"
>
<!--/*@thymesVar id="previousPageable" type="org.springframework.data.domain.Page"*/-->
<a
th:href=
"${prefix}+'?pageNum=' + ${students.previousPageable().getPageNumber()}"
th:text=
"上一页"
></a>
</li>
<!-- 中间页 -->
<li
th:each=
"pageNum:${#numbers.sequence(0, students.getTotalPages() - 1)}"
>
<a
th:href=
"${prefix}+'?pageNum=' + ${pageNum}"
th:text=
"${pageNum + 1}"
th:if=
"${pageNum ne students.pageable.getPageNumber()}"
></a>
<a
th:href=
"${prefix}+'?pageNum=' + ${pageNum}"
th:text=
"${pageNum + 1}"
th:if=
"${pageNum eq students.pageable.getPageNumber()}"
th:style=
"'font-weight:bold;background: #6faed9;'"
></a>
</li>
<!-- 下一页 -->
<li
th:if=
"${students.hasNext()}"
>
<a
th:href=
"${prefix}+'?pageNum=' + ${students.nextPageable().getPageNumber()}"
th:text=
"下一页"
></a>
</li>
<!-- 尾页 -->
<li>
<a
th:href=
"${prefix}+'?pageNum=' + ${students.getTotalPages() - 1}"
>
尾页
</a>
</li>
</ul>
</div>
</div>
<form
class=
"form-inline"
name=
"form2"
method=
"post"
th:action=
"@{/delStuByStuId}"
>
<div
class=
"form-group"
>
...
...
src/main/resources/templates/page/QueryGrade.html
浏览文件 @
c7d6feb0
...
...
@@ -149,8 +149,11 @@
<!-- 中间页 -->
<li
th:each=
"pageNum:${#numbers.sequence(0, gradeItems.getTotalPages() - 1)}"
>
<a
th:href=
"${prefix}+'?pageNum=' + ${pageNum}"
th:text=
"${pageNum + 1}"
th:if=
"${pageNum ne gradeItems.pageable.getPageNumber()}"
></a>
<a
th:href=
"${prefix}+'?pageNum=' + ${pageNum}"
th:text=
"${pageNum + 1}"
th:if=
"${pageNum eq gradeItems.pageable.getPageNumber()}"
th:style=
"'font-weight:bold;background: #6faed9;'"
></a>
<a
th:href=
"${prefix}+'?pageNum=' + ${pageNum}"
th:text=
"${pageNum + 1}"
th:if=
"${pageNum ne gradeItems.pageable.getPageNumber()}"
></a>
<a
th:href=
"${prefix}+'?pageNum=' + ${pageNum}"
th:text=
"${pageNum + 1}"
th:if=
"${pageNum eq gradeItems.pageable.getPageNumber()}"
th:style=
"'font-weight:bold;background: #6faed9;'"
></a>
</li>
<!-- 下一页 -->
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录