文件存储时记录数据库
parent
a327ff26ba
commit
eae6443f11
|
|
@ -98,6 +98,34 @@
|
|||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "文件上传",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [],
|
||||
"body": {
|
||||
"mode": "formdata",
|
||||
"formdata": [
|
||||
{
|
||||
"key": "file",
|
||||
"type": "file",
|
||||
"src": "/E:/图库/AGVCar02.png"
|
||||
}
|
||||
]
|
||||
},
|
||||
"url": {
|
||||
"raw": "{{baseUrl}}/file/upload",
|
||||
"host": [
|
||||
"{{baseUrl}}"
|
||||
],
|
||||
"path": [
|
||||
"file",
|
||||
"upload"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
}
|
||||
],
|
||||
"auth": {
|
||||
|
|
|
|||
|
|
@ -2,11 +2,10 @@ package com.ruoyi.common.core.utils.file;
|
|||
|
||||
/**
|
||||
* 媒体类型工具类
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class MimeTypeUtils
|
||||
{
|
||||
public class MimeTypeUtils {
|
||||
public static final String IMAGE_PNG = "image/png";
|
||||
|
||||
public static final String IMAGE_JPG = "image/jpg";
|
||||
|
|
@ -17,14 +16,14 @@ public class MimeTypeUtils
|
|||
|
||||
public static final String IMAGE_GIF = "image/gif";
|
||||
|
||||
public static final String[] IMAGE_EXTENSION = { "bmp", "gif", "jpg", "jpeg", "png" };
|
||||
public static final String[] IMAGE_EXTENSION = {"bmp", "gif", "jpg", "jpeg", "png"};
|
||||
|
||||
public static final String[] FLASH_EXTENSION = { "swf", "flv" };
|
||||
public static final String[] FLASH_EXTENSION = {"swf", "flv"};
|
||||
|
||||
public static final String[] MEDIA_EXTENSION = { "swf", "flv", "mp3", "wav", "wma", "wmv", "mid", "avi", "mpg",
|
||||
"asf", "rm", "rmvb" };
|
||||
public static final String[] MEDIA_EXTENSION = {"swf", "flv", "mp3", "wav", "wma", "wmv", "mid", "avi", "mpg",
|
||||
"asf", "rm", "rmvb"};
|
||||
|
||||
public static final String[] VIDEO_EXTENSION = { "mp4", "avi", "rmvb" };
|
||||
public static final String[] VIDEO_EXTENSION = {"mp4", "avi", "rmvb"};
|
||||
|
||||
public static final String[] DEFAULT_ALLOWED_EXTENSION = {
|
||||
// 图片
|
||||
|
|
@ -36,12 +35,11 @@ public class MimeTypeUtils
|
|||
// 视频格式
|
||||
"mp4", "avi", "rmvb",
|
||||
// pdf
|
||||
"pdf" };
|
||||
"pdf",
|
||||
};
|
||||
|
||||
public static String getExtension(String prefix)
|
||||
{
|
||||
switch (prefix)
|
||||
{
|
||||
public static String getExtension(String prefix) {
|
||||
switch (prefix) {
|
||||
case IMAGE_PNG:
|
||||
return "png";
|
||||
case IMAGE_JPG:
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
<version>${druid.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Dynamic DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
|
|
|
|||
|
|
@ -19,13 +19,7 @@
|
|||
<!-- RuoYi Common Security -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-log</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webmvc</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
<artifactId>ruoyi-common-security</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.ruoyi.common.services.config;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.FilterType;
|
||||
|
||||
/**
|
||||
* 本模块全局配置
|
||||
|
|
@ -9,10 +11,15 @@ import org.springframework.context.annotation.Configuration;
|
|||
* @author Alan Scipio
|
||||
* created on 2024/2/19
|
||||
*/
|
||||
@ComponentScan("com.ruoyi.common.services")
|
||||
@MapperScan("com.ruoyi.common.services.mapper")
|
||||
@ComponentScan(value = "com.ruoyi.common.services", excludeFilters = {
|
||||
@ComponentScan.Filter(type = FilterType.REGEX, pattern = "com.ruoyi.common.services.mapper.*"),
|
||||
})
|
||||
@Configuration
|
||||
public class ServicesConfig {
|
||||
|
||||
|
||||
public ServicesConfig() {
|
||||
System.out.println("Common Module ServicesConfig init");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
package com.ruoyi.common.services.constants;
|
||||
|
||||
import com.ruoyi.common.core.constant.IEnum;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author Alan Scipio
|
||||
* created on 2024/2/19
|
||||
*/
|
||||
@Getter
|
||||
public enum FileStorageType implements IEnum {
|
||||
|
||||
LOCAL(1, "本地文件存储"),
|
||||
|
||||
FAST_DFS(2, "FastDFS文件存储"),
|
||||
|
||||
MINIO(3, "MinIO文件存储"),
|
||||
|
||||
;
|
||||
|
||||
private final int code;
|
||||
private final String name;
|
||||
|
||||
FileStorageType(int code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
package com.ruoyi.common.services.domain;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* This class was generated by MyBatis Generator.
|
||||
*
|
||||
* <ul>
|
||||
* <li> Table: sys_file </li>
|
||||
* <li> Remarks: 文件存储记录表 </li>
|
||||
* </ul>
|
||||
*
|
||||
* @author ryas
|
||||
* created on 2024-02-19
|
||||
*/
|
||||
public class SysFile extends BaseEntity implements Serializable {
|
||||
/**
|
||||
* 文件ID
|
||||
*/
|
||||
private String fileId;
|
||||
|
||||
/**
|
||||
* 保存的文件名称
|
||||
*/
|
||||
private String savedName;
|
||||
|
||||
/**
|
||||
* 原始文件名称
|
||||
*/
|
||||
private String originalName;
|
||||
|
||||
/**
|
||||
* 文件路径
|
||||
*/
|
||||
private String filePath;
|
||||
|
||||
/**
|
||||
* 文件后缀
|
||||
*/
|
||||
private String extension;
|
||||
|
||||
/**
|
||||
* 存储方式
|
||||
*/
|
||||
private String storageType;
|
||||
|
||||
/**
|
||||
* 获取文件的URL
|
||||
*/
|
||||
private String requestUrl;
|
||||
|
||||
/**
|
||||
* 文件大小(Byte)
|
||||
*/
|
||||
private Long fileSize;
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public String getFileId() {
|
||||
return fileId;
|
||||
}
|
||||
|
||||
public void setFileId(String fileId) {
|
||||
this.fileId = fileId == null ? null : fileId.trim();
|
||||
}
|
||||
|
||||
public String getSavedName() {
|
||||
return savedName;
|
||||
}
|
||||
|
||||
public void setSavedName(String savedName) {
|
||||
this.savedName = savedName == null ? null : savedName.trim();
|
||||
}
|
||||
|
||||
public String getOriginalName() {
|
||||
return originalName;
|
||||
}
|
||||
|
||||
public void setOriginalName(String originalName) {
|
||||
this.originalName = originalName == null ? null : originalName.trim();
|
||||
}
|
||||
|
||||
public String getFilePath() {
|
||||
return filePath;
|
||||
}
|
||||
|
||||
public void setFilePath(String filePath) {
|
||||
this.filePath = filePath == null ? null : filePath.trim();
|
||||
}
|
||||
|
||||
public String getExtension() {
|
||||
return extension;
|
||||
}
|
||||
|
||||
public void setExtension(String extension) {
|
||||
this.extension = extension == null ? null : extension.trim();
|
||||
}
|
||||
|
||||
public String getStorageType() {
|
||||
return storageType;
|
||||
}
|
||||
|
||||
public void setStorageType(String storageType) {
|
||||
this.storageType = storageType == null ? null : storageType.trim();
|
||||
}
|
||||
|
||||
public String getRequestUrl() {
|
||||
return requestUrl;
|
||||
}
|
||||
|
||||
public void setRequestUrl(String requestUrl) {
|
||||
this.requestUrl = requestUrl == null ? null : requestUrl.trim();
|
||||
}
|
||||
|
||||
public Long getFileSize() {
|
||||
return fileSize;
|
||||
}
|
||||
|
||||
public void setFileSize(Long fileSize) {
|
||||
this.fileSize = fileSize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getClass().getSimpleName());
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", fileId=").append(fileId);
|
||||
sb.append(", savedName=").append(savedName);
|
||||
sb.append(", originalName=").append(originalName);
|
||||
sb.append(", filePath=").append(filePath);
|
||||
sb.append(", extension=").append(extension);
|
||||
sb.append(", storageType=").append(storageType);
|
||||
sb.append(", requestUrl=").append(requestUrl);
|
||||
sb.append(", fileSize=").append(fileSize);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
package com.ruoyi.common.services.mapper;
|
||||
|
||||
import org.mybatis.dynamic.sql.AliasableSqlTable;
|
||||
import org.mybatis.dynamic.sql.SqlColumn;
|
||||
|
||||
import java.sql.JDBCType;
|
||||
import java.util.Date;
|
||||
|
||||
public final class SysFileDynamicSqlSupport {
|
||||
public static final SysFile sysFile = new SysFile();
|
||||
|
||||
/**
|
||||
* 文件ID
|
||||
*/
|
||||
public static final SqlColumn<String> fileId = sysFile.fileId;
|
||||
|
||||
/**
|
||||
* 保存的文件名称
|
||||
*/
|
||||
public static final SqlColumn<String> savedName = sysFile.savedName;
|
||||
|
||||
/**
|
||||
* 原始文件名称
|
||||
*/
|
||||
public static final SqlColumn<String> originalName = sysFile.originalName;
|
||||
|
||||
/**
|
||||
* 文件路径
|
||||
*/
|
||||
public static final SqlColumn<String> filePath = sysFile.filePath;
|
||||
|
||||
/**
|
||||
* 文件后缀
|
||||
*/
|
||||
public static final SqlColumn<String> extension = sysFile.extension;
|
||||
|
||||
/**
|
||||
* 存储方式
|
||||
*/
|
||||
public static final SqlColumn<String> storageType = sysFile.storageType;
|
||||
|
||||
/**
|
||||
* 获取文件的URL
|
||||
*/
|
||||
public static final SqlColumn<String> requestUrl = sysFile.requestUrl;
|
||||
|
||||
/**
|
||||
* 文件大小(Byte)
|
||||
*/
|
||||
public static final SqlColumn<Long> fileSize = sysFile.fileSize;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
public static final SqlColumn<String> createBy = sysFile.createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
public static final SqlColumn<Date> createTime = sysFile.createTime;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
public static final SqlColumn<String> updateBy = sysFile.updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
public static final SqlColumn<Date> updateTime = sysFile.updateTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
public static final SqlColumn<String> remark = sysFile.remark;
|
||||
|
||||
public static final class SysFile extends AliasableSqlTable<SysFile> {
|
||||
public final SqlColumn<String> fileId = column("file_id", JDBCType.VARCHAR);
|
||||
|
||||
public final SqlColumn<String> savedName = column("saved_name", JDBCType.VARCHAR);
|
||||
|
||||
public final SqlColumn<String> originalName = column("original_name", JDBCType.VARCHAR);
|
||||
|
||||
public final SqlColumn<String> filePath = column("file_path", JDBCType.VARCHAR);
|
||||
|
||||
public final SqlColumn<String> extension = column("extension", JDBCType.VARCHAR);
|
||||
|
||||
public final SqlColumn<String> storageType = column("storage_type", JDBCType.VARCHAR);
|
||||
|
||||
public final SqlColumn<String> requestUrl = column("request_url", JDBCType.VARCHAR);
|
||||
|
||||
public final SqlColumn<Long> fileSize = column("file_size", JDBCType.BIGINT);
|
||||
|
||||
public final SqlColumn<String> createBy = column("create_by", JDBCType.VARCHAR);
|
||||
|
||||
public final SqlColumn<Date> createTime = column("create_time", JDBCType.TIMESTAMP);
|
||||
|
||||
public final SqlColumn<String> updateBy = column("update_by", JDBCType.VARCHAR);
|
||||
|
||||
public final SqlColumn<Date> updateTime = column("update_time", JDBCType.TIMESTAMP);
|
||||
|
||||
public final SqlColumn<String> remark = column("remark", JDBCType.VARCHAR);
|
||||
|
||||
public SysFile() {
|
||||
super("sys_file", SysFile::new);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,215 @@
|
|||
package com.ruoyi.common.services.mapper;
|
||||
|
||||
import com.ruoyi.common.security.utils.SecurityUtilsExt;
|
||||
import com.ruoyi.common.services.domain.SysFile;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
import org.mybatis.dynamic.sql.BasicColumn;
|
||||
import org.mybatis.dynamic.sql.delete.DeleteDSLCompleter;
|
||||
import org.mybatis.dynamic.sql.select.CountDSLCompleter;
|
||||
import org.mybatis.dynamic.sql.select.SelectDSLCompleter;
|
||||
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
|
||||
import org.mybatis.dynamic.sql.update.UpdateDSL;
|
||||
import org.mybatis.dynamic.sql.update.UpdateDSLCompleter;
|
||||
import org.mybatis.dynamic.sql.update.UpdateModel;
|
||||
import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
|
||||
import org.mybatis.dynamic.sql.util.mybatis3.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import static com.ruoyi.common.services.mapper.SysFileDynamicSqlSupport.*;
|
||||
import static org.mybatis.dynamic.sql.SqlBuilder.isEqualTo;
|
||||
|
||||
@Mapper
|
||||
public interface SysFileMapper extends CommonCountMapper, CommonDeleteMapper, CommonInsertMapper<SysFile>, CommonUpdateMapper {
|
||||
BasicColumn[] selectList = BasicColumn.columnList(fileId, savedName, originalName, filePath, extension, storageType, requestUrl, fileSize, createBy, createTime, updateBy, updateTime, remark);
|
||||
|
||||
@SelectProvider(type=SqlProviderAdapter.class, method="select")
|
||||
@Results(id="SysFileResult", value = {
|
||||
@Result(column="file_id", property="fileId", jdbcType=JdbcType.VARCHAR, id=true),
|
||||
@Result(column="saved_name", property="savedName", jdbcType=JdbcType.VARCHAR),
|
||||
@Result(column="original_name", property="originalName", jdbcType=JdbcType.VARCHAR),
|
||||
@Result(column="file_path", property="filePath", jdbcType=JdbcType.VARCHAR),
|
||||
@Result(column="extension", property="extension", jdbcType=JdbcType.VARCHAR),
|
||||
@Result(column="storage_type", property="storageType", jdbcType=JdbcType.VARCHAR),
|
||||
@Result(column="request_url", property="requestUrl", jdbcType=JdbcType.VARCHAR),
|
||||
@Result(column="file_size", property="fileSize", jdbcType=JdbcType.BIGINT),
|
||||
@Result(column="create_by", property="createBy", jdbcType=JdbcType.VARCHAR),
|
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
|
||||
@Result(column="update_by", property="updateBy", jdbcType=JdbcType.VARCHAR),
|
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
|
||||
@Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR)
|
||||
})
|
||||
List<SysFile> selectMany(SelectStatementProvider selectStatement);
|
||||
|
||||
@SelectProvider(type=SqlProviderAdapter.class, method="select")
|
||||
@ResultMap("SysFileResult")
|
||||
Optional<SysFile> selectOne(SelectStatementProvider selectStatement);
|
||||
|
||||
default long count(CountDSLCompleter completer) {
|
||||
return MyBatis3Utils.countFrom(this::count, sysFile, completer);
|
||||
}
|
||||
|
||||
default int delete(DeleteDSLCompleter completer) {
|
||||
return MyBatis3Utils.deleteFrom(this::delete, sysFile, completer);
|
||||
}
|
||||
|
||||
default int deleteByPrimaryKey(String fileId_) {
|
||||
return delete(c ->
|
||||
c.where(fileId, isEqualTo(fileId_))
|
||||
);
|
||||
}
|
||||
|
||||
default int insert(SysFile row) {
|
||||
row.setCommonForInsert(SecurityUtilsExt.getUserIdStr());
|
||||
return MyBatis3Utils.insert(this::insert, row, sysFile, c ->
|
||||
c.map(fileId).toProperty("fileId")
|
||||
.map(savedName).toProperty("savedName")
|
||||
.map(originalName).toProperty("originalName")
|
||||
.map(filePath).toProperty("filePath")
|
||||
.map(extension).toProperty("extension")
|
||||
.map(storageType).toProperty("storageType")
|
||||
.map(requestUrl).toProperty("requestUrl")
|
||||
.map(fileSize).toProperty("fileSize")
|
||||
.map(createBy).toProperty("createBy")
|
||||
.map(createTime).toProperty("createTime")
|
||||
.map(updateBy).toProperty("updateBy")
|
||||
.map(updateTime).toProperty("updateTime")
|
||||
.map(remark).toProperty("remark")
|
||||
);
|
||||
}
|
||||
|
||||
default int insertMultiple(Collection<SysFile> records) {
|
||||
for (SysFile row : records) {
|
||||
row.setCommonForInsert(SecurityUtilsExt.getUserIdStr());
|
||||
}
|
||||
return MyBatis3Utils.insertMultiple(this::insertMultiple, records, sysFile, c ->
|
||||
c.map(fileId).toProperty("fileId")
|
||||
.map(savedName).toProperty("savedName")
|
||||
.map(originalName).toProperty("originalName")
|
||||
.map(filePath).toProperty("filePath")
|
||||
.map(extension).toProperty("extension")
|
||||
.map(storageType).toProperty("storageType")
|
||||
.map(requestUrl).toProperty("requestUrl")
|
||||
.map(fileSize).toProperty("fileSize")
|
||||
.map(createBy).toProperty("createBy")
|
||||
.map(createTime).toProperty("createTime")
|
||||
.map(updateBy).toProperty("updateBy")
|
||||
.map(updateTime).toProperty("updateTime")
|
||||
.map(remark).toProperty("remark")
|
||||
);
|
||||
}
|
||||
|
||||
default int insertSelective(SysFile row) {
|
||||
row.setCommonForInsert(SecurityUtilsExt.getUserIdStr());
|
||||
return MyBatis3Utils.insert(this::insert, row, sysFile, c ->
|
||||
c.map(fileId).toPropertyWhenPresent("fileId", row::getFileId)
|
||||
.map(savedName).toPropertyWhenPresent("savedName", row::getSavedName)
|
||||
.map(originalName).toPropertyWhenPresent("originalName", row::getOriginalName)
|
||||
.map(filePath).toPropertyWhenPresent("filePath", row::getFilePath)
|
||||
.map(extension).toPropertyWhenPresent("extension", row::getExtension)
|
||||
.map(storageType).toPropertyWhenPresent("storageType", row::getStorageType)
|
||||
.map(requestUrl).toPropertyWhenPresent("requestUrl", row::getRequestUrl)
|
||||
.map(fileSize).toPropertyWhenPresent("fileSize", row::getFileSize)
|
||||
.map(createBy).toPropertyWhenPresent("createBy", row::getCreateBy)
|
||||
.map(createTime).toPropertyWhenPresent("createTime", row::getCreateTime)
|
||||
.map(updateBy).toPropertyWhenPresent("updateBy", row::getUpdateBy)
|
||||
.map(updateTime).toPropertyWhenPresent("updateTime", row::getUpdateTime)
|
||||
.map(remark).toPropertyWhenPresent("remark", row::getRemark)
|
||||
);
|
||||
}
|
||||
|
||||
default Optional<SysFile> selectOne(SelectDSLCompleter completer) {
|
||||
return MyBatis3Utils.selectOne(this::selectOne, selectList, sysFile, completer);
|
||||
}
|
||||
|
||||
default List<SysFile> select(SelectDSLCompleter completer) {
|
||||
return MyBatis3Utils.selectList(this::selectMany, selectList, sysFile, completer);
|
||||
}
|
||||
|
||||
default List<SysFile> selectDistinct(SelectDSLCompleter completer) {
|
||||
return MyBatis3Utils.selectDistinct(this::selectMany, selectList, sysFile, completer);
|
||||
}
|
||||
|
||||
default Optional<SysFile> selectByPrimaryKey(String fileId_) {
|
||||
return selectOne(c ->
|
||||
c.where(fileId, isEqualTo(fileId_))
|
||||
);
|
||||
}
|
||||
|
||||
default int update(UpdateDSLCompleter completer) {
|
||||
return MyBatis3Utils.update(this::update, sysFile, completer);
|
||||
}
|
||||
|
||||
static UpdateDSL<UpdateModel> updateAllColumns(SysFile row, UpdateDSL<UpdateModel> dsl) {
|
||||
return dsl.set(fileId).equalTo(row::getFileId)
|
||||
.set(savedName).equalTo(row::getSavedName)
|
||||
.set(originalName).equalTo(row::getOriginalName)
|
||||
.set(filePath).equalTo(row::getFilePath)
|
||||
.set(extension).equalTo(row::getExtension)
|
||||
.set(storageType).equalTo(row::getStorageType)
|
||||
.set(requestUrl).equalTo(row::getRequestUrl)
|
||||
.set(fileSize).equalTo(row::getFileSize)
|
||||
.set(createBy).equalTo(row::getCreateBy)
|
||||
.set(createTime).equalTo(row::getCreateTime)
|
||||
.set(updateBy).equalTo(row::getUpdateBy)
|
||||
.set(updateTime).equalTo(row::getUpdateTime)
|
||||
.set(remark).equalTo(row::getRemark);
|
||||
}
|
||||
|
||||
static UpdateDSL<UpdateModel> updateSelectiveColumns(SysFile row, UpdateDSL<UpdateModel> dsl) {
|
||||
row.setCommonForUpdate(SecurityUtilsExt.getUserIdStr());
|
||||
return dsl.set(fileId).equalToWhenPresent(row::getFileId)
|
||||
.set(savedName).equalToWhenPresent(row::getSavedName)
|
||||
.set(originalName).equalToWhenPresent(row::getOriginalName)
|
||||
.set(filePath).equalToWhenPresent(row::getFilePath)
|
||||
.set(extension).equalToWhenPresent(row::getExtension)
|
||||
.set(storageType).equalToWhenPresent(row::getStorageType)
|
||||
.set(requestUrl).equalToWhenPresent(row::getRequestUrl)
|
||||
.set(fileSize).equalToWhenPresent(row::getFileSize)
|
||||
.set(createBy).equalToWhenPresent(row::getCreateBy)
|
||||
.set(createTime).equalToWhenPresent(row::getCreateTime)
|
||||
.set(updateBy).equalToWhenPresent(row::getUpdateBy)
|
||||
.set(updateTime).equalToWhenPresent(row::getUpdateTime)
|
||||
.set(remark).equalToWhenPresent(row::getRemark);
|
||||
}
|
||||
|
||||
default int updateByPrimaryKey(SysFile row) {
|
||||
return update(c ->
|
||||
c.set(savedName).equalTo(row::getSavedName)
|
||||
.set(originalName).equalTo(row::getOriginalName)
|
||||
.set(filePath).equalTo(row::getFilePath)
|
||||
.set(extension).equalTo(row::getExtension)
|
||||
.set(storageType).equalTo(row::getStorageType)
|
||||
.set(requestUrl).equalTo(row::getRequestUrl)
|
||||
.set(fileSize).equalTo(row::getFileSize)
|
||||
.set(createBy).equalTo(row::getCreateBy)
|
||||
.set(createTime).equalTo(row::getCreateTime)
|
||||
.set(updateBy).equalTo(row::getUpdateBy)
|
||||
.set(updateTime).equalTo(row::getUpdateTime)
|
||||
.set(remark).equalTo(row::getRemark)
|
||||
.where(fileId, isEqualTo(row::getFileId))
|
||||
);
|
||||
}
|
||||
|
||||
default int updateByPrimaryKeySelective(SysFile row) {
|
||||
row.setCommonForUpdate(SecurityUtilsExt.getUserIdStr());
|
||||
return update(c ->
|
||||
c.set(savedName).equalToWhenPresent(row::getSavedName)
|
||||
.set(originalName).equalToWhenPresent(row::getOriginalName)
|
||||
.set(filePath).equalToWhenPresent(row::getFilePath)
|
||||
.set(extension).equalToWhenPresent(row::getExtension)
|
||||
.set(storageType).equalToWhenPresent(row::getStorageType)
|
||||
.set(requestUrl).equalToWhenPresent(row::getRequestUrl)
|
||||
.set(fileSize).equalToWhenPresent(row::getFileSize)
|
||||
.set(createBy).equalToWhenPresent(row::getCreateBy)
|
||||
.set(createTime).equalToWhenPresent(row::getCreateTime)
|
||||
.set(updateBy).equalToWhenPresent(row::getUpdateBy)
|
||||
.set(updateTime).equalToWhenPresent(row::getUpdateTime)
|
||||
.set(remark).equalToWhenPresent(row::getRemark)
|
||||
.where(fileId, isEqualTo(row::getFileId))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -16,8 +16,8 @@
|
|||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- FastDFS -->
|
||||
<dependency>
|
||||
<groupId>com.github.tobato</groupId>
|
||||
|
|
@ -65,12 +65,30 @@
|
|||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-api-system</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-swagger</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Services -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-services</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Datasource-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
|
|
|||
|
|
@ -8,16 +8,14 @@ import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
|
|||
|
||||
/**
|
||||
* 文件服务
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@ConditionalOnProperty(name = "spring.cloud.nacos.config.group", havingValue = "DEFAULT_GROUP", matchIfMissing = true)
|
||||
@EnableCustomSwagger2
|
||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
|
||||
public class RuoYiFileApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
|
||||
public class RuoYiFileApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(RuoYiFileApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 文件服务模块启动成功 ლ(´ڡ`ლ)゙");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import com.ruoyi.system.api.domain.SysFile;
|
|||
*/
|
||||
@RestController
|
||||
public class SysFileController {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(SysFileController.class);
|
||||
|
||||
@Autowired
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
package com.ruoyi.file.domain;
|
||||
|
||||
import com.ruoyi.file.utils.FileUploadResult;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Alan Scipio
|
||||
* created on 2024/2/19
|
||||
*/
|
||||
@Data
|
||||
public class FileSaveRecord implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String requestUrl;
|
||||
|
||||
private FileUploadResult uploadResult;
|
||||
|
||||
}
|
||||
|
|
@ -4,17 +4,16 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
|
||||
/**
|
||||
* 文件上传接口
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface ISysFileService
|
||||
{
|
||||
public interface ISysFileService {
|
||||
/**
|
||||
* 文件上传接口
|
||||
*
|
||||
*
|
||||
* @param file 上传的文件
|
||||
* @return 访问地址
|
||||
* @throws Exception
|
||||
*/
|
||||
public String uploadFile(MultipartFile file) throws Exception;
|
||||
String uploadFile(MultipartFile file) throws Exception;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,25 @@
|
|||
package com.ruoyi.file.service;
|
||||
|
||||
import com.ruoyi.common.services.constants.FileStorageType;
|
||||
import com.ruoyi.common.services.domain.SysFile;
|
||||
import com.ruoyi.common.services.mapper.SysFileMapper;
|
||||
import com.ruoyi.file.utils.FileUploadResult;
|
||||
import com.ruoyi.file.utils.FileUploadUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.ruoyi.file.utils.FileUploadUtils;
|
||||
|
||||
/**
|
||||
* 本地文件存储
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Primary
|
||||
@Service
|
||||
public class LocalSysFileServiceImpl implements ISysFileService
|
||||
{
|
||||
public class LocalSysFileServiceImpl implements ISysFileService {
|
||||
/**
|
||||
* 资源映射路径 前缀
|
||||
*/
|
||||
|
|
@ -26,25 +31,45 @@ public class LocalSysFileServiceImpl implements ISysFileService
|
|||
*/
|
||||
@Value("${file.domain}")
|
||||
public String domain;
|
||||
|
||||
|
||||
/**
|
||||
* 上传文件存储在本地的根路径
|
||||
*/
|
||||
@Value("${file.path}")
|
||||
private String localFilePath;
|
||||
|
||||
@Autowired
|
||||
private SysFileMapper sysFileMapper;
|
||||
|
||||
/**
|
||||
* 本地文件上传接口
|
||||
*
|
||||
*
|
||||
* @param file 上传的文件
|
||||
* @return 访问地址
|
||||
* @throws Exception
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public String uploadFile(MultipartFile file) throws Exception
|
||||
{
|
||||
String name = FileUploadUtils.upload(localFilePath, file);
|
||||
String url = domain + localFilePrefix + name;
|
||||
public String uploadFile(MultipartFile file) throws Exception {
|
||||
// 保存文件到本地
|
||||
FileUploadResult uploadResult = FileUploadUtils.upload(localFilePath, file);
|
||||
String savedPathFileName = uploadResult.getSavedPathFileName();
|
||||
String url = domain + localFilePrefix + savedPathFileName;
|
||||
// 保存文件记录
|
||||
saveFileRecord(url, uploadResult);
|
||||
// 返回访问地址
|
||||
return url;
|
||||
}
|
||||
|
||||
private void saveFileRecord(String requestUrl, FileUploadResult uploadResult) {
|
||||
SysFile record = new SysFile();
|
||||
record.setFileId(uploadResult.getFileId()); // 文件ID
|
||||
record.setSavedName(uploadResult.getSavedFileName()); // 保存的文件名
|
||||
record.setOriginalName(uploadResult.getOriginalFilename()); // 原文件名
|
||||
record.setFilePath(uploadResult.getSavedPath()); // 本地保存的文件路径
|
||||
record.setExtension(uploadResult.getExtension()); // 文件扩展名
|
||||
record.setStorageType(FileStorageType.LOCAL.name()); // 存储类型:本地文件存储
|
||||
record.setRequestUrl(requestUrl); // 获取文件的URL
|
||||
record.setFileSize(uploadResult.getFileSize()); // 文件大小(Byte)
|
||||
sysFileMapper.insertSelective(record);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,24 @@
|
|||
package com.ruoyi.file.service;
|
||||
|
||||
import java.io.InputStream;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.alibaba.nacos.common.utils.IoUtils;
|
||||
import com.ruoyi.file.config.MinioConfig;
|
||||
import com.ruoyi.file.utils.FileUploadUtils;
|
||||
import io.minio.MinioClient;
|
||||
import io.minio.PutObjectArgs;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* TODO 未完成,还需要保存文件记录
|
||||
* Minio 文件存储
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class MinioSysFileServiceImpl implements ISysFileService
|
||||
{
|
||||
public class MinioSysFileServiceImpl implements ISysFileService {
|
||||
@Autowired
|
||||
private MinioConfig minioConfig;
|
||||
|
||||
|
|
@ -29,12 +30,10 @@ public class MinioSysFileServiceImpl implements ISysFileService
|
|||
*
|
||||
* @param file 上传的文件
|
||||
* @return 访问地址
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public String uploadFile(MultipartFile file) throws Exception
|
||||
{
|
||||
String fileName = FileUploadUtils.extractFilename(file);
|
||||
public String uploadFile(MultipartFile file) throws Exception {
|
||||
String fileName = FileUploadUtils.extractFilename(file, null);
|
||||
InputStream inputStream = file.getInputStream();
|
||||
PutObjectArgs args = PutObjectArgs.builder()
|
||||
.bucket(minioConfig.getBucketName())
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
package com.ruoyi.file.utils;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Alan Scipio
|
||||
* created on 2024/2/19
|
||||
*/
|
||||
@Data
|
||||
public class FileUploadResult implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String fileId;
|
||||
|
||||
private String savedFileName;
|
||||
|
||||
private String savedPathFileName;
|
||||
|
||||
private String originalFilename;
|
||||
|
||||
private String extension;
|
||||
|
||||
private Long fileSize;
|
||||
|
||||
private String savedPath;
|
||||
|
||||
}
|
||||
|
|
@ -1,12 +1,5 @@
|
|||
package com.ruoyi.file.utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.ruoyi.common.core.exception.file.FileException;
|
||||
import com.ruoyi.common.core.exception.file.FileNameLengthLimitExceededException;
|
||||
import com.ruoyi.common.core.exception.file.FileSizeLimitExceededException;
|
||||
|
|
@ -16,6 +9,12 @@ import com.ruoyi.common.core.utils.StringUtils;
|
|||
import com.ruoyi.common.core.utils.file.FileTypeUtils;
|
||||
import com.ruoyi.common.core.utils.file.MimeTypeUtils;
|
||||
import com.ruoyi.common.core.utils.uuid.Seq;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 文件上传工具类
|
||||
|
|
@ -24,9 +23,9 @@ import com.ruoyi.common.core.utils.uuid.Seq;
|
|||
*/
|
||||
public class FileUploadUtils {
|
||||
/**
|
||||
* 默认大小 50M
|
||||
* 默认大小 100M
|
||||
*/
|
||||
public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024;
|
||||
public static final long DEFAULT_MAX_SIZE = 100 * 1024 * 1024;
|
||||
|
||||
/**
|
||||
* 默认的文件名最大长度 100
|
||||
|
|
@ -38,9 +37,9 @@ public class FileUploadUtils {
|
|||
*
|
||||
* @param baseDir 相对应用的基目录
|
||||
* @param file 上传的文件
|
||||
* @return 文件名称
|
||||
* @return 文件上传结果
|
||||
*/
|
||||
public static String upload(String baseDir, MultipartFile file) throws IOException {
|
||||
public static FileUploadResult upload(String baseDir, MultipartFile file) throws IOException {
|
||||
try {
|
||||
return upload(baseDir, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
|
||||
} catch (FileException fe) {
|
||||
|
|
@ -62,29 +61,39 @@ public class FileUploadUtils {
|
|||
* @throws IOException 比如读写文件出错时
|
||||
* @throws InvalidExtensionException 文件校验异常
|
||||
*/
|
||||
public static String upload(String baseDir, MultipartFile file, String[] allowedExtension)
|
||||
throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
|
||||
InvalidExtensionException {
|
||||
int fileNamelength = Objects.requireNonNull(file.getOriginalFilename()).length();
|
||||
if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH) {
|
||||
public static FileUploadResult upload(String baseDir, MultipartFile file, String[] allowedExtension)
|
||||
throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException, InvalidExtensionException {
|
||||
int fileNameLength = Objects.requireNonNull(file.getOriginalFilename()).length();
|
||||
if (fileNameLength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH) {
|
||||
throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
|
||||
}
|
||||
|
||||
assertAllowed(file, allowedExtension);
|
||||
FileUploadResult result = new FileUploadResult();
|
||||
|
||||
String fileName = extractFilename(file);
|
||||
assertAllowed(file, allowedExtension, result);
|
||||
|
||||
String fileName = extractFilename(file, result);
|
||||
|
||||
String absPath = getAbsoluteFile(baseDir, fileName).getAbsolutePath();
|
||||
file.transferTo(Paths.get(absPath));
|
||||
return getPathFileName(fileName);
|
||||
String savedPathFileName = getPathFileName(fileName);
|
||||
|
||||
result.setSavedPathFileName(savedPathFileName);
|
||||
result.setSavedPath(absPath);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编码文件名
|
||||
* 编码文件名,最终结果举例: .../2024/02/19/20240219154651A001.jpg
|
||||
*/
|
||||
public static String extractFilename(MultipartFile file) {
|
||||
return StringUtils.format("{}/{}_{}.{}", DateUtils.datePath(),
|
||||
FilenameUtils.getBaseName(file.getOriginalFilename()), Seq.getId(Seq.uploadSeqType), FileTypeUtils.getExtension(file));
|
||||
public static String extractFilename(MultipartFile file, FileUploadResult result) {
|
||||
String fileId = Seq.getId(Seq.uploadSeqType);
|
||||
String savedFileName = StringUtils.format("{}.{}", fileId, FileTypeUtils.getExtension(file));
|
||||
if (result != null) {
|
||||
result.setFileId(fileId);
|
||||
result.setSavedFileName(savedFileName);
|
||||
}
|
||||
return StringUtils.format("{}/{}", DateUtils.datePath(), savedFileName);
|
||||
}
|
||||
|
||||
@SuppressWarnings("ResultOfMethodCallIgnored")
|
||||
|
|
@ -100,26 +109,29 @@ public class FileUploadUtils {
|
|||
}
|
||||
|
||||
private static String getPathFileName(String fileName) {
|
||||
String pathFileName = "/" + fileName;
|
||||
return pathFileName;
|
||||
return "/" + fileName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件大小校验
|
||||
*
|
||||
* @param file 上传的文件
|
||||
* @param file 上传的文件
|
||||
* @param result 文件上传结果
|
||||
* @throws FileSizeLimitExceededException 如果超出最大大小
|
||||
* @throws InvalidExtensionException 文件校验异常
|
||||
*/
|
||||
public static void assertAllowed(MultipartFile file, String[] allowedExtension)
|
||||
public static void assertAllowed(MultipartFile file, String[] allowedExtension, FileUploadResult result)
|
||||
throws FileSizeLimitExceededException, InvalidExtensionException {
|
||||
long size = file.getSize();
|
||||
if (size > DEFAULT_MAX_SIZE) {
|
||||
throw new FileSizeLimitExceededException(DEFAULT_MAX_SIZE / 1024 / 1024);
|
||||
}
|
||||
result.setFileSize(size);
|
||||
|
||||
String fileName = file.getOriginalFilename();
|
||||
String extension = FileTypeUtils.getExtension(file);
|
||||
result.setExtension(extension);
|
||||
result.setOriginalFilename(fileName);
|
||||
if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension)) {
|
||||
if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION) {
|
||||
throw new InvalidExtensionException.InvalidImageExtensionException(allowedExtension, extension,
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 79 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
|
|
@ -1,6 +1,6 @@
|
|||
import { login, logout, getInfo } from '@/api/login'
|
||||
import { getToken, setToken, removeToken } from '@/utils/auth'
|
||||
import defAva from '@/assets/images/profile.jpg'
|
||||
import defAva from '@/assets/images/profile.png'
|
||||
|
||||
const useUserStore = defineStore(
|
||||
'user',
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
Target Server Version : 80200 (8.2.0)
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 19/02/2024 13:45:49
|
||||
Date: 19/02/2024 15:55:14
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
|
|
@ -424,6 +424,32 @@ INSERT INTO `sys_dict_type` VALUES (8, '通知状态', 'sys_notice_status', '0',
|
|||
INSERT INTO `sys_dict_type` VALUES (9, '操作类型', 'sys_oper_type', '0', 'admin', '2024-01-30 05:05:41', '', NULL, '操作类型列表');
|
||||
INSERT INTO `sys_dict_type` VALUES (10, '系统状态', 'sys_common_status', '0', 'admin', '2024-01-30 05:05:41', '', NULL, '登录状态列表');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for sys_file
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `sys_file`;
|
||||
CREATE TABLE `sys_file` (
|
||||
`file_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '文件ID',
|
||||
`saved_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '保存的文件名称',
|
||||
`original_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '原始文件名称',
|
||||
`file_path` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '文件路径',
|
||||
`extension` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '文件后缀',
|
||||
`storage_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '存储方式',
|
||||
`request_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '获取文件的URL',
|
||||
`file_size` bigint NOT NULL COMMENT '文件大小(Byte)',
|
||||
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
|
||||
`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '备注',
|
||||
PRIMARY KEY (`file_id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '文件存储记录表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_file
|
||||
-- ----------------------------
|
||||
INSERT INTO `sys_file` VALUES ('20240219155008A001', '20240219155008A001.png', 'AGVCar02.png', 'D:\\temp\\ruoyi\\uploadPath\\2024\\02\\19\\20240219155008A001.png', 'png', 'LOCAL', 'http://127.0.0.1:9300/statics/2024/02/19/20240219155008A001.png', 330857, '1', '2024-02-19 15:50:17', '1', '2024-02-19 15:50:17', '示例数据');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for sys_job
|
||||
-- ----------------------------
|
||||
|
|
@ -486,7 +512,7 @@ CREATE TABLE `sys_logininfor` (
|
|||
PRIMARY KEY (`info_id`) USING BTREE,
|
||||
INDEX `idx_sys_logininfor_s`(`status` ASC) USING BTREE,
|
||||
INDEX `idx_sys_logininfor_lt`(`access_time` ASC) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 134 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '系统访问记录' ROW_FORMAT = Dynamic;
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 139 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '系统访问记录' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_logininfor
|
||||
|
|
|
|||
|
|
@ -4,14 +4,14 @@
|
|||
Source Server : MySQL (CIT1)
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 80200 (8.2.0)
|
||||
Source Host : localhost:3306
|
||||
Source Host :
|
||||
Source Schema : ry-config
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 80200 (8.2.0)
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 02/02/2024 18:45:36
|
||||
Date: 19/02/2024 15:56:16
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
|
|
@ -41,7 +41,7 @@ CREATE TABLE `config_info` (
|
|||
`encrypted_data_key` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NULL COMMENT '秘钥',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `uk_configinfo_datagrouptenant`(`data_id` ASC, `group_id` ASC, `tenant_id` ASC) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 52 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_bin COMMENT = 'config_info' ROW_FORMAT = Dynamic;
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 57 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_bin COMMENT = 'config_info' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of config_info
|
||||
|
|
@ -51,15 +51,15 @@ INSERT INTO `config_info` VALUES (2, 'ruoyi-gateway-dev.yml', 'DEFAULT_GROUP', '
|
|||
INSERT INTO `config_info` VALUES (3, 'ruoyi-auth-dev.yml', 'DEFAULT_GROUP', 'spring:\n redis:\n host: localhost\n port: 6379\n password:\n\nspecial:\n auth:\n login-enabled: true\n', '15384b16790e69bd4bf31109a6aea12b', '2020-11-20 00:00:00', '2024-02-01 08:23:56', NULL, '0:0:0:0:0:0:0:1', '', '', '认证中心', 'null', 'null', 'yaml', '', '');
|
||||
INSERT INTO `config_info` VALUES (4, 'ruoyi-monitor-dev.yml', 'DEFAULT_GROUP', '# spring\nspring:\n security:\n user:\n name: ryas\n password: 123456\n boot:\n admin:\n ui:\n title: RYAS服务状态监控\n', '8b3ccaa35d17b5abe8c05a66a264e5f5', '2020-11-20 00:00:00', '2024-01-31 07:28:14', NULL, '0:0:0:0:0:0:0:1', '', '', '监控中心', 'null', 'null', 'yaml', '', '');
|
||||
INSERT INTO `config_info` VALUES (5, 'ruoyi-system-dev.yml', 'DEFAULT_GROUP', '# spring配置\nspring:\n redis:\n host: localhost\n port: 6379\n password:\n datasource:\n druid:\n stat-view-servlet:\n enabled: true\n loginUsername: admin\n loginPassword: 123456\n dynamic:\n druid:\n initial-size: 5\n min-idle: 5\n maxActive: 20\n maxWait: 60000\n connectTimeout: 30000\n socketTimeout: 60000\n timeBetweenEvictionRunsMillis: 60000\n minEvictableIdleTimeMillis: 300000\n validationQuery: SELECT 1 FROM DUAL\n testWhileIdle: true\n testOnBorrow: false\n testOnReturn: false\n poolPreparedStatements: true\n maxPoolPreparedStatementPerConnectionSize: 20\n filters: stat,slf4j\n connectionProperties: druid.stat.mergeSql\\=true;druid.stat.slowSqlMillis\\=5000\n datasource:\n # 主库数据源\n master:\n driver-class-name: com.mysql.cj.jdbc.Driver\n url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8\n username: root\n password: password\n # 从库数据源\n # slave:\n # username: \n # password: \n # url: \n # driver-class-name: \n\n# mybatis配置\nmybatis:\n # 搜索指定包别名\n typeAliasesPackage: com.ruoyi.system\n # 配置MyBatis日志输出\n configuration:\n log-impl: org.apache.ibatis.logging.stdout.StdOutImpl\n\n# swagger配置\nswagger:\n title: 系统模块接口文档\n license: Powered By ruoyi\n licenseUrl: https://ruoyi.vip\n', 'c16551d84032495e08b4d0a23648258b', '2020-11-20 00:00:00', '2024-02-01 07:46:29', NULL, '0:0:0:0:0:0:0:1', '', '', '系统模块', 'null', 'null', 'yaml', '', '');
|
||||
INSERT INTO `config_info` VALUES (6, 'ruoyi-gen-dev.yml', 'DEFAULT_GROUP', '# spring配置\nspring:\n redis:\n host: localhost\n port: 6379\n password:\n datasource:\n driver-class-name: com.mysql.cj.jdbc.Driver\n url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8\n username: root\n password: password\n\n# mybatis配置\nmybatis:\n # 搜索指定包别名\n typeAliasesPackage: com.ruoyi.gen.domain\n # 配置mapper的扫描,找到所有的mapper.xml映射文件\n mapperLocations: classpath:mapper/**/*.xml\n\n# swagger配置\nswagger:\n title: 代码生成接口文档\n license: Powered By ruoyi\n licenseUrl: https://ruoyi.vip\n\n# 代码生成\ngen:\n # 作者\n author: ruoyi\n # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool\n packageName: com.ruoyi.system\n # 自动去除表前缀,默认是false\n autoRemovePre: false\n # 表前缀(生成类名不会包含表前缀,多个用逗号分隔)\n tablePrefix: sys_\n', '23a2f21b291cb7757c5eee924b1cc1d5', '2020-11-20 00:00:00', '2024-01-31 06:56:23', NULL, '0:0:0:0:0:0:0:1', '', '', '代码生成', 'null', 'null', 'yaml', '', '');
|
||||
INSERT INTO `config_info` VALUES (6, 'ruoyi-gen-dev.yml', 'DEFAULT_GROUP', '# spring配置\nspring:\n redis:\n host: localhost\n port: 6379\n password:\n datasource:\n driver-class-name: com.mysql.cj.jdbc.Driver\n url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8\n username: root\n password: password\n\n# mybatis配置\nmybatis:\n # 搜索指定包别名\n typeAliasesPackage: com.ruoyi.gen.domain\n # 配置mapper的扫描,找到所有的mapper.xml映射文件\n mapperLocations: classpath:mapper/**/*.xml\n\n# swagger配置\nswagger:\n title: 代码生成接口文档\n license: Powered By ruoyi\n licenseUrl: https://ruoyi.vip\n\n# 代码生成\ngen:\n # 作者\n author: ryas\n # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool\n packageName: com.ruoyi.system\n # 自动去除表前缀,默认是false\n autoRemovePre: false\n # 表前缀(生成类名不会包含表前缀,多个用逗号分隔)\n tablePrefix: sys_\n', '6a608ec04c64588783a08316dbe2ac3e', '2020-11-20 00:00:00', '2024-02-05 08:56:27', 'alan', '101.229.149.67', '', '', '代码生成', 'null', 'null', 'yaml', '', '');
|
||||
INSERT INTO `config_info` VALUES (7, 'ruoyi-job-dev.yml', 'DEFAULT_GROUP', '# spring配置\nspring:\n redis:\n host: localhost\n port: 6379\n password: \n datasource:\n driver-class-name: com.mysql.cj.jdbc.Driver\n url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8\n username: root\n password: password\n\n# mybatis配置\nmybatis:\n # 搜索指定包别名\n typeAliasesPackage: com.ruoyi.job.domain\n # 配置mapper的扫描,找到所有的mapper.xml映射文件\n #mapperLocations: classpath:mapper/**/*.xml\n\n# swagger配置\nswagger:\n title: 定时任务接口文档\n license: Powered By ruoyi\n licenseUrl: https://ruoyi.vip\n', '79c2abe7b92b996eae686e4e158efa89', '2020-11-20 00:00:00', '2024-01-31 09:04:48', NULL, '0:0:0:0:0:0:0:1', '', '', '定时任务', 'null', 'null', 'yaml', '', '');
|
||||
INSERT INTO `config_info` VALUES (8, 'ruoyi-file-dev.yml', 'DEFAULT_GROUP', '# 本地文件上传 \nfile:\n domain: http://127.0.0.1:9300\n path: D:/temp/ruoyi/uploadPath\n prefix: /statics\n\n# FastDFS配置\nfdfs:\n domain: http://8.129.231.12\n soTimeout: 3000\n connectTimeout: 2000\n trackerList: 8.129.231.12:22122\n\n# Minio配置\nminio:\n url: http://8.129.231.12:9000\n accessKey: minioadmin\n secretKey: minioadmin\n bucketName: test', 'fe5c45f87e45f2dce9900097cfac5f64', '2020-11-20 00:00:00', '2024-01-31 07:07:52', NULL, '0:0:0:0:0:0:0:1', '', '', '文件服务', 'null', 'null', 'yaml', '', '');
|
||||
INSERT INTO `config_info` VALUES (8, 'ruoyi-file-dev.yml', 'DEFAULT_GROUP', '# 本地文件上传 \nfile:\n domain: http://127.0.0.1:9300\n path: D:/temp/ruoyi/uploadPath\n prefix: /statics\n\n# FastDFS配置\nfdfs:\n domain: http://8.129.231.12\n soTimeout: 3000\n connectTimeout: 2000\n trackerList: 8.129.231.12:22122\n\n# Minio配置\nminio:\n url: http://8.129.231.12:9000\n accessKey: minioadmin\n secretKey: minioadmin\n bucketName: test\n\n# spring配置\nspring:\n datasource:\n druid:\n dynamic:\n druid:\n initial-size: 5\n min-idle: 5\n maxActive: 20\n maxWait: 60000\n connectTimeout: 30000\n socketTimeout: 60000\n timeBetweenEvictionRunsMillis: 60000\n minEvictableIdleTimeMillis: 300000\n validationQuery: SELECT 1 FROM DUAL\n testWhileIdle: true\n testOnBorrow: false\n testOnReturn: false\n poolPreparedStatements: true\n maxPoolPreparedStatementPerConnectionSize: 20\n connectionProperties: druid.stat.mergeSql\\=true;druid.stat.slowSqlMillis\\=5000\n datasource:\n # 主库数据源\n master:\n driver-class-name: com.mysql.cj.jdbc.Driver\n url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8\n username: root\n password: password\n # 从库数据源\n # slave:\n # username: \n # password: \n # url: \n # driver-class-name: \n\n# mybatis配置\nmybatis:\n # 搜索指定包别名\n typeAliasesPackage: com.ruoyi.file\n # 配置MyBatis日志输出\n configuration:\n log-impl: org.apache.ibatis.logging.stdout.StdOutImpl\n', '558d0a9349f5560d8f0bffc3c0c36eab', '2020-11-20 00:00:00', '2024-02-19 07:22:11', 'alan', '101.229.149.67', '', '', '文件服务', 'null', 'null', 'yaml', '', '');
|
||||
INSERT INTO `config_info` VALUES (9, 'sentinel-ruoyi-gateway', 'DEFAULT_GROUP', '[\r\n {\r\n \"resource\": \"ruoyi-auth\",\r\n \"count\": 500,\r\n \"grade\": 1,\r\n \"limitApp\": \"default\",\r\n \"strategy\": 0,\r\n \"controlBehavior\": 0\r\n },\r\n {\r\n \"resource\": \"ruoyi-system\",\r\n \"count\": 1000,\r\n \"grade\": 1,\r\n \"limitApp\": \"default\",\r\n \"strategy\": 0,\r\n \"controlBehavior\": 0\r\n },\r\n {\r\n \"resource\": \"ruoyi-gen\",\r\n \"count\": 200,\r\n \"grade\": 1,\r\n \"limitApp\": \"default\",\r\n \"strategy\": 0,\r\n \"controlBehavior\": 0\r\n },\r\n {\r\n \"resource\": \"ruoyi-job\",\r\n \"count\": 300,\r\n \"grade\": 1,\r\n \"limitApp\": \"default\",\r\n \"strategy\": 0,\r\n \"controlBehavior\": 0\r\n }\r\n]', '9f3a3069261598f74220bc47958ec252', '2020-11-20 00:00:00', '2020-11-20 00:00:00', NULL, '0:0:0:0:0:0:0:1', '', '', '限流策略', 'null', 'null', 'json', NULL, '');
|
||||
INSERT INTO `config_info` VALUES (35, 'ruoyi-gateway-dev.yml', 'GROUP_ALL_IN_1', 'spring:\n redis:\n host: localhost\n port: 6379\n password:\n cloud:\n gateway:\n discovery:\n locator:\n lowerCaseServiceId: true\n enabled: true\n routes:\n # 认证中心\n - id: ruoyi-auth\n uri: lb://ruoyi-system\n predicates:\n - Path=/auth/**\n filters:\n # 验证码处理\n - CacheRequestFilter\n - ValidateCodeFilter\n - StripPrefix=1\n # 代码生成\n - id: ruoyi-gen\n uri: lb://ruoyi-gen\n predicates:\n - Path=/code/**\n filters:\n - StripPrefix=1\n # 定时任务\n - id: ruoyi-job\n uri: lb://ruoyi-system\n predicates:\n - Path=/schedule/**\n filters:\n - StripPrefix=1\n # 系统模块\n - id: ruoyi-system\n uri: lb://ruoyi-system\n predicates:\n - Path=/system/**\n filters:\n - StripPrefix=1\n # 文件服务\n - id: ruoyi-file\n uri: lb://ruoyi-system\n predicates:\n - Path=/file/**\n filters:\n - StripPrefix=1\n # WMS服务\n - id: ruoyi-wms\n uri: lb://ruoyi-wms\n predicates:\n - Path=/wms/**\n filters:\n - StripPrefix=1\n\n# 安全配置\nsecurity:\n # 验证码\n captcha:\n enabled: true\n type: math\n # 防止XSS攻击\n xss:\n enabled: true\n excludeUrls:\n - /system/notice\n # 不校验白名单\n ignore:\n whites:\n - /auth/logout\n - /auth/login\n - /auth/register\n - /*/v2/api-docs\n - /csrf\n - /auth/specialAuth/login\n - /system/test/**\n - /wms/test/**\n', 'cc74a6d0d4b40c085da48f56fbd01e5b', '2024-01-31 09:34:00', '2024-02-01 08:25:17', NULL, '0:0:0:0:0:0:0:1', '', '', '', '', '', 'yaml', '', '');
|
||||
INSERT INTO `config_info` VALUES (36, 'ruoyi-system-dev.yml', 'GROUP_ALL_IN_1', '# spring配置\nspring:\n redis:\n host: localhost\n port: 6379\n password:\n datasource:\n druid:\n stat-view-servlet:\n enabled: true\n loginUsername: admin\n loginPassword: 123456\n dynamic:\n druid:\n initial-size: 5\n min-idle: 5\n maxActive: 20\n maxWait: 60000\n connectTimeout: 30000\n socketTimeout: 60000\n timeBetweenEvictionRunsMillis: 60000\n minEvictableIdleTimeMillis: 300000\n validationQuery: SELECT 1 FROM DUAL\n testWhileIdle: true\n testOnBorrow: false\n testOnReturn: false\n poolPreparedStatements: true\n maxPoolPreparedStatementPerConnectionSize: 20\n filters: stat,slf4j\n connectionProperties: druid.stat.mergeSql\\=true;druid.stat.slowSqlMillis\\=5000\n datasource:\n # 主库数据源\n master:\n driver-class-name: com.mysql.cj.jdbc.Driver\n url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8\n username: root\n password: password\n # 从库数据源\n # slave:\n # username: \n # password: \n # url: \n # driver-class-name: \n\n# mybatis配置\nmybatis:\n # 搜索指定包别名\n typeAliasesPackage: com.ruoyi.system,com.ruoyi.job.domain\n # 配置MyBatis日志输出\n configuration:\n log-impl: org.apache.ibatis.logging.stdout.StdOutImpl\n\n# 本地文件上传 \nfile:\n domain: http://127.0.0.1:9201\n path: D:/temp/ruoyi/uploadPath\n prefix: /statics\n\n# FastDFS配置\nfdfs:\n domain: http://8.129.231.12\n soTimeout: 3000\n connectTimeout: 2000\n trackerList: 8.129.231.12:22122\n\n# Minio配置\nminio:\n url: http://8.129.231.12:9000\n accessKey: minioadmin\n secretKey: minioadmin\n bucketName: test\n\n# 特殊登录控制(不需要验证码)\nspecial:\n auth:\n login-enabled: true\n', '79e0d26257e644b6a248990af323f59d', '2024-01-31 09:34:19', '2024-02-01 08:28:49', NULL, '0:0:0:0:0:0:0:1', '', '', '', '', '', 'yaml', '', '');
|
||||
INSERT INTO `config_info` VALUES (37, 'application-dev.yml', 'GROUP_ALL_IN_1', 'spring:\n autoconfigure:\n exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure\n mvc:\n pathmatch:\n matching-strategy: ant_path_matcher\n cloud:\n # feign 配置\n openfeign:\n sentinel:\n enabled: true\n okhttp:\n enabled: true\n httpclient:\n enabled: false\n client:\n config:\n default:\n connectTimeout: 10000\n readTimeout: 10000\n compression:\n request:\n enabled: true\n min-request-size: 8192\n response:\n enabled: true\n\n# 暴露监控端点\nmanagement:\n endpoints:\n web:\n exposure:\n include: \'*\'\n', '40039af000c00c2a42c264e926c1d2fc', '2024-01-31 09:37:04', '2024-01-31 09:37:04', NULL, '0:0:0:0:0:0:0:1', '', '', '通用配置', NULL, NULL, 'yaml', NULL, '');
|
||||
INSERT INTO `config_info` VALUES (38, 'ruoyi-monitor-dev.yml', 'GROUP_ALL_IN_1', '# spring\nspring:\n security:\n user:\n name: ryas\n password: 123456\n boot:\n admin:\n ui:\n title: RYAS服务状态监控\n', '8b3ccaa35d17b5abe8c05a66a264e5f5', '2024-01-31 09:37:29', '2024-01-31 09:37:29', NULL, '0:0:0:0:0:0:0:1', '', '', '监控中心', NULL, NULL, 'yaml', NULL, '');
|
||||
INSERT INTO `config_info` VALUES (39, 'ruoyi-gen-dev.yml', 'GROUP_ALL_IN_1', '# spring配置\nspring:\n redis:\n host: localhost\n port: 6379\n password:\n datasource:\n driver-class-name: com.mysql.cj.jdbc.Driver\n url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8\n username: root\n password: password\n\n# mybatis配置\nmybatis:\n # 搜索指定包别名\n typeAliasesPackage: com.ruoyi.gen.domain\n # 配置mapper的扫描,找到所有的mapper.xml映射文件\n mapperLocations: classpath:mapper/**/*.xml\n\n# swagger配置\nswagger:\n title: 代码生成接口文档\n license: Powered By ruoyi\n licenseUrl: https://ruoyi.vip\n\n# 代码生成\ngen:\n # 作者\n author: ruoyi\n # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool\n packageName: com.ruoyi.system\n # 自动去除表前缀,默认是false\n autoRemovePre: false\n # 表前缀(生成类名不会包含表前缀,多个用逗号分隔)\n tablePrefix: sys_\n', '23a2f21b291cb7757c5eee924b1cc1d5', '2024-01-31 09:37:29', '2024-01-31 09:37:29', NULL, '0:0:0:0:0:0:0:1', '', '', '代码生成', NULL, NULL, 'yaml', NULL, '');
|
||||
INSERT INTO `config_info` VALUES (39, 'ruoyi-gen-dev.yml', 'GROUP_ALL_IN_1', '# spring配置\nspring:\n redis:\n host: localhost\n port: 6379\n password:\n datasource:\n driver-class-name: com.mysql.cj.jdbc.Driver\n url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8\n username: root\n password: password\n\n# mybatis配置\nmybatis:\n # 搜索指定包别名\n typeAliasesPackage: com.ruoyi.gen.domain\n # 配置mapper的扫描,找到所有的mapper.xml映射文件\n mapperLocations: classpath:mapper/**/*.xml\n\n# swagger配置\nswagger:\n title: 代码生成接口文档\n license: Powered By ruoyi\n licenseUrl: https://ruoyi.vip\n\n# 代码生成\ngen:\n # 作者\n author: ryas\n # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool\n packageName: com.ruoyi.system\n # 自动去除表前缀,默认是false\n autoRemovePre: false\n # 表前缀(生成类名不会包含表前缀,多个用逗号分隔)\n tablePrefix: sys_\n', '6a608ec04c64588783a08316dbe2ac3e', '2024-01-31 09:37:29', '2024-02-05 08:56:38', 'alan', '101.229.149.67', '', '', '代码生成', '', '', 'yaml', '', '');
|
||||
INSERT INTO `config_info` VALUES (45, 'ruoyi-wms-dev.yml', 'DEFAULT_GROUP', '# spring配置\nspring:\n redis:\n host: localhost\n port: 6379\n password:\n datasource:\n druid:\n stat-view-servlet:\n enabled: true\n loginUsername: admin\n loginPassword: 123456\n dynamic:\n druid:\n initial-size: 5\n min-idle: 5\n maxActive: 20\n maxWait: 60000\n connectTimeout: 30000\n socketTimeout: 60000\n timeBetweenEvictionRunsMillis: 60000\n minEvictableIdleTimeMillis: 300000\n validationQuery: SELECT 1 FROM DUAL\n testWhileIdle: true\n testOnBorrow: false\n testOnReturn: false\n poolPreparedStatements: true\n maxPoolPreparedStatementPerConnectionSize: 20\n filters: stat,slf4j\n connectionProperties: druid.stat.mergeSql\\=true;druid.stat.slowSqlMillis\\=5000\n datasource:\n # 主库数据源\n master:\n driver-class-name: com.mysql.cj.jdbc.Driver\n url: jdbc:mysql://localhost:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8\n username: root\n password: password\n # 从库数据源\n # slave:\n # username: \n # password: \n # url: \n # driver-class-name: \n\n# mybatis配置\nmybatis:\n # 搜索指定包别名\n typeAliasesPackage: com.ruoyi.wms.domain\n # 配置MyBatis日志输出\n configuration:\n log-impl: org.apache.ibatis.logging.stdout.StdOutImpl\n', '33fd0757ceb0a95e7fa62bf1646121cd', '2024-02-01 07:44:47', '2024-02-01 07:45:50', NULL, '0:0:0:0:0:0:0:1', '', '', '系统模块', '', '', 'yaml', '', '');
|
||||
|
||||
-- ----------------------------
|
||||
|
|
@ -201,7 +201,7 @@ CREATE TABLE `his_config_info` (
|
|||
INDEX `idx_gmt_create`(`gmt_create` ASC) USING BTREE,
|
||||
INDEX `idx_gmt_modified`(`gmt_modified` ASC) USING BTREE,
|
||||
INDEX `idx_did`(`data_id` ASC) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 49 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_bin COMMENT = '多租户改造' ROW_FORMAT = Dynamic;
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 54 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_bin COMMENT = '多租户改造' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of his_config_info
|
||||
|
|
@ -235,7 +235,7 @@ CREATE TABLE `roles` (
|
|||
-- ----------------------------
|
||||
-- Records of roles
|
||||
-- ----------------------------
|
||||
INSERT INTO `roles` VALUES ('nacos', 'ROLE_ADMIN');
|
||||
INSERT INTO `roles` VALUES ('alan', 'ROLE_ADMIN');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for tenant_capacity
|
||||
|
|
@ -296,6 +296,6 @@ CREATE TABLE `users` (
|
|||
-- ----------------------------
|
||||
-- Records of users
|
||||
-- ----------------------------
|
||||
INSERT INTO `users` VALUES ('nacos', '$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu', 1);
|
||||
INSERT INTO `users` VALUES ('alan', '$2a$10$/Sqe163WdMEnL.gyVu7v..tVSThUMiy7Wec37eLGByuT.UY7pbm6a', 1);
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue