|
@@ -33,13 +33,13 @@ public class PropertyController extends ControllerSupport {
|
|
|
if (user != null) {
|
|
|
try {
|
|
|
propertyService.saveProperty(property, user);
|
|
|
- return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
+ return new ResponseEntity<>(HttpStatus.OK);
|
|
|
} catch (Exception e) {
|
|
|
log.error(e.getMessage(), e);
|
|
|
- return new ResponseEntity<Object>(HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
+ return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
}
|
|
|
}
|
|
|
- return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
|
|
|
+ return new ResponseEntity<>(HttpStatus.NOT_FOUND);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "查询所有属性dto", notes = "树形结构")
|
|
@@ -47,10 +47,10 @@ public class PropertyController extends ControllerSupport {
|
|
|
public ResponseEntity<Object> findAllProperty(@PathVariable String coursePropertyId) {
|
|
|
User user = getAccessUser();
|
|
|
if (user == null) {
|
|
|
- return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
|
|
|
+ return new ResponseEntity<>(HttpStatus.NOT_FOUND);
|
|
|
}
|
|
|
List<PropertyDto> propertyDtos = propertyService.propertyDtos(Long.parseLong(coursePropertyId), user);
|
|
|
- return new ResponseEntity<Object>(propertyDtos, HttpStatus.OK);
|
|
|
+ return new ResponseEntity<>(propertyDtos, HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "更新属性", notes = "更新属性")
|
|
@@ -60,13 +60,13 @@ public class PropertyController extends ControllerSupport {
|
|
|
if (user != null) {
|
|
|
try {
|
|
|
propertyService.saveProperty(property, user);
|
|
|
- return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
+ return new ResponseEntity<>(HttpStatus.OK);
|
|
|
} catch (Exception e) {
|
|
|
log.error(e.getMessage(), e);
|
|
|
- return new ResponseEntity<Object>(HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
+ return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
}
|
|
|
}
|
|
|
- return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
|
|
|
+ return new ResponseEntity<>(HttpStatus.NOT_FOUND);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "删除属性", notes = "删除属性")
|
|
@@ -75,9 +75,9 @@ public class PropertyController extends ControllerSupport {
|
|
|
User user = getAccessUser();
|
|
|
if (user != null) {
|
|
|
propertyService.deleteProperty(propertyId, coursePropertyId, user);
|
|
|
- return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
+ return new ResponseEntity<>(HttpStatus.OK);
|
|
|
}
|
|
|
- return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
|
|
|
+ return new ResponseEntity<>(HttpStatus.NOT_FOUND);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "查询所有属性", notes = "查询所有属性")
|
|
@@ -86,9 +86,9 @@ public class PropertyController extends ControllerSupport {
|
|
|
User user = getAccessUser();
|
|
|
if (user != null) {
|
|
|
List<Property> properties = propertyService.findAll(Long.parseLong(coursePropertyId), user);
|
|
|
- return new ResponseEntity<Object>(properties, HttpStatus.OK);
|
|
|
+ return new ResponseEntity<>(properties, HttpStatus.OK);
|
|
|
}
|
|
|
- return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
|
|
|
+ return new ResponseEntity<>(HttpStatus.NOT_FOUND);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "根据一级查询二级所有属性", notes = "查询所有属性")
|
|
@@ -97,9 +97,9 @@ public class PropertyController extends ControllerSupport {
|
|
|
User user = getAccessUser();
|
|
|
if (user != null) {
|
|
|
List<Property> properties = propertyService.findPropertySons(propertyId);
|
|
|
- return new ResponseEntity<Object>(properties, HttpStatus.OK);
|
|
|
+ return new ResponseEntity<>(properties, HttpStatus.OK);
|
|
|
}
|
|
|
- return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
|
|
|
+ return new ResponseEntity<>(HttpStatus.NOT_FOUND);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "根据课程属性id所有一级属性", notes = "查询所有属性")
|
|
@@ -108,9 +108,9 @@ public class PropertyController extends ControllerSupport {
|
|
|
User user = getAccessUser();
|
|
|
if (user != null) {
|
|
|
List<Property> properties = propertyService.findPropertyParents(coursePropertyId, user.getRootOrgId());
|
|
|
- return new ResponseEntity<Object>(properties, HttpStatus.OK);
|
|
|
+ return new ResponseEntity<>(properties, HttpStatus.OK);
|
|
|
}
|
|
|
- return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
|
|
|
+ return new ResponseEntity<>(HttpStatus.NOT_FOUND);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "上移", notes = "上移")
|
|
@@ -121,13 +121,13 @@ public class PropertyController extends ControllerSupport {
|
|
|
try {
|
|
|
property.setOrgId(user.getRootOrgId());
|
|
|
propertyService.moveUp(property);
|
|
|
- return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
+ return new ResponseEntity<>(HttpStatus.OK);
|
|
|
} catch (Exception e) {
|
|
|
log.error(e.getMessage(), e);
|
|
|
- return new ResponseEntity<Object>(HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
+ return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
}
|
|
|
}
|
|
|
- return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
|
|
|
+ return new ResponseEntity<>(HttpStatus.NOT_FOUND);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "下移", notes = "下移")
|
|
@@ -138,12 +138,12 @@ public class PropertyController extends ControllerSupport {
|
|
|
try {
|
|
|
property.setOrgId(user.getRootOrgId());
|
|
|
propertyService.moveDown(property);
|
|
|
- return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
+ return new ResponseEntity<>(HttpStatus.OK);
|
|
|
} catch (Exception e) {
|
|
|
log.error(e.getMessage(), e);
|
|
|
- return new ResponseEntity<Object>(HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
+ return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
}
|
|
|
}
|
|
|
- return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
|
|
|
+ return new ResponseEntity<>(HttpStatus.NOT_FOUND);
|
|
|
}
|
|
|
}
|