From 5cba031b4fcc437568a46295739fda3dae7ae41f Mon Sep 17 00:00:00 2001
From: fangyuan <527392886@qq.com>
Date: 星期一, 21 十一月 2022 15:22:59 +0800
Subject: [PATCH] 上传文件配置及接口修改
---
/dev/null | 37 ---
ycl-platform/src/main/resources/application.yml | 2
ycl-platform/src/main/java/com/ycl/controller/ImageUploadController.java | 7
ycl-common/src/main/java/com/ycl/utils/MediaFileUtil.java | 526 ++++++++++++++++++++++++++--------------------------
4 files changed, 269 insertions(+), 303 deletions(-)
diff --git a/ycl-common/src/main/java/com/ycl/utils/MediaFileUtil.java b/ycl-common/src/main/java/com/ycl/utils/MediaFileUtil.java
index 2efdc41..3c6645a 100644
--- a/ycl-common/src/main/java/com/ycl/utils/MediaFileUtil.java
+++ b/ycl-common/src/main/java/com/ycl/utils/MediaFileUtil.java
@@ -1,263 +1,263 @@
-package com.ycl.utils;
-
-
-import com.github.tobato.fastdfs.domain.fdfs.StorePath;
-import com.github.tobato.fastdfs.domain.upload.FastImageFile;
-import com.github.tobato.fastdfs.service.FastFileStorageClient;
-import com.ycl.dto.media.PictureZoomParameter;
-import com.ycl.dto.media.Media;
-import net.coobird.thumbnailator.Thumbnails;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Component;
-import org.springframework.util.StringUtils;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.annotation.PostConstruct;
-import java.awt.image.BufferedImage;
-import java.io.*;
-import java.time.format.DateTimeFormatter;
-import java.util.List;
-import java.util.regex.Pattern;
-
-@Component
-public class MediaFileUtil {
-
-
- private static MediaFileUtil self;
- @Value("${fdfs.groupName}")
- private String groupName;
-
- @PostConstruct
- private void init() {
- self = this;
- }
-
-
- @Autowired
- private FastFileStorageClient storageClient;
-
-
- private static final Pattern videoPattern = Pattern.compile("((mp4|flv|avi|rm|rmvb|wmv)(jpg|png|gif|bmp))");
-
- @Value("${cfg.res}")
- private String rootPath;
-
- private final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMM");
-
-
- public MediaFileUtil() throws IOException {
-
- }
-
-
- public static String uploadImage(InputStream in) throws IOException {
-
- return self.storageClient.uploadImage(new FastImageFile(in, in.available(), "jpg", null)).getFullPath();
- }
-
-
- public static String uploadImage(File file) throws IOException {
-
- FileInputStream in = new FileInputStream(file);
- return self.storageClient.uploadImage(new FastImageFile(in, in.available(), "jpg", null)).getFullPath();
- }
-
-
- /**
- * 鍒ゆ柇鏂囦欢绫诲瀷
- *
- * @param fileName
- * @return
- */
- public Short getType(String fileName) {
-
- String ext = fileName.substring(fileName.lastIndexOf(".")).toLowerCase();
-
- if (".jpg".equals(ext) || ".jpeg".equals(ext) || ".png".equals(ext) || ".gif".equals(ext) || ".bmp".equals(ext)) {
- return 1;
- } else if (".mp4".equals(ext) || ".avi".equals(ext) || ".flv".equals(ext) || ".rm".equals(ext) || ".wmv".equals(ext)) {
- return 2;
- } else {
- return 0;
- }
- }
-
- public Media save(MultipartFile file, PictureZoomParameter zoomPar) throws Exception {
- String[] fs = file.getOriginalFilename().split("\\.");
- String ext = fs[fs.length - 1];
-
- switch (this.getType(file.getOriginalFilename())) {
- case 1:
- return this.savePicture(file, ext, zoomPar);
- case 2:
- return this.saveVideo(file, ext);
- default:
- return new Media();
- }
- }
-
- public String savePicture(InputStream inputStream, String ext) throws Exception {
- StorePath sp = storageClient.uploadFile(groupName, inputStream, inputStream.available(), ext);
- return sp.getFullPath();
- }
-
- public Media savePicture(MultipartFile file, String ext, PictureZoomParameter zoomPar) throws Exception {
-
- ByteArrayOutputStream outs = new ByteArrayOutputStream();
- Media media = new Media();
- media.setType(ext);
- String path = null;
- if (zoomPar.getWidth1() != null && zoomPar.getWidth1() > 0) {
- path = this.thumbAndStorageOfFile(file, ext, zoomPar.getWidth1());
- media.setUrl1(path);
- }
- if (zoomPar.getWidth2() != null && zoomPar.getWidth2() > 0) {
- path = this.thumbAndStorageOfFile(file, ext, zoomPar.getWidth2());
- media.setUrl2(path);
- }
- if (zoomPar.getWidth3() != null && zoomPar.getWidth3() > 0) {
- path = this.thumbAndStorageOfFile(file, ext, zoomPar.getWidth3());
- media.setUrl3(path);
- }
- // width4涓哄師鍥�
- path = this.thumbAndStorageOfFile(file, ext, zoomPar.getWidth4());
- media.setUrl4(path);
- return media;
- }
-
- /**
- * 淇濆瓨瑙嗛鏂囦欢
- *
- * @param file
- * @param ext
- * @return
- * @throws Exception
- */
- public Media saveVideo(MultipartFile file, String ext) throws Exception {
-// StorePath sp = storageClient.uploadFile(file.getInputStream(), file.getSize(), ext, null);
-
- StorePath sp = storageClient.uploadFile(groupName, file.getInputStream(), file.getSize(), ext);
- Media media = new Media();
- media.setType(ext);
- media.setUrl1(sp.getFullPath());
- return media;
- }
-
- /**
- * 鍒犻櫎涓�涓枃浠�
- *
- * @param rootPath
- */
- public void removeFile(String rootPath) {
- storageClient.deleteFile(rootPath);
- }
-
- public void removeMedia(Media media) {
- if (!StringUtils.isEmpty(media.getUrl1())) {
- storageClient.deleteFile(media.getUrl1());
- }
- if (!StringUtils.isEmpty(media.getUrl2())) {
- storageClient.deleteFile(media.getUrl2());
- }
- if (!StringUtils.isEmpty(media.getUrl3())) {
- storageClient.deleteFile(media.getUrl3());
- }
- if (!StringUtils.isEmpty(media.getUrl4())) {
- storageClient.deleteFile(media.getUrl4());
- }
- }
-
-
- public void removeMedias(List<Media> medias) {
- if (medias != null) {
- for (Media m : medias) {
- if (!StringUtils.isEmpty(m.getUrl1())) {
- storageClient.deleteFile(m.getUrl1());
- }
- if (!StringUtils.isEmpty(m.getUrl2())) {
- storageClient.deleteFile(m.getUrl2());
- }
- if (!StringUtils.isEmpty(m.getUrl3())) {
- storageClient.deleteFile(m.getUrl3());
- }
- if (!StringUtils.isEmpty(m.getUrl4())) {
- storageClient.deleteFile(m.getUrl4());
- }
- }
- }
-
- }
-
- /**
- * 鍒ゆ柇鏂囦欢鏄惁瀛樺湪
- *
- * @param url
- * @return
- */
- public Boolean isEmpty(String url) {
- return true;
- }
-
- /**
- * 缂╂斁骞朵笖涓婁紶
- *
- * @param in
- * @param ext
- * @param width
- * @return
- * @throws Exception
- */
- private String thumbAndStorage(InputStream in, String ext, Integer width) throws Exception {
-
- Thumbnails.Builder fileBuilder = Thumbnails.of(in).scale(1.0).outputQuality(1.0);
- BufferedImage src = fileBuilder.asBufferedImage();
-
- Integer w = src.getWidth(null);
- Integer destWidth = width > w ? w : width;
-
- ByteArrayOutputStream bouts = new ByteArrayOutputStream();
- Thumbnails.of(in).width(destWidth).toOutputStream(bouts);
- InputStream ins = this.out2In(bouts);
-
- StorePath sp = storageClient.uploadFile(groupName, ins, bouts.size(), ext);
-// StorePath sp = storageClient.uploadFile(ins, bouts.size(), ext, null);
- bouts.close();
- ins.close();
- return sp.getFullPath();
- }
-
- private String thumbAndStorageOfFile(MultipartFile file, String ext, Integer width) throws Exception {
-
- Thumbnails.Builder fileBuilder = Thumbnails.of(file.getInputStream()).scale(1.0).outputQuality(1.0);
- BufferedImage src = fileBuilder.asBufferedImage();
-
- Integer w = src.getWidth(null);
- Integer destWidth = width == null || width > w ? w : width;
-
- ByteArrayOutputStream bouts = new ByteArrayOutputStream();
- Thumbnails.of(file.getInputStream()).width(destWidth).toOutputStream(bouts);
- InputStream ins = this.out2In(bouts);
- StorePath sp = storageClient.uploadFile(groupName, ins, bouts.size(), ext);
-// StorePath sp = storageClient.uploadFile(ins, bouts.size(), ext, null);
- bouts.close();
- ins.close();
- return sp.getFullPath();
- }
-
-
- /**
- * 杈撳嚭娴佽浆杈撳叆娴�
- *
- * @param outs
- * @return
- * @throws Exception
- */
- private InputStream out2In(ByteArrayOutputStream outs) throws Exception {
- InputStream ins = new ByteArrayInputStream(outs.toByteArray());
-
- return ins;
- }
-
-
-}
+//package com.ycl.utils;
+//
+//
+//import com.github.tobato.fastdfs.domain.fdfs.StorePath;
+//import com.github.tobato.fastdfs.domain.upload.FastImageFile;
+//import com.github.tobato.fastdfs.service.FastFileStorageClient;
+//import com.ycl.dto.media.PictureZoomParameter;
+//import com.ycl.dto.media.Media;
+//import net.coobird.thumbnailator.Thumbnails;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.beans.factory.annotation.Value;
+//import org.springframework.stereotype.Component;
+//import org.springframework.util.StringUtils;
+//import org.springframework.web.multipart.MultipartFile;
+//
+//import javax.annotation.PostConstruct;
+//import java.awt.image.BufferedImage;
+//import java.io.*;
+//import java.time.format.DateTimeFormatter;
+//import java.util.List;
+//import java.util.regex.Pattern;
+//
+//@Component
+//public class MediaFileUtil {
+//
+//
+// private static MediaFileUtil self;
+// @Value("${fdfs.groupName}")
+// private String groupName;
+//
+// @PostConstruct
+// private void init() {
+// self = this;
+// }
+//
+//
+// @Autowired
+// private FastFileStorageClient storageClient;
+//
+//
+// private static final Pattern videoPattern = Pattern.compile("((mp4|flv|avi|rm|rmvb|wmv)(jpg|png|gif|bmp))");
+//
+// @Value("${cfg.res}")
+// private String rootPath;
+//
+// private final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMM");
+//
+//
+// public MediaFileUtil() throws IOException {
+//
+// }
+//
+//
+// public static String uploadImage(InputStream in) throws IOException {
+//
+// return self.storageClient.uploadImage(new FastImageFile(in, in.available(), "jpg", null)).getFullPath();
+// }
+//
+//
+// public static String uploadImage(File file) throws IOException {
+//
+// FileInputStream in = new FileInputStream(file);
+// return self.storageClient.uploadImage(new FastImageFile(in, in.available(), "jpg", null)).getFullPath();
+// }
+//
+//
+// /**
+// * 鍒ゆ柇鏂囦欢绫诲瀷
+// *
+// * @param fileName
+// * @return
+// */
+// public Short getType(String fileName) {
+//
+// String ext = fileName.substring(fileName.lastIndexOf(".")).toLowerCase();
+//
+// if (".jpg".equals(ext) || ".jpeg".equals(ext) || ".png".equals(ext) || ".gif".equals(ext) || ".bmp".equals(ext)) {
+// return 1;
+// } else if (".mp4".equals(ext) || ".avi".equals(ext) || ".flv".equals(ext) || ".rm".equals(ext) || ".wmv".equals(ext)) {
+// return 2;
+// } else {
+// return 0;
+// }
+// }
+//
+// public Media save(MultipartFile file, PictureZoomParameter zoomPar) throws Exception {
+// String[] fs = file.getOriginalFilename().split("\\.");
+// String ext = fs[fs.length - 1];
+//
+// switch (this.getType(file.getOriginalFilename())) {
+// case 1:
+// return this.savePicture(file, ext, zoomPar);
+// case 2:
+// return this.saveVideo(file, ext);
+// default:
+// return new Media();
+// }
+// }
+//
+// public String savePicture(InputStream inputStream, String ext) throws Exception {
+// StorePath sp = storageClient.uploadFile(groupName, inputStream, inputStream.available(), ext);
+// return sp.getFullPath();
+// }
+//
+// public Media savePicture(MultipartFile file, String ext, PictureZoomParameter zoomPar) throws Exception {
+//
+// ByteArrayOutputStream outs = new ByteArrayOutputStream();
+// Media media = new Media();
+// media.setType(ext);
+// String path = null;
+// if (zoomPar.getWidth1() != null && zoomPar.getWidth1() > 0) {
+// path = this.thumbAndStorageOfFile(file, ext, zoomPar.getWidth1());
+// media.setUrl1(path);
+// }
+// if (zoomPar.getWidth2() != null && zoomPar.getWidth2() > 0) {
+// path = this.thumbAndStorageOfFile(file, ext, zoomPar.getWidth2());
+// media.setUrl2(path);
+// }
+// if (zoomPar.getWidth3() != null && zoomPar.getWidth3() > 0) {
+// path = this.thumbAndStorageOfFile(file, ext, zoomPar.getWidth3());
+// media.setUrl3(path);
+// }
+// // width4涓哄師鍥�
+// path = this.thumbAndStorageOfFile(file, ext, zoomPar.getWidth4());
+// media.setUrl4(path);
+// return media;
+// }
+//
+// /**
+// * 淇濆瓨瑙嗛鏂囦欢
+// *
+// * @param file
+// * @param ext
+// * @return
+// * @throws Exception
+// */
+// public Media saveVideo(MultipartFile file, String ext) throws Exception {
+//// StorePath sp = storageClient.uploadFile(file.getInputStream(), file.getSize(), ext, null);
+//
+// StorePath sp = storageClient.uploadFile(groupName, file.getInputStream(), file.getSize(), ext);
+// Media media = new Media();
+// media.setType(ext);
+// media.setUrl1(sp.getFullPath());
+// return media;
+// }
+//
+// /**
+// * 鍒犻櫎涓�涓枃浠�
+// *
+// * @param rootPath
+// */
+// public void removeFile(String rootPath) {
+// storageClient.deleteFile(rootPath);
+// }
+//
+// public void removeMedia(Media media) {
+// if (!StringUtils.isEmpty(media.getUrl1())) {
+// storageClient.deleteFile(media.getUrl1());
+// }
+// if (!StringUtils.isEmpty(media.getUrl2())) {
+// storageClient.deleteFile(media.getUrl2());
+// }
+// if (!StringUtils.isEmpty(media.getUrl3())) {
+// storageClient.deleteFile(media.getUrl3());
+// }
+// if (!StringUtils.isEmpty(media.getUrl4())) {
+// storageClient.deleteFile(media.getUrl4());
+// }
+// }
+//
+//
+// public void removeMedias(List<Media> medias) {
+// if (medias != null) {
+// for (Media m : medias) {
+// if (!StringUtils.isEmpty(m.getUrl1())) {
+// storageClient.deleteFile(m.getUrl1());
+// }
+// if (!StringUtils.isEmpty(m.getUrl2())) {
+// storageClient.deleteFile(m.getUrl2());
+// }
+// if (!StringUtils.isEmpty(m.getUrl3())) {
+// storageClient.deleteFile(m.getUrl3());
+// }
+// if (!StringUtils.isEmpty(m.getUrl4())) {
+// storageClient.deleteFile(m.getUrl4());
+// }
+// }
+// }
+//
+// }
+//
+// /**
+// * 鍒ゆ柇鏂囦欢鏄惁瀛樺湪
+// *
+// * @param url
+// * @return
+// */
+// public Boolean isEmpty(String url) {
+// return true;
+// }
+//
+// /**
+// * 缂╂斁骞朵笖涓婁紶
+// *
+// * @param in
+// * @param ext
+// * @param width
+// * @return
+// * @throws Exception
+// */
+// private String thumbAndStorage(InputStream in, String ext, Integer width) throws Exception {
+//
+// Thumbnails.Builder fileBuilder = Thumbnails.of(in).scale(1.0).outputQuality(1.0);
+// BufferedImage src = fileBuilder.asBufferedImage();
+//
+// Integer w = src.getWidth(null);
+// Integer destWidth = width > w ? w : width;
+//
+// ByteArrayOutputStream bouts = new ByteArrayOutputStream();
+// Thumbnails.of(in).width(destWidth).toOutputStream(bouts);
+// InputStream ins = this.out2In(bouts);
+//
+// StorePath sp = storageClient.uploadFile(groupName, ins, bouts.size(), ext);
+//// StorePath sp = storageClient.uploadFile(ins, bouts.size(), ext, null);
+// bouts.close();
+// ins.close();
+// return sp.getFullPath();
+// }
+//
+// private String thumbAndStorageOfFile(MultipartFile file, String ext, Integer width) throws Exception {
+//
+// Thumbnails.Builder fileBuilder = Thumbnails.of(file.getInputStream()).scale(1.0).outputQuality(1.0);
+// BufferedImage src = fileBuilder.asBufferedImage();
+//
+// Integer w = src.getWidth(null);
+// Integer destWidth = width == null || width > w ? w : width;
+//
+// ByteArrayOutputStream bouts = new ByteArrayOutputStream();
+// Thumbnails.of(file.getInputStream()).width(destWidth).toOutputStream(bouts);
+// InputStream ins = this.out2In(bouts);
+// StorePath sp = storageClient.uploadFile(groupName, ins, bouts.size(), ext);
+//// StorePath sp = storageClient.uploadFile(ins, bouts.size(), ext, null);
+// bouts.close();
+// ins.close();
+// return sp.getFullPath();
+// }
+//
+//
+// /**
+// * 杈撳嚭娴佽浆杈撳叆娴�
+// *
+// * @param outs
+// * @return
+// * @throws Exception
+// */
+// private InputStream out2In(ByteArrayOutputStream outs) throws Exception {
+// InputStream ins = new ByteArrayInputStream(outs.toByteArray());
+//
+// return ins;
+// }
+//
+//
+//}
diff --git a/ycl-platform/src/main/java/com/ycl/controller/ImageUploadController.java b/ycl-platform/src/main/java/com/ycl/controller/ImageUploadController.java
index 681daa0..4d76996 100644
--- a/ycl-platform/src/main/java/com/ycl/controller/ImageUploadController.java
+++ b/ycl-platform/src/main/java/com/ycl/controller/ImageUploadController.java
@@ -21,12 +21,12 @@
@RequestMapping("upload")
@Api(tags = "鍥剧墖涓婁紶")
public class ImageUploadController {
-
- @ApiOperation(value="涓婁紶鍥剧墖")
+ @ApiOperation(value="/image", notes = "涓婁紶鍥剧墖")
@RequestMapping(value = "/image", method = RequestMethod.POST)
public CommonResult uploadImage(HttpServletRequest request, MultipartFile image) throws IOException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
+
String filePath = "/images/" + sdf.format(new Date());
String imageFolderPath = request.getServletContext().getRealPath(filePath);
File imageFolder = new File(imageFolderPath);
@@ -42,6 +42,7 @@
.append(request.getServerPort())
.append(request.getContextPath())
.append(filePath);
+
String imageName = UUID.randomUUID() + "_" + image.getOriginalFilename().replaceAll(" ", "");
try {
IOUtils.write(image.getBytes(), new FileOutputStream(new File(imageFolder, imageName)));
@@ -50,6 +51,6 @@
} catch (IOException e) {
e.printStackTrace();
}
- return CommonResult.failed("涓婁紶澶辫触!");
+ return CommonResult.failed( "涓婁紶澶辫触!");
}
}
diff --git a/ycl-platform/src/main/resources/application.yml b/ycl-platform/src/main/resources/application.yml
index 7d4a767..d28d5a8 100644
--- a/ycl-platform/src/main/resources/application.yml
+++ b/ycl-platform/src/main/resources/application.yml
@@ -13,8 +13,10 @@
charset: UTF-8
enabled: true
force: true
+
servlet:
multipart:
+ location: D://files/upload/
max-file-size: -1
max-request-size: -1
# jackson:
diff --git a/ycl-platform/target/classes/META-INF/ycl-platform.kotlin_module b/ycl-platform/target/classes/META-INF/ycl-platform.kotlin_module
deleted file mode 100644
index a49347a..0000000
--- a/ycl-platform/target/classes/META-INF/ycl-platform.kotlin_module
+++ /dev/null
Binary files differ
diff --git a/ycl-platform/target/classes/application-dev.yml b/ycl-platform/target/classes/application-dev.yml
deleted file mode 100644
index 49c9401..0000000
--- a/ycl-platform/target/classes/application-dev.yml
+++ /dev/null
@@ -1,68 +0,0 @@
-server:
- port: 8082
- tomcat:
- uri-encoding: UTF-8
- servlet:
- context-path: /air
- compression: true
-
-fdfs:
- fileUrl: http://140.143.152.226:8410/
- groupName: sczhzf
- soTimeout: 1500
- connectTimeout: 600
- trackerList: #TrackerList鍙傛暟,鏀寔澶氫釜
- - 140.143.152.226:22122
-
-cfg:
- res: d://resources
- media-res: 140.143.152.226/media/
- snow-flake:
- datacenterId: 1
- machineId: 1
-
-spring:
- redis:
- database: 0
- host: 42.193.1.25
- port: 6379
- password: ycl2018
- jedis:
- pool:
- max-active: 8
- max-idle: 8
- min-idle: 0
- timeout: 0
-
- datasource:
- url: jdbc:mysql://42.193.1.25:3306/news_website?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false
- username: root
- password: 321$YcYl@1970!
- type: com.alibaba.druid.pool.DruidDataSource
- driver-class-name: com.mysql.cj.jdbc.Driver
- filters: stat
- maxActive: 20
- initialSize: 1
- maxWait: 60000
- minIdle: 1
- timeBetweenEvictionRunsMillis: 60000
- minEvictableIdleTimeMillis: 300000
- validationQuery: select 'x'
- testWhileIdle: true
- testOnBorrow: false
- testOnReturn: false
- poolPreparedStatements: true
- maxOpenPreparedStatements: 20
-e-mail:
- sendHost: smtp.qq.com
- username: 1723292425@qq.com
- password: qizcitupatzoeeij
-
-SMS:
- ecName: ycl
- apId: 1
- sign: sign
- url: http://localhost:8082/sccg/text/sms_res
-
-admin:
- defaultPassword: 111111
diff --git a/ycl-platform/target/classes/application-pro.yml b/ycl-platform/target/classes/application-pro.yml
deleted file mode 100644
index 110a0d0..0000000
--- a/ycl-platform/target/classes/application-pro.yml
+++ /dev/null
@@ -1,53 +0,0 @@
-server:
- port: 8081
- tomcat:
- uri-encoding: UTF-8
- servlet:
- context-path: /sccg
- compression: true
-
-fdfs:
- fileUrl: http://140.143.152.226:8410/
- groupName: sczhzf
- soTimeout: 1500
- connectTimeout: 600
- trackerList: #TrackerList鍙傛暟,鏀寔澶氫釜
- - 140.143.152.226:22122
- -
-cfg:
- res: d://resources
- media-res: 140.143.152.226/media/
- snow-flake:
- datacenterId: 1
- machineId: 1
-
-spring:
- redis:
- database: 0
- host: localhost
- password:
- jedis:
- pool:
- max-active: 8
- max-idle: 8
- min-idle: 0
- timeout: 0
- datasource:
- url: jdbc:mysql://42.193.1.25:3306/sccg?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false
- username: root
- password: 321$YcYl@1970!
- type: com.alibaba.druid.pool.DruidDataSource
- driver-class-name: com.mysql.cj.jdbc.Driver
- filters: stat
- maxActive: 20
- initialSize: 1
- maxWait: 60000
- minIdle: 1
- timeBetweenEvictionRunsMillis: 60000
- minEvictableIdleTimeMillis: 300000
- validationQuery: select 'x'
- testWhileIdle: true
- testOnBorrow: false
- testOnReturn: false
- poolPreparedStatements: true
- maxOpenPreparedStatements: 20
diff --git a/ycl-platform/target/classes/application.yml b/ycl-platform/target/classes/application.yml
deleted file mode 100644
index 0ec856e..0000000
--- a/ycl-platform/target/classes/application.yml
+++ /dev/null
@@ -1,60 +0,0 @@
-spring:
- profiles:
- active: dev
- main:
- allow-circular-references: true
- allow-bean-definition-overriding: true
- mvc:
- pathmatch:
- matching-strategy: ant_path_matcher
- application:
- name: sccg-platform
- http:
- charset: UTF-8
- enabled: true
- force: true
- servlet:
- multipart:
- max-file-size: -1
- max-request-size: -1
-# jackson:
-# default-property-inclusion: non_null
-
-
-management:
- health:
- rabbit:
- enabled: false
-
-jwt:
- tokenHeader: Authorization #JWT瀛樺偍鐨勮姹傚ご
- secret: platform-secret #JWT鍔犺В瀵嗕娇鐢ㄧ殑瀵嗛挜
- expiration: 604800 #JWT鐨勮秴鏈熼檺鏃堕棿(60*60*24*7)
- tokenHead: 'Bearer ' #JWT璐熻浇涓嬁鍒板紑澶�
-
-redis:
- database: sccg
- key:
- admin: 'ums:admin'
- resourceList: 'ums:menuList'
- expire:
- common: 86400 # 24灏忔椂
-
-#MP閰嶇疆
-mybatis-plus:
- mapper-locations: classpath*:mapper/**/*.xml
- global-config:
- db-config:
- id-type: auto
- #閫昏緫鍒犻櫎閰嶇疆瀛楁
- logic-delete-field:
- #閫昏緫鍒犻櫎閰嶇疆瀛楁 1 鍒犻櫎
- logic-delete-value: 1
- #閫昏緫鍒犻櫎閰嶇疆瀛楁 0 涓嶅垹闄�
- logic-not-delete-value: 0
-
-knife4j:
- enable: true
- #true鍒欐槸鐢熶骇鐜涓嶅厑璁歌闂甼nife4j
- production: false
-
diff --git a/ycl-platform/target/classes/logback-spring.xml b/ycl-platform/target/classes/logback-spring.xml
deleted file mode 100644
index cc1dfc0..0000000
--- a/ycl-platform/target/classes/logback-spring.xml
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration>
- <property name="LOG_HOME" value="${user.dir}/logs/ycl/platform" />
-
- <appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
- <encoder>
- <pattern>%d{H:mm} %-5level [%logger{16}] %msg%n</pattern>
- </encoder>
- </appender>
- <!-- class="ch.qos.logback.core.rolling.RollingFileAppender">-->
- <appender name="normalLog"
- class="ch.qos.logback.core.rolling.RollingFileAppender">
- <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
- <FileNamePattern>${LOG_HOME}/normal/%d{yyyy-MM-dd}/%i.log</FileNamePattern>
- <MaxHistory>30</MaxHistory>
- <maxFileSize>2MB</maxFileSize>
- </rollingPolicy>
- <!--<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
- <FileNamePattern>${LOG_HOME}/job.normal.%d{yyyy-MM-dd}.log
- </FileNamePattern>
- <MaxHistory>30</MaxHistory>
- </rollingPolicy>
- <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
- <maxFileSize>10MB</maxFileSize>
- </triggeringPolicy>-->
- <layout class="ch.qos.logback.classic.PatternLayout">
- <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{16} - %msg%n
- </pattern>
- </layout>
- <filter class="ch.qos.logback.classic.filter.LevelFilter">
- <level>ERROR</level>
- <onMatch>DENY</onMatch>
- <onMismatch>ACCEPT</onMismatch>
- </filter>
- </appender>
-
- <appender name="ASYNC-INFO" class="ch.qos.logback.classic.AsyncAppender">
- <discardingThreshold>0</discardingThreshold>
- <queueSize>256</queueSize>
- <appender-ref ref="normalLog"/>
- </appender>
-
-
-
- <appender name="errorLog"
- class="ch.qos.logback.core.rolling.RollingFileAppender">
-
- <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
- <FileNamePattern>${LOG_HOME}/error/%d{yyyy-MM-dd}/%i.log</FileNamePattern>
- <MaxHistory>30</MaxHistory>
- <maxFileSize>2MB</maxFileSize>
- </rollingPolicy>
- <!--<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
- <FileNamePattern>${LOG_HOME}/job.error.%d{yyyy-MM-dd}.log
- </FileNamePattern>
- <MaxHistory>30</MaxHistory>
- </rollingPolicy>
- <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
- <maxFileSize>10MB</maxFileSize>
- </triggeringPolicy>-->
- <layout class="ch.qos.logback.classic.PatternLayout">
- <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{16} - %msg%n
- </pattern>
- </layout>
- <filter class="ch.qos.logback.classic.filter.LevelFilter">
- <level>ERROR</level>
- <onMatch>ACCEPT</onMatch>
- <onMismatch>DENY</onMismatch>
- </filter>
- </appender>
-
-
-
- <appender name="ASYNC-ERROR" class="ch.qos.logback.classic.AsyncAppender">
- <discardingThreshold>0</discardingThreshold>
- <queueSize>256</queueSize>
- <appender-ref ref="errorLog"/>
- </appender>
-
- <appender name="ASYNC-CONSOLE" class="ch.qos.logback.classic.AsyncAppender">
- <discardingThreshold>0</discardingThreshold>
- <queueSize>256</queueSize>
- <appender-ref ref="Console"/>
- </appender>
-
-
-
-<!-- <logger name="com.ycl" level="debug" >
-
- </logger >-->
- <springProfile name="dev">
- <!--鎵撳嵃SQL-->
- <logger name="java.sql.Connection" level="DEBUG" />
- <logger name="java.sql.Statement" level="DEBUG" />
- <logger name="java.sql.PreparedStatement" level="DEBUG" />
-
- <logger name="com.ycl.component" level="error" />
-
- <logger name="com.ycl" level="debug" >
- <appender-ref ref="normalLog" />
- <appender-ref ref="errorLog" />
- </logger>
-
- <root level="info">
- <appender-ref ref="Console" />
- <appender-ref ref="normalLog" />
- <appender-ref ref="errorLog" />
- </root>
- </springProfile>
-
- <springProfile name="pro">
- <!--鎵撳嵃SQL-->
- <logger name="java.sql.Connection" level="ERROR" />
- <logger name="java.sql.Statement" level="ERROR" />
- <logger name="java.sql.PreparedStatement" level="ERROR" />
- <logger name="com.ycl" level="debug" >
- <appender-ref ref="normalLog" />
- <appender-ref ref="errorLog" />
- </logger>
- <root level="info">
- <appender-ref ref="Console" />
- </root>
- </springProfile>
-
-
-
-
-</configuration>
\ No newline at end of file
diff --git a/ycl-platform/target/classes/mapper/NewsAdminDao.xml b/ycl-platform/target/classes/mapper/NewsAdminDao.xml
deleted file mode 100644
index 62694b0..0000000
--- a/ycl-platform/target/classes/mapper/NewsAdminDao.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ycl.mapper.NewsAdminDao">
-
- <resultMap type="com.ycl.entity.NewsAdmin" id="NewsAdminMap">
- <result property="id" column="id" jdbcType="INTEGER"/>
- <result property="username" column="username" jdbcType="VARCHAR"/>
- <result property="password" column="password" jdbcType="VARCHAR"/>
- <result property="icon" column="icon" jdbcType="VARCHAR"/>
- <result property="email" column="email" jdbcType="VARCHAR"/>
- <result property="note" column="note" jdbcType="VARCHAR"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- <result property="status" column="status" jdbcType="INTEGER"/>
- <result property="sex" column="sex" jdbcType="INTEGER"/>
- <result property="mobile" column="mobile" jdbcType="VARCHAR"/>
- <result property="isGrid" column="is_grid" jdbcType="INTEGER"/>
- <result property="newsPoliceId" column="news_police_id" jdbcType="INTEGER"/>
- </resultMap>
-
- <!-- 鎵归噺鎻掑叆 -->
- <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
- insert into news_website.news_admin(username, password, icon, email, note, create_time, status, sex, mobile, is_grid, news_police_id)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.username}, #{entity.password}, #{entity.icon}, #{entity.email}, #{entity.note}, #{entity.createTime}, #{entity.status}, #{entity.sex}, #{entity.mobile}, #{entity.isGrid}, #{entity.newsPoliceId})
- </foreach>
- </insert>
- <!-- 鎵归噺鎻掑叆鎴栨寜涓婚敭鏇存柊 -->
- <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
- insert into news_website.news_admin(username, password, icon, email, note, create_time, status, sex, mobile, is_grid, news_police_id)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.username}, #{entity.password}, #{entity.icon}, #{entity.email}, #{entity.note}, #{entity.createTime}, #{entity.status}, #{entity.sex}, #{entity.mobile}, #{entity.isGrid}, #{entity.newsPoliceId})
- </foreach>
- on duplicate key update
- username = values(username) , password = values(password) , icon = values(icon) , email = values(email) , note = values(note) , create_time = values(create_time) , status = values(status) , sex = values(sex) , mobile = values(mobile) , is_grid = values(is_grid) , news_police_id = values(news_police_id) </insert>
-
-</mapper>
-
diff --git a/ycl-platform/target/classes/mapper/NewsChannelColumnDao.xml b/ycl-platform/target/classes/mapper/NewsChannelColumnDao.xml
deleted file mode 100644
index ec9b0f7..0000000
--- a/ycl-platform/target/classes/mapper/NewsChannelColumnDao.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ycl.mapper.NewsChannelColumnDao">
-
- <resultMap type="com.ycl.entity.NewsChannelColumn" id="NewsChannelColumnMap">
- <result property="id" column="id" jdbcType="INTEGER"/>
- <result property="channelId" column="channel_id" jdbcType="INTEGER"/>
- <result property="columnId" column="column_id" jdbcType="INTEGER"/>
- </resultMap>
-
- <!-- 鎵归噺鎻掑叆 -->
- <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
- insert into news_website.news_channel_column(channel_id, column_id)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.channelId}, #{entity.columnId})
- </foreach>
- </insert>
- <!-- 鎵归噺鎻掑叆鎴栨寜涓婚敭鏇存柊 -->
- <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
- insert into news_website.news_channel_column(channel_id, column_id)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.channelId}, #{entity.columnId})
- </foreach>
- on duplicate key update
- channel_id = values(channel_id) , column_id = values(column_id)
- </insert>
-
-</mapper>
-
diff --git a/ycl-platform/target/classes/mapper/NewsChannelDao.xml b/ycl-platform/target/classes/mapper/NewsChannelDao.xml
deleted file mode 100644
index 8ef9d38..0000000
--- a/ycl-platform/target/classes/mapper/NewsChannelDao.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ycl.mapper.NewsChannelDao">
-
- <resultMap type="com.ycl.entity.NewsChannel" id="NewsChannelMap">
- <result property="id" column="id" jdbcType="INTEGER"/>
- <result property="name" column="name" jdbcType="VARCHAR"/>
- <result property="code" column="code" jdbcType="VARCHAR"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- </resultMap>
-
- <!-- 鎵归噺鎻掑叆 -->
- <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
- insert into news_website.news_channel(name, code, create_time)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.name}, #{entity.code}, #{entity.createTime})
- </foreach>
- </insert>
- <!-- 鎵归噺鎻掑叆鎴栨寜涓婚敭鏇存柊 -->
- <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
- insert into news_website.news_channel(name, code, create_time)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.name}, #{entity.code}, #{entity.createTime})
- </foreach>
- on duplicate key update
- name = values(name) , code = values(code) , create_time = values(create_time)
- </insert>
-
- <insert id="insertOneChannel" keyProperty="id" useGeneratedKeys="true">
- insert into news_website.news_channel(name, code, create_time)
- values (#{entity.name}, #{entity.code}, #{entity.createTime})
- </insert>
-
- <select id="selectAllChannel" resultType="com.ycl.entity.NewsChannel">
- select * from news_channel
- </select>
-</mapper>
-
diff --git a/ycl-platform/target/classes/mapper/NewsColumnDao.xml b/ycl-platform/target/classes/mapper/NewsColumnDao.xml
deleted file mode 100644
index 140a9b9..0000000
--- a/ycl-platform/target/classes/mapper/NewsColumnDao.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ycl.mapper.NewsColumnDao">
-
- <resultMap type="com.ycl.entity.NewsColumn" id="NewsColumnMap">
- <result property="id" column="id" jdbcType="VARCHAR"/>
- <result property="name" column="name" jdbcType="VARCHAR"/>
- </resultMap>
-
- <!-- 鎵归噺鎻掑叆 -->
- <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
- insert into news_website.news_column(name)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.name})
- </foreach>
- </insert>
- <!-- 鎵归噺鎻掑叆鎴栨寜涓婚敭鏇存柊 -->
- <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
- insert into news_website.news_column(name)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.name})
- </foreach>
- on duplicate key update
- name = values(name) </insert>
-
-</mapper>
-
diff --git a/ycl-platform/target/classes/mapper/NewsColumnInformationDao.xml b/ycl-platform/target/classes/mapper/NewsColumnInformationDao.xml
deleted file mode 100644
index caa706d..0000000
--- a/ycl-platform/target/classes/mapper/NewsColumnInformationDao.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ycl.mapper.NewsColumnInformationDao">
-
- <resultMap type="com.ycl.entity.NewsColumnInformation" id="NewsColumnInformationMap">
- <result property="id" column="id" jdbcType="INTEGER"/>
- <result property="columnId" column="column_id" jdbcType="INTEGER"/>
- <result property="informationId" column="information_id" jdbcType="INTEGER"/>
- </resultMap>
-
- <!-- 鎵归噺鎻掑叆 -->
- <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
- insert into news_website.news_column_information(column_id, information_id)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.columnId}, #{entity.informationId})
- </foreach>
- </insert>
- <!-- 鎵归噺鎻掑叆鎴栨寜涓婚敭鏇存柊 -->
- <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
- insert into news_website.news_column_information(column_id, information_id)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.columnId}, #{entity.informationId})
- </foreach>
- on duplicate key update
- column_id = values(column_id) , information_id = values(information_id)
- </insert>
-
-</mapper>
-
diff --git a/ycl-platform/target/classes/mapper/NewsDepartmentDao.xml b/ycl-platform/target/classes/mapper/NewsDepartmentDao.xml
deleted file mode 100644
index aa279d1..0000000
--- a/ycl-platform/target/classes/mapper/NewsDepartmentDao.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ycl.mapper.NewsDepartmentDao">
-
- <resultMap type="com.ycl.entity.NewsDepartment" id="NewsDepartmentMap">
- <result property="id" column="id" jdbcType="INTEGER"/>
- <result property="deptname" column="deptname" jdbcType="VARCHAR"/>
- </resultMap>
-
- <!-- 鎵归噺鎻掑叆 -->
- <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
- insert into news_website.news_department(deptname)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.deptname})
- </foreach>
- </insert>
- <!-- 鎵归噺鎻掑叆鎴栨寜涓婚敭鏇存柊 -->
- <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
- insert into news_website.news_department(deptname)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.deptname})
- </foreach>
- on duplicate key update
- deptname = values(deptname) </insert>
-
-</mapper>
-
diff --git a/ycl-platform/target/classes/mapper/NewsDutyDao.xml b/ycl-platform/target/classes/mapper/NewsDutyDao.xml
deleted file mode 100644
index bbfc93b..0000000
--- a/ycl-platform/target/classes/mapper/NewsDutyDao.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ycl.mapper.NewsDutyDao">
-
- <resultMap type="com.ycl.entity.NewsDuty" id="NewsDutyMap">
- <result property="id" column="id" jdbcType="INTEGER"/>
- <result property="name" column="name" jdbcType="VARCHAR"/>
- <result property="jobTitle" column="job_title" jdbcType="VARCHAR"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- <result property="dutyTime" column="duty_time" jdbcType="TIMESTAMP"/>
- </resultMap>
-
- <!-- 鎵归噺鎻掑叆 -->
- <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
- insert into news_website.news_duty(name, job_title, create_time, duty_time)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.name}, #{entity.jobTitle}, #{entity.createTime}, #{entity.dutyTime})
- </foreach>
- </insert>
- <!-- 鎵归噺鎻掑叆鎴栨寜涓婚敭鏇存柊 -->
- <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
- insert into news_website.news_duty(name, job_title, create_time, duty_time)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.name}, #{entity.jobTitle}, #{entity.createTime}, #{entity.dutyTime})
- </foreach>
- on duplicate key update
- name = values(name) , job_title = values(job_title) , create_time = values(create_time) , duty_time = values(duty_time) </insert>
-
-</mapper>
-
diff --git a/ycl-platform/target/classes/mapper/NewsInformationDao.xml b/ycl-platform/target/classes/mapper/NewsInformationDao.xml
deleted file mode 100644
index a2921bd..0000000
--- a/ycl-platform/target/classes/mapper/NewsInformationDao.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ycl.mapper.NewsInformationDao">
-
- <resultMap type="com.ycl.entity.NewsInformation" id="NewsInformationMap">
- <result property="id" column="id" jdbcType="VARCHAR"/>
- <result property="title" column="title" jdbcType="VARCHAR"/>
- <result property="content" column="content" jdbcType="VARCHAR"/>
- <result property="publishTime" column="publish_time" jdbcType="TIMESTAMP"/>
- <result property="isSign" column="is_sign" jdbcType="INTEGER"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- <result property="sendTo" column="send_to" jdbcType="VARCHAR"/>
- <result property="imageUrl" column="image_url" jdbcType="VARCHAR"/>
- </resultMap>
-
- <!-- 鎵归噺鎻掑叆 -->
- <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
- insert into news_website.news_information(title, content, publish_time, is_sign, create_time, send_to, image_url)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.title}, #{entity.content}, #{entity.publishTime}, #{entity.isSign}, #{entity.createTime}, #{entity.sendTo}, #{entity.imageUrl})
- </foreach>
- </insert>
- <!-- 鎵归噺鎻掑叆鎴栨寜涓婚敭鏇存柊 -->
- <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
- insert into news_website.news_information(title, content, publish_time, is_sign, create_time, send_to, image_url)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.title}, #{entity.content}, #{entity.publishTime}, #{entity.isSign}, #{entity.createTime}, #{entity.sendTo}, #{entity.imageUrl})
- </foreach>
- on duplicate key update
- title = values(title) , content = values(content) , publish_time = values(publish_time) , is_sign = values(is_sign) , create_time = values(create_time) , send_to = values(send_to) , image_url = values(image_url) </insert>
-
- <insert id="insertOneInformation" keyProperty="id" useGeneratedKeys="true">
- insert into news_website.news_information(title, content, publish_time, is_sign, create_time, send_to, image_url)
- values (#{entity.title}, #{entity.content}, #{entity.publishTime}, #{entity.isSign}, #{entity.createTime}, #{entity.sendTo}, #{entity.imageUrl})
- </insert>
-
- <select id="selectInformationById" resultType="com.ycl.entity.NewsInformation" parameterType="int">
- select * from news_information where id=#{InformationId}
- </select>
-
- <select id="selectAllInformation" resultType="com.ycl.entity.NewsInformation">
- select * from news_information
- </select>
-
- <update id="updateInformationById" parameterType="com.ycl.entity.NewsInformation">
- update news_information set title=#{entity.title},content=#{entity.content},publish_time=#{entity.publishTime}, is_sign=#{entity.isSign}, create_time=#{entity.createTime}, send_to=#{entity.sendTo}, image_url=#{entity.imageUrl}
- where id=#{entity.id}
- </update>
-</mapper>
-
diff --git a/ycl-platform/target/classes/mapper/NewsInformationPoliceDao.xml b/ycl-platform/target/classes/mapper/NewsInformationPoliceDao.xml
deleted file mode 100644
index 4111482..0000000
--- a/ycl-platform/target/classes/mapper/NewsInformationPoliceDao.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ycl.mapper.NewsInformationPoliceDao">
-
- <resultMap type="com.ycl.entity.NewsInformationPolice" id="NewsInformationPoliceMap">
- <result property="id" column="id" jdbcType="INTEGER"/>
- <result property="newsInformationId" column="news_information_id" jdbcType="INTEGER"/>
- <result property="newsPoliceId" column="news_police_id" jdbcType="INTEGER"/>
- <result property="isSign" column="is_sign" jdbcType="INTEGER"/>
- </resultMap>
-
- <!-- 鎵归噺鎻掑叆 -->
- <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
- insert into news_website.news_information_police(news_information_id, news_police_id, is_sign)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.newsInformationId}, #{entity.newsPoliceId}, #{entity.isSign})
- </foreach>
- </insert>
- <!-- 鎵归噺鎻掑叆鎴栨寜涓婚敭鏇存柊 -->
- <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
- insert into news_website.news_information_police(news_information_id, news_police_id, is_sign)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.newsInformationId}, #{entity.newsPoliceId}, #{entity.isSign})
- </foreach>
- on duplicate key update
- news_information_id = values(news_information_id) , news_police_id = values(news_police_id) , is_sign = values(is_sign) </insert>
-
-</mapper>
-
diff --git a/ycl-platform/target/classes/mapper/NewsIpDao.xml b/ycl-platform/target/classes/mapper/NewsIpDao.xml
deleted file mode 100644
index ae73d25..0000000
--- a/ycl-platform/target/classes/mapper/NewsIpDao.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ycl.mapper.NewsIpDao">
-
- <resultMap type="com.ycl.entity.NewsIp" id="NewsIpMap">
- <result property="id" column="id" jdbcType="INTEGER"/>
- <result property="ipAddess" column="ip_addess" jdbcType="VARCHAR"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- </resultMap>
-
- <!-- 鎵归噺鎻掑叆 -->
- <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
- insert into news_website.news_ip(ip_addess, create_time)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.ipAddess}, #{entity.createTime})
- </foreach>
- </insert>
- <!-- 鎵归噺鎻掑叆鎴栨寜涓婚敭鏇存柊 -->
- <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
- insert into news_website.news_ip(ip_addess, create_time)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.ipAddess}, #{entity.createTime})
- </foreach>
- on duplicate key update
- ip_addess = values(ip_addess) , create_time = values(create_time) </insert>
-
-</mapper>
-
diff --git a/ycl-platform/target/classes/mapper/NewsPoliceDao.xml b/ycl-platform/target/classes/mapper/NewsPoliceDao.xml
deleted file mode 100644
index 87d118b..0000000
--- a/ycl-platform/target/classes/mapper/NewsPoliceDao.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ycl.mapper.NewsPoliceDao">
-
- <resultMap type="com.ycl.entity.NewsPolice" id="NewsPoliceMap">
- <result property="id" column="id" jdbcType="VARCHAR"/>
- <result property="rname" column="rname" jdbcType="VARCHAR"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
- <result property="newsDepartmentId" column="news_department_id" jdbcType="VARCHAR"/>
- <result property="phone" column="phone" jdbcType="VARCHAR"/>
- </resultMap>
-
- <!-- 鎵归噺鎻掑叆 -->
- <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
- insert into news_website.news_police(rname, create_time, update_time, news_department_id, phone)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.rname}, #{entity.createTime}, #{entity.updateTime}, #{entity.newsDepartmentId}, #{entity.phone})
- </foreach>
- </insert>
- <!-- 鎵归噺鎻掑叆鎴栨寜涓婚敭鏇存柊 -->
- <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
- insert into news_website.news_police(rname, create_time, update_time, news_department_id, phone)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.rname}, #{entity.createTime}, #{entity.updateTime}, #{entity.newsDepartmentId}, #{entity.phone})
- </foreach>
- on duplicate key update
- rname = values(rname) , create_time = values(create_time) , update_time = values(update_time) , news_department_id = values(news_department_id) , phone = values(phone) </insert>
-
- <insert id="savePolice" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
- insert into news_website.news_police(rname, create_time, update_time, news_department_id, phone)
- values (#{entity.rname}, #{entity.createTime}, #{entity.updateTime}, #{entity.newsDepartmentId}, #{entity.phone})
- </insert>
-</mapper>
-
--
Gitblit v1.8.0