Pārlūkot izejas kodu

更新场景音频管理-条件文件名

wuweihao 4 gadi atpakaļ
vecāks
revīzija
a188c36a1b

+ 1 - 69
README.md

@@ -1,74 +1,6 @@
-# 郑州部队
+# 澳门军史馆
 
 ##sit
-    堡垒机-消安本地
-    tomcat:
-        /本地消安/root/user/java/tomcat-8101-army/webapps/
-        
-    访问url:
-        http://192.168.0.163:8101/    
-        
-        <Context path="" docBase="/root/user/java/tomcat_army_cms_8101/webapps/armycms" debug="0" reloadable="true" crossContext="true"/>
-        <Context path="/data" docBase="/root/user/army_cms_data/" reloadable="true" crossContext="true" />
-        
-        
-     编辑场景url:
-     http://192.168.0.44:8101/edit-backstage/edit.html?m=ar_jvWeBmEgQ
-     
-     
-     场景展现url:
-     http://192.168.0.44:8101/SuperTwo/index.html?m=ar_jvWeBmEgQ
-        
-        
- #data文件夹
- 
-        --ar_WTJ1ooJDD 场景码
-            - xxx_50k_texture_jpg(文通)
-            - vision.txt(文通)
-            
-            - vision.modeldata(java通过是vision.txt转的)
-            - data2.js(java生成的空json)
-            - someData.json(java生成)
-            - xxx_50k.dam(java生成)
-            
-            
-            
- # 数据处理逻辑:
-    	1. 文通部门上传文件到指定目录
-    	2. 调用算法切图(slice_skybox)         (算法处理)
-    	3. 调用算法将obj_to_txt                  (算法处理)
-    	4. 转换前端需要的文件
-    		4.1 对算法生成的result文件夹的upload.json进程校验,处理相应逻辑
-    			4.1.1 图片归类到相应文件夹      (java处理)
-    			4.1.2 将modeldata.txt转xxx.dam    (java处理)
-    		4.2 vision.txt转vision.modeldata   (java处理) 【模型和相机点位的数据(vision.modeldata,******.dam)】
-    		4.3 生成data2.js                     (java处理)
-    		4.4 创建someData.json                 (java处理)          
-
-
-
-# 需求确认:
-
-1. 系统管理员,是可以看所有数据,还是只可以看系统管理的数据?
-2. 系统管理员是直接添加用户是就给,还是数据库后台手动给
-3. 系统管理员账户可以删除吗?
-4. 是有一个系统管理员,还是多个?
-
-5. 精品典藏的数据管理
-
-    列表:
-        缩略图应该是同一个
-    
-     
-2020-7-16
-    展示页:
-    
-    
-redis 模糊查询key
-后来测试发现模糊查询是可以用的, 找了下资料, 改成
-
-Set<String> keys = redisTemplate.keys("noteUserListenedPoi:" + "*");
-redisTemplate.delete(keys);
 
 # 2021-01-07
   原型图: https://lanhuapp.com/url/fZndv

+ 1 - 1
gis_application/src/main/resources/application-sit.properties

@@ -60,7 +60,7 @@ server.file.path=/root/user/${project.name}_data/
 # url prefix
 server.url.prefix=/data/
 # domain
-server.domain=http://192.168.0.44:8110/
+server.domain=http://192.168.0.44:8110${server.url.prefix}
 
 # swagger2 \u8BBE\u7F6E\u5168\u5C40\u5B57\u4F53\u683C\u5F0F\u4E3Autf-8
 swagger.package=com.gis.web.controller

+ 20 - 0
gis_common/src/main/java/com/gis/common/config/WebMvcConfig.java

@@ -10,6 +10,7 @@ import org.springframework.context.annotation.Configuration;
 import org.springframework.http.MediaType;
 import org.springframework.web.servlet.config.annotation.CorsRegistry;
 import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
 import java.util.ArrayList;
@@ -34,6 +35,25 @@ public class WebMvcConfig implements WebMvcConfigurer {
     }
 
 
