|
@@ -1,6 +1,7 @@
|
|
|
package com.fdage.controller;
|
|
|
|
|
|
import com.fdage.aop.WebControllerLog;
|
|
|
+import com.fdage.constant.ConfigConstant;
|
|
|
import com.fdage.constant.ConstantUrl;
|
|
|
import com.fdage.enums.ResponEnum;
|
|
|
import com.fdage.pojo.TbCollection;
|
|
@@ -40,6 +41,9 @@ public class CollectionController {
|
|
|
@Value("${upload.collection}")
|
|
|
private String uploadPath;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ ConfigConstant configConstant;
|
|
|
+
|
|
|
@PostMapping("timeList")
|
|
|
@ResponseBody
|
|
|
@ApiOperation("获取年代列表")
|
|
@@ -58,19 +62,19 @@ public class CollectionController {
|
|
|
@ResponseBody
|
|
|
@WebControllerLog(description = "文物库-新增文物")
|
|
|
@ApiOperation("新增文物")
|
|
|
- @ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "name", value = "文物名称", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "description", value = "文物描述", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "timeId", value = "年代id", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "typeId", value = "类型id", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "modelUrl", value = "文物模型url", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "discoveryTime", value = "文物发现时间", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "repairTime", value = "文物维修时间", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "venue", value = "文物所在场馆", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "contentUrl", value = "多媒体内容Url", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "pic", value = "4dmodel文物的封面图", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "num", value = "藏品编号", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "state", value = "状态,0:展示,1:隐藏", dataType = "String")})
|
|
|
+// @ApiImplicitParams({
|
|
|
+// @ApiImplicitParam(name = "name", value = "文物名称", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "description", value = "文物描述", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "timeId", value = "年代id", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "typeId", value = "类型id", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "modelUrl", value = "文物模型url", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "discoveryTime", value = "文物发现时间", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "repairTime", value = "文物维修时间", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "venue", value = "文物所在场馆", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "contentUrl", value = "多媒体内容Url", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "pic", value = "4dmodel文物的封面图", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "num", value = "藏品编号", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "state", value = "状态,0:展示,1:隐藏", dataType = "String")})
|
|
|
public AjaxJson addCollection(@RequestBody RequestCollection bo){
|
|
|
if(bo == null || StringUtils.isEmpty(bo.getName()) ||
|
|
|
bo.getTimeId() == null || bo.getTypeId() == null){
|
|
@@ -79,8 +83,8 @@ public class CollectionController {
|
|
|
|
|
|
TbCollection collection = new TbCollection();
|
|
|
BeanUtils.copyProperties(bo, collection);
|
|
|
-// collection.setPic(ConstantUrl.FDMODEL_PIC + bo.getModelUrl().substring(
|
|
|
-// bo.getModelUrl().indexOf("m=") + 2) + "/thumbnail.jpg");
|
|
|
+ collection.setUnityUrl("/collection/unity/" + bo.getDirCode());
|
|
|
+// collection.setUnityUrl(configConstant.serverBasePath + "/collection/unity/" + bo.getDirCode());
|
|
|
service.insert(collection);
|
|
|
return AjaxJson.success();
|
|
|
}
|
|
@@ -89,20 +93,20 @@ public class CollectionController {
|
|
|
@ResponseBody
|
|
|
@WebControllerLog(description = "文物库-修改文物")
|
|
|
@ApiOperation("修改文物")
|
|
|
- @ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "id", value = "文物id", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "name", value = "文物名称", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "description", value = "文物描述", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "timeId", value = "年代id", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "typeId", value = "类型id", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "modelUrl", value = "文物模型url", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "discoveryTime", value = "文物发现时间", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "repairTime", value = "文物维修时间", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "venue", value = "文物所在场馆", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "contentUrl", value = "多媒体内容Url", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "pic", value = "4dmodel文物的封面图", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "num", value = "藏品编号", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "state", value = "状态,0:展示,1:隐藏", dataType = "String")})
|
|
|
+// @ApiImplicitParams({
|
|
|
+// @ApiImplicitParam(name = "id", value = "文物id", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "name", value = "文物名称", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "description", value = "文物描述", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "timeId", value = "年代id", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "typeId", value = "类型id", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "modelUrl", value = "文物模型url", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "discoveryTime", value = "文物发现时间", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "repairTime", value = "文物维修时间", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "venue", value = "文物所在场馆", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "contentUrl", value = "多媒体内容Url", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "pic", value = "4dmodel文物的封面图", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "num", value = "藏品编号", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "state", value = "状态,0:展示,1:隐藏", dataType = "String")})
|
|
|
public AjaxJson updateCollection(@RequestBody RequestCollection bo){
|
|
|
if(bo == null || StringUtils.isEmpty(bo.getName()) ||
|
|
|
bo.getTimeId() == null || bo.getTypeId() == null ){
|
|
@@ -159,7 +163,7 @@ public class CollectionController {
|
|
|
return AjaxJson.success(pageInfo);
|
|
|
}
|
|
|
|
|
|
- @RequestMapping("/upload")
|
|
|
+ @PostMapping("/upload")
|
|
|
@ResponseBody
|
|
|
@ApiOperation("上传文物图片")
|
|
|
@ApiImplicitParams({
|
|
@@ -188,6 +192,22 @@ public class CollectionController {
|
|
|
return AjaxJson.success((Object) ("/collection/" + fileName));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 2021-08-09
|
|
|
+ * @param file
|
|
|
+ * @param code
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/uploadCode")
|
|
|
+ @ApiOperation("上传Unity")
|
|
|
+ @ResponseBody
|
|
|
+ public AjaxJson uploadCode(MultipartFile file, String code){
|
|
|
+
|
|
|
+ return service.uploadCode(file, code);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@RequestMapping("/importCollection")
|
|
|
@ResponseBody
|
|
|
@ApiOperation("导入文物数据")
|