修改框架
This commit is contained in:
@@ -1,19 +1,18 @@
|
||||
package com.quoted;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
|
||||
/**
|
||||
* 启动程序
|
||||
*
|
||||
* @author ruoyi
|
||||
*
|
||||
* quoted
|
||||
*/
|
||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||
public class QuotedApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
|
||||
public class QuotedApplication {
|
||||
public static void main(String[] args) {
|
||||
// System.setProperty("spring.devtools.restart.enabled", "false");
|
||||
SpringApplication.run(QuotedApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" +
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer
|
||||
/**
|
||||
* web容器中进行部署
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
public class QuotedServletInitializer extends SpringBootServletInitializer
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.springframework.util.FastByteArrayOutputStream;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.google.code.kaptcha.Producer;
|
||||
import com.quoted.common.config.RuoYiConfig;
|
||||
import com.quoted.common.config.QuotedConfig;
|
||||
import com.quoted.common.constant.CacheConstants;
|
||||
import com.quoted.common.constant.Constants;
|
||||
import com.quoted.common.core.domain.AjaxResult;
|
||||
@@ -23,7 +23,7 @@ import com.quoted.system.service.ISysConfigService;
|
||||
/**
|
||||
* 验证码操作处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@RestController
|
||||
public class CaptchaController
|
||||
@@ -61,7 +61,7 @@ public class CaptchaController
|
||||
BufferedImage image = null;
|
||||
|
||||
// 生成验证码
|
||||
String captchaType = RuoYiConfig.getCaptchaType();
|
||||
String captchaType = QuotedConfig.getCaptchaType();
|
||||
if ("math".equals(captchaType))
|
||||
{
|
||||
String capText = captchaProducerMath.createText();
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.quoted.common.config.RuoYiConfig;
|
||||
import com.quoted.common.config.QuotedConfig;
|
||||
import com.quoted.common.core.domain.AjaxResult;
|
||||
import com.quoted.common.utils.StringUtils;
|
||||
import com.quoted.common.utils.file.FileUploadUtils;
|
||||
@@ -23,7 +23,7 @@ import com.quoted.framework.config.ServerConfig;
|
||||
/**
|
||||
* 通用请求处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/common")
|
||||
@@ -52,7 +52,7 @@ public class CommonController
|
||||
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
|
||||
}
|
||||
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
|
||||
String filePath = RuoYiConfig.getDownloadPath() + fileName;
|
||||
String filePath = QuotedConfig.getDownloadPath() + fileName;
|
||||
|
||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
||||
FileUtils.setAttachmentResponseHeader(response, realFileName);
|
||||
@@ -77,7 +77,7 @@ public class CommonController
|
||||
try
|
||||
{
|
||||
// 上传文件路径
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
String filePath = QuotedConfig.getUploadPath();
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
@@ -103,7 +103,7 @@ public class CommonController
|
||||
try
|
||||
{
|
||||
// 上传文件路径
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
String filePath = QuotedConfig.getUploadPath();
|
||||
List<String> urls = new ArrayList<String>();
|
||||
List<String> fileNames = new ArrayList<String>();
|
||||
List<String> newFileNames = new ArrayList<String>();
|
||||
@@ -145,7 +145,7 @@ public class CommonController
|
||||
throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
|
||||
}
|
||||
// 本地资源路径
|
||||
String localPath = RuoYiConfig.getProfile();
|
||||
String localPath = QuotedConfig.getProfile();
|
||||
// 数据库资源地址
|
||||
String downloadPath = localPath + FileUtils.stripPrefix(resource);
|
||||
// 下载名称
|
||||
|
||||
@@ -25,7 +25,7 @@ import com.quoted.system.domain.SysCache;
|
||||
/**
|
||||
* 缓存监控
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/monitor/cache")
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.quoted.framework.web.domain.Server;
|
||||
/**
|
||||
* 服务器监控
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/monitor/server")
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import com.quoted.system.service.ISysLogininforService;
|
||||
/**
|
||||
* 系统访问记录
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/monitor/logininfor")
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ import com.quoted.system.service.ISysOperLogService;
|
||||
/**
|
||||
* 操作日志记录
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/monitor/operlog")
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import com.quoted.system.service.ISysUserOnlineService;
|
||||
/**
|
||||
* 在线用户监控
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/monitor/online")
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ import com.quoted.system.service.ISysConfigService;
|
||||
/**
|
||||
* 参数配置 信息操作处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/config")
|
||||
|
||||
@@ -26,7 +26,7 @@ import com.quoted.system.service.ISysDeptService;
|
||||
/**
|
||||
* 部门信息
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/dept")
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ import com.quoted.system.service.ISysDictTypeService;
|
||||
/**
|
||||
* 数据字典信息
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/dict/data")
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ import com.quoted.system.service.ISysDictTypeService;
|
||||
/**
|
||||
* 数据字典信息
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/dict/type")
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.quoted.common.config.RuoYiConfig;
|
||||
import com.quoted.common.config.QuotedConfig;
|
||||
import com.quoted.common.core.domain.AjaxResult;
|
||||
import com.quoted.common.core.domain.entity.SysUser;
|
||||
import com.quoted.common.utils.SecurityUtils;
|
||||
@@ -16,14 +16,14 @@ import com.quoted.system.service.ISysUserService;
|
||||
/**
|
||||
* 首页
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@RestController
|
||||
public class SysIndexController
|
||||
{
|
||||
/** 系统基础配置 */
|
||||
@Autowired
|
||||
private RuoYiConfig ruoyiConfig;
|
||||
private QuotedConfig ruoyiConfig;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.quoted.system.service.ISysMenuService;
|
||||
/**
|
||||
* 登录验证
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@RestController
|
||||
public class SysLoginController
|
||||
|
||||
@@ -25,7 +25,7 @@ import com.quoted.system.service.ISysMenuService;
|
||||
/**
|
||||
* 菜单信息
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/menu")
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import com.quoted.system.service.ISysNoticeService;
|
||||
/**
|
||||
* 公告 信息操作处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/notice")
|
||||
|
||||
@@ -25,7 +25,7 @@ import com.quoted.system.service.ISysPostService;
|
||||
/**
|
||||
* 岗位信息操作处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/post")
|
||||
|
||||
+4
-4
@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.quoted.common.annotation.Log;
|
||||
import com.quoted.common.config.RuoYiConfig;
|
||||
import com.quoted.common.config.QuotedConfig;
|
||||
import com.quoted.common.core.controller.BaseController;
|
||||
import com.quoted.common.core.domain.AjaxResult;
|
||||
import com.quoted.common.core.domain.entity.SysUser;
|
||||
@@ -29,7 +29,7 @@ import com.quoted.system.service.ISysUserService;
|
||||
/**
|
||||
* 个人信息 业务处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/user/profile")
|
||||
@@ -128,13 +128,13 @@ public class SysProfileController extends BaseController
|
||||
if (!file.isEmpty())
|
||||
{
|
||||
LoginUser loginUser = getLoginUser();
|
||||
String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION, true);
|
||||
String avatar = FileUploadUtils.upload(QuotedConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION, true);
|
||||
if (userService.updateUserAvatar(loginUser.getUserId(), avatar))
|
||||
{
|
||||
String oldAvatar = loginUser.getUser().getAvatar();
|
||||
if (StringUtils.isNotEmpty(oldAvatar))
|
||||
{
|
||||
FileUtils.deleteFile(RuoYiConfig.getProfile() + FileUtils.stripPrefix(oldAvatar));
|
||||
FileUtils.deleteFile(QuotedConfig.getProfile() + FileUtils.stripPrefix(oldAvatar));
|
||||
}
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("imgUrl", avatar);
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ import com.quoted.system.service.ISysConfigService;
|
||||
/**
|
||||
* 注册验证
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@RestController
|
||||
public class SysRegisterController extends BaseController
|
||||
|
||||
@@ -32,7 +32,7 @@ import com.quoted.system.service.ISysUserService;
|
||||
/**
|
||||
* 角色信息
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/role")
|
||||
|
||||
@@ -35,7 +35,7 @@ import com.quoted.system.service.ISysUserService;
|
||||
/**
|
||||
* 用户信息
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/user")
|
||||
|
||||
@@ -25,7 +25,7 @@ import io.swagger.annotations.ApiOperation;
|
||||
/**
|
||||
* swagger 用户测试方法
|
||||
*
|
||||
* @author ruoyi
|
||||
* quoted
|
||||
*/
|
||||
@Api("用户信息管理")
|
||||
@RestController
|
||||
|
||||
@@ -2,11 +2,12 @@ package com.quoted.web.core.config;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.quoted.common.config.QuotedConfig;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import com.quoted.common.config.RuoYiConfig;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.models.auth.In;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
@@ -24,21 +25,26 @@ import springfox.documentation.spring.web.plugins.Docket;
|
||||
|
||||
/**
|
||||
* Swagger2的接口配置
|
||||
*
|
||||
* @author ruoyi
|
||||
* <p>
|
||||
* quoted
|
||||
*/
|
||||
@Configuration
|
||||
public class SwaggerConfig
|
||||
{
|
||||
/** 系统基础配置 */
|
||||
public class SwaggerConfig {
|
||||
/**
|
||||
* 系统基础配置
|
||||
*/
|
||||
@Autowired
|
||||
private RuoYiConfig ruoyiConfig;
|
||||
private QuotedConfig quotedConfig;
|
||||
|
||||
/** 是否开启swagger */
|
||||
/**
|
||||
* 是否开启swagger
|
||||
*/
|
||||
@Value("${swagger.enabled}")
|
||||
private boolean enabled;
|
||||
|
||||
/** 设置请求的统一前缀 */
|
||||
/**
|
||||
* 设置请求的统一前缀
|
||||
*/
|
||||
@Value("${swagger.pathMapping}")
|
||||
private String pathMapping;
|
||||
|
||||
@@ -46,8 +52,7 @@ public class SwaggerConfig
|
||||
* 创建API
|
||||
*/
|
||||
@Bean
|
||||
public Docket createRestApi()
|
||||
{
|
||||
public Docket createRestApi() {
|
||||
return new Docket(DocumentationType.OAS_30)
|
||||
// 是否启用Swagger
|
||||
.enable(enabled)
|
||||
@@ -58,7 +63,7 @@ public class SwaggerConfig
|
||||
// 扫描所有有注解的api,用这种方式更灵活
|
||||
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
|
||||
// 扫描指定包中的swagger注解
|
||||
// .apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger"))
|
||||
// .apis(RequestHandlerSelectors.basePackage("com.quoted.project.tool.swagger"))
|
||||
// 扫描所有 .apis(RequestHandlerSelectors.any())
|
||||
.paths(PathSelectors.any())
|
||||
.build()
|
||||
@@ -71,8 +76,7 @@ public class SwaggerConfig
|
||||
/**
|
||||
* 安全模式,这里指定token通过Authorization头请求头传递
|
||||
*/
|
||||
private List<SecurityScheme> securitySchemes()
|
||||
{
|
||||
private List<SecurityScheme> securitySchemes() {
|
||||
List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>();
|
||||
apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue()));
|
||||
return apiKeyList;
|
||||
@@ -81,8 +85,7 @@ public class SwaggerConfig
|
||||
/**
|
||||
* 安全上下文
|
||||
*/
|
||||
private List<SecurityContext> securityContexts()
|
||||
{
|
||||
private List<SecurityContext> securityContexts() {
|
||||
List<SecurityContext> securityContexts = new ArrayList<>();
|
||||
securityContexts.add(
|
||||
SecurityContext.builder()
|
||||
@@ -95,8 +98,7 @@ public class SwaggerConfig
|
||||
/**
|
||||
* 默认的安全上引用
|
||||
*/
|
||||
private List<SecurityReference> defaultAuth()
|
||||
{
|
||||
private List<SecurityReference> defaultAuth() {
|
||||
AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
|
||||
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
|
||||
authorizationScopes[0] = authorizationScope;
|
||||
@@ -108,18 +110,17 @@ public class SwaggerConfig
|
||||
/**
|
||||
* 添加摘要信息
|
||||
*/
|
||||
private ApiInfo apiInfo()
|
||||
{
|
||||
private ApiInfo apiInfo() {
|
||||
// 用ApiInfoBuilder进行定制
|
||||
return new ApiInfoBuilder()
|
||||
// 设置标题
|
||||
.title("标题:若依管理系统_接口文档")
|
||||
.title("标题:quoted管理系统_接口文档")
|
||||
// 描述
|
||||
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
|
||||
// 作者信息
|
||||
.contact(new Contact(ruoyiConfig.getName(), null, null))
|
||||
.contact(new Contact(quotedConfig.getName(), null, null))
|
||||
// 版本
|
||||
.version("版本号:" + ruoyiConfig.getVersion())
|
||||
.version("版本号:" + quotedConfig.getVersion())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ spring:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://localhost:3306/quoted?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: password
|
||||
password: RdCcZOL1QxdYqEot
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# 项目相关配置
|
||||
ruoyi:
|
||||
quoted:
|
||||
# 名称
|
||||
name: RuoYi
|
||||
name: quoted
|
||||
# 版本
|
||||
version: 3.9.2
|
||||
# 版权年份
|
||||
copyrightYear: 2026
|
||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||
profile: D:/ruoyi/uploadPath
|
||||
# 文件路径 示例( Windows配置D:/quoted/uploadPath,Linux配置 /home/quoted/uploadPath)
|
||||
profile: D:/quoted/uploadPath
|
||||
# 获取ip地址开关
|
||||
addressEnabled: false
|
||||
# 验证码类型 math 数字计算 char 字符验证
|
||||
@@ -124,7 +124,7 @@ referer:
|
||||
# 防盗链开关
|
||||
enabled: false
|
||||
# 允许的域名列表
|
||||
allowed-domains: localhost,127.0.0.1,ruoyi.vip,www.ruoyi.vip
|
||||
allowed-domains: localhost,127.0.0.1
|
||||
|
||||
# 防止XSS攻击
|
||||
xss:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Application Version: ${ruoyi.version}
|
||||
Application Version: ${quoted.version}
|
||||
Spring Boot Version: ${spring-boot.version}
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// _ooOoo_ //
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="/home/ruoyi/logs" />
|
||||
<property name="log.path" value="/home/quoted/logs" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.ruoyi" level="info" />
|
||||
<logger name="com.quoted" level="info" />
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user