diff --git a/pom.xml b/pom.xml
index 900747a..c36beed 100644
--- a/pom.xml
+++ b/pom.xml
@@ -177,6 +177,12 @@
2.9.2
+
+ com.github.java-json-tools
+ json-patch
+ 1.12
+
+
diff --git a/src/main/java/com/codesdream/ase/component/activity/ActivityConverter.java b/src/main/java/com/codesdream/ase/component/activity/ActivityConverter.java
index 67c90b9..4ae1b7f 100644
--- a/src/main/java/com/codesdream/ase/component/activity/ActivityConverter.java
+++ b/src/main/java/com/codesdream/ase/component/activity/ActivityConverter.java
@@ -1,21 +1,18 @@
package com.codesdream.ase.component.activity;
import com.alibaba.fastjson.JSONObject;
-import com.codesdream.ase.exception.DataInvalidFormatException;
+import com.codesdream.ase.exception.innerservererror.DataInvalidFormatException;
import com.codesdream.ase.model.activity.Activity;
import com.codesdream.ase.model.activity.Attendance;
import com.codesdream.ase.model.activity.Period;
import com.codesdream.ase.model.permission.User;
-import com.codesdream.ase.repository.activity.ActivityRepository;
import com.codesdream.ase.service.ActivityService;
import com.codesdream.ase.service.AttendanceService;
import com.codesdream.ase.service.PeriodService;
import com.codesdream.ase.service.UserService;
-import javafx.util.converter.LocalDateTimeStringConverter;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
-import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
diff --git a/src/main/java/com/codesdream/ase/component/datamanager/DataExcelGenerator.java b/src/main/java/com/codesdream/ase/component/datamanager/DataExcelGenerator.java
index 83c1948..c11d01b 100644
--- a/src/main/java/com/codesdream/ase/component/datamanager/DataExcelGenerator.java
+++ b/src/main/java/com/codesdream/ase/component/datamanager/DataExcelGenerator.java
@@ -1,7 +1,7 @@
package com.codesdream.ase.component.datamanager;
import com.codesdream.ase.exception.notfound.DataFileNotFoundException;
-import com.codesdream.ase.exception.DataIOException;
+import com.codesdream.ase.exception.innerservererror.DataIOException;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
diff --git a/src/main/java/com/codesdream/ase/component/datamanager/DataExcelReader.java b/src/main/java/com/codesdream/ase/component/datamanager/DataExcelReader.java
index f5471f2..794f8c3 100644
--- a/src/main/java/com/codesdream/ase/component/datamanager/DataExcelReader.java
+++ b/src/main/java/com/codesdream/ase/component/datamanager/DataExcelReader.java
@@ -2,6 +2,9 @@ package com.codesdream.ase.component.datamanager;
import com.codesdream.ase.exception.*;
+import com.codesdream.ase.exception.innerservererror.DataIOException;
+import com.codesdream.ase.exception.innerservererror.DataIllegalTableFormatException;
+import com.codesdream.ase.exception.innerservererror.DataInvalidFormatException;
import com.codesdream.ase.exception.notfound.DataFileNotFoundException;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.*;
@@ -48,7 +51,7 @@ public class DataExcelReader implements DataReader {
Row titleRow = sheet.getRow(0);
colNumber = titleRow.getLastCellNum();
// 表头项目个数不可为0
- if(colNumber == 0) throw new DataIllegalTableFormatException();
+ if(colNumber == 0) throw new DataIllegalTableFormatException();
Collection title = new ArrayList<>();
for(int cellIdx = 0; cellIdx < colNumber; cellIdx++){
title.add(readCell(titleRow.getCell(cellIdx)));
diff --git a/src/main/java/com/codesdream/ase/component/datamanager/DataTable.java b/src/main/java/com/codesdream/ase/component/datamanager/DataTable.java
index cf1217c..97d04f5 100644
--- a/src/main/java/com/codesdream/ase/component/datamanager/DataTable.java
+++ b/src/main/java/com/codesdream/ase/component/datamanager/DataTable.java
@@ -1,11 +1,9 @@
package com.codesdream.ase.component.datamanager;
-import com.codesdream.ase.exception.DataIllegalTableFormatException;
+import com.codesdream.ase.exception.innerservererror.DataIllegalTableFormatException;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
-import javax.persistence.Table;
-import javax.swing.text.html.Option;
import java.util.*;
// 描述一张数据表
diff --git a/src/main/java/com/codesdream/ase/component/datamanager/JsonPathParameter.java b/src/main/java/com/codesdream/ase/component/datamanager/JsonPathParameter.java
new file mode 100644
index 0000000..64b719b
--- /dev/null
+++ b/src/main/java/com/codesdream/ase/component/datamanager/JsonPathParameter.java
@@ -0,0 +1,23 @@
+package com.codesdream.ase.component.datamanager;
+
+import com.codesdream.ase.exception.innerservererror.HandlingErrorsException;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.github.fge.jsonpatch.JsonPatch;
+import com.github.fge.jsonpatch.JsonPatchException;
+import org.springframework.stereotype.Controller;
+
+@Controller
+public class JsonPathParameter {
+ public T parsePathToObject(JsonPatch patch, T object){
+ try {
+ ObjectMapper mapper = new ObjectMapper();
+ JsonNode patched = patch.apply(mapper.convertValue(object, JsonNode.class));
+ return (T) mapper.treeToValue(patched, object.getClass());
+ } catch (JsonPatchException | JsonProcessingException e) {
+ throw new HandlingErrorsException(e.getMessage());
+ }
+
+ }
+}
diff --git a/src/main/java/com/codesdream/ase/component/json/model/JsonablePCCList.java b/src/main/java/com/codesdream/ase/component/json/model/JsonablePCCList.java
new file mode 100644
index 0000000..870743e
--- /dev/null
+++ b/src/main/java/com/codesdream/ase/component/json/model/JsonablePCCList.java
@@ -0,0 +1,22 @@
+package com.codesdream.ase.component.json.model;
+
+import com.codesdream.ase.model.permission.PermissionContainersCollection;
+import com.codesdream.ase.model.permission.Tag;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+@Data
+@NoArgsConstructor
+@ApiModel("权限容器集合列表")
+public class JsonablePCCList {
+ List pccIdList;
+
+ public JsonablePCCList(Tag tag){
+ for(PermissionContainersCollection pcc : tag.getPermissionContainersCollections()){
+ pccIdList.add(pcc.getId());
+ }
+ }
+}
diff --git a/src/main/java/com/codesdream/ase/component/json/model/JsonableTagUserList.java b/src/main/java/com/codesdream/ase/component/json/model/JsonableUserList.java
similarity index 87%
rename from src/main/java/com/codesdream/ase/component/json/model/JsonableTagUserList.java
rename to src/main/java/com/codesdream/ase/component/json/model/JsonableUserList.java
index 523c61e..e91c3cb 100644
--- a/src/main/java/com/codesdream/ase/component/json/model/JsonableTagUserList.java
+++ b/src/main/java/com/codesdream/ase/component/json/model/JsonableUserList.java
@@ -12,13 +12,13 @@ import java.util.List;
@Data
@NoArgsConstructor
@ApiModel("标签所属用户集合")
-public class JsonableTagUserList {
+public class JsonableUserList {
@ApiModelProperty(name = "用户列表")
private List users;
- public JsonableTagUserList(Tag tag){
+ public JsonableUserList(Tag tag){
for(User user : tag.getUsers()){
users.add(user.getId());
}
diff --git a/src/main/java/com/codesdream/ase/controller/ASEControllerAdvice.java b/src/main/java/com/codesdream/ase/controller/ASEControllerAdvice.java
index bdddf30..281ced4 100644
--- a/src/main/java/com/codesdream/ase/controller/ASEControllerAdvice.java
+++ b/src/main/java/com/codesdream/ase/controller/ASEControllerAdvice.java
@@ -3,7 +3,11 @@ package com.codesdream.ase.controller;
import com.codesdream.ase.component.api.QuickJSONRespond;
import com.codesdream.ase.component.json.respond.ErrorInfoJSONRespond;
import com.codesdream.ase.exception.badrequest.AlreadyExistException;
+import com.codesdream.ase.exception.badrequest.IllegalException;
import com.codesdream.ase.exception.conflict.RelatedObjectsExistException;
+import com.codesdream.ase.exception.innerservererror.FormatException;
+import com.codesdream.ase.exception.innerservererror.HandlingErrorsException;
+import com.codesdream.ase.exception.innerservererror.RuntimeIOException;
import com.codesdream.ase.exception.notfound.NotFoundException;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@@ -21,7 +25,8 @@ public class ASEControllerAdvice {
@ExceptionHandler(value = {
NullPointerException.class,
- AlreadyExistException.class
+ AlreadyExistException.class,
+ IllegalException.class
})
public ResponseEntity