+    /**
+     * 静态资源运行swagger访问
+     */
+    private static final String[] CLASSPATH_RESOURCE_LOCATIONS = {
+            "classpath:/META-INF/resources/", "classpath:/resources/",
+            "classpath:/static/", "classpath:/public/" };
+    @Override
+    public void addResourceHandlers(ResourceHandlerRegistry registry) {
+        if (!registry.hasMappingForPattern("/webjars/**")) {
+            registry.addResourceHandler("/webjars/**").addResourceLocations(
+                    "classpath:/META-INF/resources/webjars/");
+        }
+        if (!registry.hasMappingForPattern("/**")) {
+            registry.addResourceHandler("/**").addResourceLocations(
+                    CLASSPATH_RESOURCE_LOCATIONS);
+        }
+    }
+
+
 
     /**
      * fastJson相关设置

+ 1 - 3
gis_common/src/main/java/com/gis/common/util/FileUtils.java

@@ -3,9 +3,7 @@ package com.gis.common.util;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.img.ImgUtil;
 import cn.hutool.core.io.FileUtil;
-import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.URLUtil;
-import com.gis.common.exception.BaseRuntimeException;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.junit.Test;
@@ -210,7 +208,7 @@ public class FileUtils {
 
     public static boolean checkFile(MultipartFile file) {
         //设置允许上传文件类型
-        String suffixList = ".jpg,.gif,.png,.ico,.bmp,.jpeg,.zip,.zp,.rar,.mp3,.mp4,.avi,.mov,.4dage";
+        String suffixList = ".jpg,.gif,.png,.ico,.bmp,.jpeg,.zip,.zp,.rar,.mp3,.mp4,.m4a,.wav,.flac,.avi,.mov,.4dage";
         // 获取文件后缀
         if(file == null){
             log.info("文件流为空不可上传");

+ 4 - 0
gis_domain/src/main/java/com/gis/domain/dto/SceneAudioDto.java

@@ -32,5 +32,9 @@ public class SceneAudioDto {
     @ApiModelProperty(value = "音频文件url", required = true)
     private String audio;
 
+    @NotBlank(message = "音频原文件名不能为空")
+    @ApiModelProperty(value = "音频原文件名", required = true)
+    private String fileName;
+
 
 }

+ 2 - 0
gis_domain/src/main/java/com/gis/domain/po/SceneAudioEntity.java

@@ -31,5 +31,7 @@ public class SceneAudioEntity extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "音频文件url")
     private String audio;
 
+    @ApiModelProperty(value = "音频原文件名")
+    private String fileName;
 
 }

+ 1 - 2
gis_service/src/main/java/com/gis/service/impl/SceneAudioServiceImpl.java

@@ -53,7 +53,7 @@ public class SceneAudioServiceImpl extends IBaseServiceImpl<SceneAudioEntity, Lo
         String startTime = param.getStartTime();
         String endTime = param.getEndTime();
         if (StringUtils.isNotBlank(startTime) ) {
-            condition.and().andBetween("create_time", startTime, endTime);
+            condition.and().andBetween("createTime", startTime, endTime);
         }
 
         return Result.success(this.findAll(condition, param.getPageNum(), param.getPageSize()));
@@ -120,7 +120,6 @@ public class SceneAudioServiceImpl extends IBaseServiceImpl<SceneAudioEntity, Lo
             HashMap<Object, Object> result = new HashMap<>();
 
             // 前端访问url: ip + port/data + path, 需要使用data 前缀访问, data让前端自己配置
-//            Object urlPath = configConstant.serverUrlPrefix + middlePath + fileName;
             Object urlPath = middlePath + fileName;
             result.put("fileName", originalFilename);
             result.put("path", urlPath);

+ 0 - 92
gis_web/src/main/java/com/gis/web/controller/WebController.java

@@ -34,21 +34,9 @@ import java.util.*;
 public class WebController extends BaseController {
 
     @Autowired
-    private ViewService viewService;
-
-    @Autowired
     private KnowledgeService knowledgeService;
 
     @Autowired
-    private NewsService newsService;
-
-    @Autowired
-    private SceneService sceneService;
-
-    @Autowired
-    private VideoService videoService;
-
-    @Autowired
     private CommentService commentService;
 
     @Autowired
@@ -60,33 +48,6 @@ public class WebController extends BaseController {
 
 
 
-
-
-//    @ApiOperation("搜索")
-//    @PostMapping("search")
-//    public Result<NewsVo> search(@RequestBody PageDto param) {
-//        startPage(param);
-//        PageInfo<NewsVo> page = new PageInfo<>(newsService.webSearch(param));
-//        return Result.success(page);
-//    }
-
-
-
-//    @ApiOperation("获取访问量")
-//    @GetMapping("count")
-//    public Result count() {
-//
-//        ViewEntity entity = new ViewEntity();
-//        entity.setIp(request.getRemoteAddr());
-//        entity.setPath(request.getRequestURI());
-//        viewService.save(entity);
-//
-//        long count = viewService.count();
-//        return Result.success(count);
-//    }
-
-
-
     @ApiOperation("文物库")
     @PostMapping("fodder")
     public Result<FodderEntity> list(@RequestBody FodderPageDto param) {
@@ -107,27 +68,6 @@ public class WebController extends BaseController {
     }
 
 
-//    @ApiOperation(value = "数字史馆-场景")
-//    @GetMapping("scene")
-//    public Result scene() {
-//        Condition condition = new Condition(SceneEntity.class);
-//        condition.and().andEqualTo("display", 1);
-//        List<SceneEntity> all = sceneService.findAll(condition);
-//        return Result.success(all);
-//    }
-
-
-//    @ApiOperation(value = "数字史馆-视频")
-//    @GetMapping("video")
-//    public Result video() {
-//
-//        Condition condition = new Condition(VideoEntity.class);
-//        condition.and().andEqualTo("display", 1);
-//        List<VideoEntity> all = videoService.findAll(condition);
-//
-//        return Result.success(all);
-//    }
-
 
     @ApiOperation("留言列表")
     @PostMapping("list")
@@ -157,38 +97,6 @@ public class WebController extends BaseController {
 
 
 
-//    @ApiOperation("用户注册")
-//    @PostMapping("register")
-//    public Result register(@Valid @RequestBody RegisterDto param) {
-//
-//        if (!param.getPassword().equals(param.getVerifyPassword())) {
-//            log.error("确认密码不一致");
-//            return Result.failure("确认密码不一致");
-//        }
-//
-//        SysUserEntity entity = sysUserService.findByUserName(param.getUserName());
-//        if (entity != null) {
-//            log.error("该身份证号已注册: {}", param.getUserName());
-//            return Result.failure("该身份证号已注册");
-//        }
-//
-//        entity = new SysUserEntity();
-//        BeanUtils.copyProperties(param, entity);
-//
-//        entity.setPassword(PasswordUtils.encrypt(param.getUserName(), param.getPassword(), PasswordUtils.getStaticSalt()));
-//        entity.setStatus(1);
-//        entity.setRole("sys_visitor");
-//        sysUserService.save(entity);
-//
-//        // 保存操作日志
-//        saveLog(new LogEntity(entity.getId(),"用户注册","新增用户"));
-//
-//
-//
-//        return Result.success();
-//    }
-
-
     @ApiOperation("找回密码")
     @PostMapping("resetPassword")
     public Result resetPassword(@Valid @RequestBody ResetPasswordDto param) {