今天继续昨天没有完成的内容
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Plan {
private String name;
private int number;
private String sum;
private String idea;
private String english;
private String math;
private LocalDateTime time;
}
package com.example.pojo;
/**
* 统一响应结果封装类
*/
public class Result {
private Integer code ;//1 成功 , 0 失败
private String msg; //提示信息
private Object data; //数据 data
public static Result success(Object data){
return new Result(1, "success", data);
}
public static Result success(){
return new Result(1, "success", null);
}
public static Result error(String msg){
return new Result(0, msg, null);
}
public Result() {
}
public Result(Integer code, String msg, Object data) {
this.code = code;
this.msg = msg;
this.data = data;
}
@Override
public String toString() {
return "Result{" +
"code=" + code +
", msg='" + msg + '\'' +
", data=" + data +
'}';
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
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;
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>教师管理页面</title>
<style>
.form {
width: 600px;
margin: 0 auto;
/*border: 1px solid red;*/
}
.form table {
margin: 0 auto;
}
.form table tr td {
width: 100px;
height: 30px;
border: 1px solid #000;
text-align: center;
}
button {
display: block;
margin-top: 10px;
padding: 10px;
background-color: #007bff;
color: #fff;
border: none;
border-radius: 3px;
cursor: pointer;
}
</style>
</head>
<body>
<h1 style="text-align: center">教师信息管理</h1>
<div class="form">
<table border="1px" cellspacing="0" width="600px">
<tr>
<th>编号</th>
<th>功能</th>
</tr>
<tr>
<td>1</td>
<td>
<button id="s1">提交复试成绩</button>
</td>
</tr>
<tr>
<td>2</td>
<td>
<button id="s2">成绩复查审核</button>
</td>
</tr>
</table>
</div>
</body>
<script>
var urlParams = new URLSearchParams(window.location.search);
var username = urlParams.get('username');
console.log(username);
document.getElementById("s1").addEventListener("click", function () {
window.location.href = "s12.html?username=" + encodeURIComponent(username);
});
document.getElementById("s2").addEventListener("click", function () {
window.location.href = "s22.html?username=" + encodeURIComponent(username);
});
</script>
</html>
标签:code,javaweb,2.28,Result,msg,继续,data,public,String From: https://www.cnblogs.com/dmx-03/p/18043172