浏览代码

部署sit

wuweihao 3 年之前
父节点
当前提交
77d4cca5d6

+ 7 - 0
gis_application/src/main/resources/application.properties

@@ -34,6 +34,13 @@ mybatis-plus.global-config.db-config.logic-delete-field = isDelete
 mybatis-plus.mapper-locations=classpath*:/mybatis/mappers/**.xml
 
 
+#pager
+pagehelper.helper-dialect=mysql
+pagehelper.params=count=countSql
+pagehelper.reasonable=false
+pagehelper.support-methods-arguments=true
+
+
 
 
 

+ 2 - 2
gis_cms/src/main/java/com/gis/cms/entity/dto/GoodsPageDto.java

@@ -15,8 +15,8 @@ public class GoodsPageDto extends PageDateDto {
     @ApiModelProperty(value = "排序类型:0:发布时间, 1:序号")
     private Integer sortType;
 
-    @NotBlank(message = "类型不能为空")
-    @ApiModelProperty(value = "类型, model:模型, img:图片",required = true)
+//    @NotBlank(message = "类型不能为空")
+    @ApiModelProperty(value = "类型, model:模型, img:图片")
     private String type;
 
     @ApiModelProperty(value = "显示:0:不显示,1:显示", notes = "后端使用")

+ 4 - 0
gis_cms/src/main/java/com/gis/cms/entity/vo/FileVo.java

@@ -1,12 +1,16 @@
 package com.gis.cms.entity.vo;
 
 import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 /**
  * Created by owen on 2022/5/20 0020 11:38
  */
 @Data
+@NoArgsConstructor
+@AllArgsConstructor
 public class FileVo {
 
     @ApiModelProperty(value = "对象ID")

+ 33 - 13
gis_cms/src/main/java/com/gis/cms/service/impl/GoodsServiceImpl.java

@@ -45,7 +45,8 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, GoodsEntity> impl
         IPage<GoodsEntity> page = new Page<>(param.getPageNum(), param.getPageSize());
         LambdaQueryWrapper<GoodsEntity> wrapper = new LambdaQueryWrapper<>();
         String searchKey = param.getSearchKey();
-        wrapper.eq(GoodsEntity::getType, param.getType());
+        String type = param.getType();
+        wrapper.eq(StrUtil.isNotBlank(type), GoodsEntity::getType, type);
         Integer display = param.getDisplay();
         wrapper.eq(display!=null, GoodsEntity::getDisplay, display);
         String startTime = param.getStartTime();
@@ -125,13 +126,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, GoodsEntity> impl
         return Result.success();
     }
 
-    /**
-     * 前端条件:前端已经把不使用的图片id已删除
-     */
-//    private void bindingImg(Long id, String ids){
-//        fileService.bindingModuleId(id, ids, "goods");
-//
-//    }
+
     @Override
     public Result upload(FileDto param) {
 
@@ -146,11 +141,36 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, GoodsEntity> impl
         return Result.success(map);
     }
 
-//    @Override
-//    public Result videoUpload(MultipartFile file, String type) {
-//        Map<String, Object> map = fileUtils.uploadMap(file, "/goods/"+type, false);
-//        return Result.success(map);
-//    }
+
+//    @Test
+//    public void testPage(){
+//        PageHelper.startPage(1, 4);
+//        ArrayList<Object> list = new ArrayList<>();
+//        list.add(new FileVo(1L, "小明1", null));
+//        list.add(new FileVo(2L, "小明2", null));
+//        list.add(new FileVo(3L, "小明3", null));
+//        list.add(new FileVo(4L, "小明4", null));
+//        list.add(new FileVo(5L, "小明5", null));
+//
+//        list.add(new UserVo(1L, "小孩1"));
+//        list.add(new UserVo(2L, "小孩2"));
+//        list.add(new UserVo(3L, "小孩3"));
+//        list.add(new UserVo(4L, "小孩4"));
+//        list.add(new UserVo(5L, "小孩5"));
+//        list.add(new UserVo(6L, "小孩6"));
+//        list.add(new UserVo(7L, "小孩7"));
+//        list.add(new UserVo(8L, "小孩8"));
+//        list.add(new UserVo(9L, "小孩9"));
+//        list.add(new UserVo(10L, "小孩10"));
+//
+//
+//
+//
+//        PageInfo<Object> info = PageInfo.of(list);
+//
+//        System.out.println(info);
+//
 
 
+//    }
 }

+ 6 - 0
gis_common/pom.xml

@@ -122,6 +122,12 @@
             <artifactId>mybatis-plus-boot-starter</artifactId>
         </dependency>
 
+        <!--&lt;!&ndash;分页插件&ndash;&gt;-->
+        <!--<dependency>-->
+            <!--<groupId>com.github.pagehelper</groupId>-->
+            <!--<artifactId>pagehelper-spring-boot-starter</artifactId>-->
+        <!--</dependency>-->
+
 
 
     </dependencies>

+ 41 - 0
gis_common/src/main/java/com/gis/common/util/FileUtils.java

@@ -5,10 +5,12 @@ import cn.hutool.core.util.StrUtil;
 import com.gis.common.base.exception.BaseRuntimeException;
 import com.gis.common.constant.ConfigConstant;
 import lombok.extern.slf4j.Slf4j;
+import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.web.multipart.MultipartFile;
 
+import java.io.*;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -115,4 +117,43 @@ public class FileUtils {
         log.info("真删除文件: {}", delPath);
     }
 
+
+
+    @Test
+    public void test1() throws Exception {
+        File file = new File("E:\\桌面\\fsdownload\\1.jpg");
+        //字节输入流
+        InputStream fis = new FileInputStream(file);
+        //字节输出流
+        OutputStream fos = new FileOutputStream(file);
+
+        //字符输入流
+        Reader reader = new FileReader(file);
+        //字符输出流
+        Writer writer = new FileWriter(file);
+
+        //字节缓冲流
+        BufferedInputStream bis = new BufferedInputStream(fis);
+        BufferedOutputStream bos = new BufferedOutputStream(fos);
+
+        //字符缓冲流
+        BufferedReader bufferedReader = new BufferedReader(reader);
+        BufferedWriter bufferedWriter = new BufferedWriter(writer);
+
+        //转换流 字节流转字符流
+        InputStreamReader isr = new InputStreamReader(fis);
+        OutputStreamWriter osw = new OutputStreamWriter(fos);
+
+        //打印流
+        PrintWriter printWriter = new PrintWriter(file);
+        PrintStream printStream = new PrintStream(file);
+
+        //了解 什么时候使用过
+        InputStream in = System.in;
+        System.out.println(in);
+        PrintStream out = System.out;
+        System.out.println(out);
+
+    }
+
 }

+ 9 - 0
pom.xml

@@ -46,6 +46,7 @@
     <jjwt.version>0.6.0</jjwt.version>
     <mybatis-plus.version>3.4.3.4</mybatis-plus.version>
     <wxJava.version>4.2.0</wxJava.version>
+    <!--<pagehelper.version>1.2.5</pagehelper.version>-->
   </properties>
 
 
@@ -216,6 +217,14 @@
         <version>${mybatis-plus.version}</version>
       </dependency>
 
+      <!--&lt;!&ndash;分页插件&ndash;&gt;-->
+      <!--<dependency>-->
+        <!--<groupId>com.github.pagehelper</groupId>-->
+        <!--<artifactId>pagehelper-spring-boot-starter</artifactId>-->
+        <!--<version>${pagehelper.version}</version>-->
+      <!--</dependency>-->
+
+
 
     </dependencies>
   </dependencyManagement>