Bladeren bron

[feat] 调包、增加配置文件\调整对web端接口

limeng 6 maanden geleden
bovenliggende
commit
b8b857c887
30 gewijzigde bestanden met toevoegingen van 352 en 188 verwijderingen
  1. 8 2
      application-webadmin/pom.xml
  2. 1 1
      application-webadmin/src/main/java/com/tourism/webadmin/app/website/controller/BasicToWebController.java
  3. 4 4
      application-webadmin/src/main/java/com/tourism/webadmin/app/website/controller/JobProjectToWebController.java
  4. 4 4
      application-webadmin/src/main/java/com/tourism/webadmin/app/website/controller/TourismProjectToWebController.java
  5. 3 1
      application-webadmin/src/main/java/com/tourism/webadmin/back/controller/LoginToWebController.java
  6. 2 2
      application-webadmin/src/main/java/com/tourism/webadmin/back/dao/SysUserWebMapper.java
  7. 2 2
      application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/SysUserWebMapper.xml
  8. 1 1
      application-webadmin/src/main/java/com/tourism/webadmin/back/dto/SysUserWebDto.java
  9. 1 1
      application-webadmin/src/main/java/com/tourism/webadmin/back/model/CompanyInfo.java
  10. 1 1
      application-webadmin/src/main/java/com/tourism/webadmin/back/model/SysUserWeb.java
  11. 2 7
      application-webadmin/src/main/java/com/tourism/webadmin/back/service/SysUserWebService.java
  12. 4 19
      application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/SysUserWebServiceImpl.java
  13. 8 8
      application-webadmin/src/main/resources/application-dev.yml
  14. 206 0
      application-webadmin/src/main/resources/application-prod.yml
  15. 2 2
      application-webadmin/src/main/resources/application.yml
  16. 1 1
      application-webadmin/src/main/resources/logback-spring.xml
  17. 8 5
      common/common-huaweicloud/common-huaweicloud-obs/pom.xml
  18. 48 0
      common/common-huaweicloud/common-huaweicloud-obs/src/main/java/com/tourism/common/huaweicloud/obs/config/HuaweicloudObsAutoConfiguration.java
  19. 8 8
      common/common-huaweicloud/common-huaweicloud-obs/src/main/java/com/tourism/common/huaweicloud/obs/config/HuaweicloudObsProperties.java
  20. 14 13
      common/common-huaweicloud/common-huaweicloud-obs/src/main/java/com/tourism/common/huaweicloud/obs/util/HuaweicloudObsUpDownloader.java
  21. 12 36
      common/common-huaweicloud/common-huaweicloud-obs/src/main/java/com/tourism/common/huaweicloud/obs/wrapper/HuaweicloudObsTemplate.java
  22. 1 0
      common/common-huaweicloud/common-huaweicloud-obs/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  23. 2 2
      common/common-huaweicloud/pom.xml
  24. 1 1
      common/common-mobile/pom.xml
  25. 1 1
      common/common-online/pom.xml
  26. 0 59
      common/common-qcloud/common-qcloud-cos/src/main/java/com/tourism/common/qcloud/cos/config/QcloudCosAutoConfiguration.java
  27. 0 1
      common/common-qcloud/common-qcloud-cos/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  28. 5 5
      common/common-report/pom.xml
  29. 1 1
      common/pom.xml
  30. 1 0
      pom.xml

+ 8 - 2
application-webadmin/pom.xml

@@ -57,7 +57,7 @@
         </dependency>
         <dependency>
             <groupId>com.tourism</groupId>
-            <artifactId>common-qcloud-cos</artifactId>
+            <artifactId>common-huaweicloud-obs</artifactId>
             <version>1.0.0</version>
         </dependency>
         <dependency>
@@ -80,7 +80,13 @@
             <artifactId>common-dict</artifactId>
             <version>1.0.0</version>
         </dependency>
-	</dependencies>
+<!--        <dependency>-->
+<!--            <groupId>com.anji-plus</groupId>-->
+<!--            <artifactId>spring-boot-starter-captcha</artifactId>-->
+<!--            <version>1.3.0</version>-->
+<!--            <scope>compile</scope>-->
+<!--        </dependency>-->
+    </dependencies>
 
 	<build>
 		<plugins>

+ 1 - 1
application-webadmin/src/main/java/com/tourism/webadmin/app/website/controller/BasicToWebController.java

@@ -25,7 +25,7 @@ import java.util.List;
 @Slf4j
 @RestController
 @SaIgnore
-@RequestMapping("/admin/website/basic")
+@RequestMapping("/website/basic")
 public class BasicToWebController {
 
     @Autowired

+ 4 - 4
application-webadmin/src/main/java/com/tourism/webadmin/app/website/controller/JobProjectToWebController.java

@@ -29,7 +29,7 @@ import java.util.List;
 @Slf4j
 @RestController
 @SaIgnore
-@RequestMapping("/admin/basic/jobProject")
+@RequestMapping("/website/basic/jobProject")
 public class JobProjectToWebController {
 
     @Autowired
@@ -63,9 +63,9 @@ public class JobProjectToWebController {
      * @param id 指定对象主键Id。
      * @return 应答结果对象,包含对象详情。
      */
-    @SaCheckPermission("jobProject.view")
-    @GetMapping("/view")
-    public ResponseResult<JobProjectVo> view(@RequestParam Long id) {
+//    @SaCheckPermission("jobProject.view")
+    @GetMapping("/detail")
+    public ResponseResult<JobProjectVo> detail(@RequestParam Long id) {
         JobProject jobProject = jobProjectService.getByIdWithRelation(id, MyRelationParam.full());
         if (jobProject == null) {
             return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);

+ 4 - 4
application-webadmin/src/main/java/com/tourism/webadmin/app/website/controller/TourismProjectToWebController.java

@@ -32,7 +32,7 @@ import java.util.List;
 @Slf4j
 @RestController
 @SaIgnore
-@RequestMapping("/admin/basic/tourismProject")
+@RequestMapping("/website/tourism/project")
 public class TourismProjectToWebController {
 
     @Autowired
@@ -67,9 +67,9 @@ public class TourismProjectToWebController {
      * @param id 指定对象主键Id。
      * @return 应答结果对象,包含对象详情。
      */
-    @SaCheckPermission("tourismProject.view")
-    @GetMapping("/view")
-    public ResponseResult<TourismProjectVo> view(@RequestParam Long id) {
+//    @SaCheckPermission("tourismProject.view")
+    @GetMapping("/detail")
+    public ResponseResult<TourismProjectVo> detail(@RequestParam Long id) {
         TourismProject tourismProject = tourismProjectService.getByIdWithRelation(id, MyRelationParam.full());
         if (tourismProject == null) {
             return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);

+ 3 - 1
application-webadmin/src/main/java/com/tourism/webadmin/back/controller/LoginToWebController.java

@@ -28,9 +28,11 @@ import com.tourism.common.online.service.OnlineOperationService;
 import com.tourism.common.redis.cache.SessionCacheHelper;
 import com.tourism.common.report.service.ReportOperationService;
 import com.tourism.common.satoken.util.SaTokenUtil;
+import com.tourism.webadmin.back.model.SysUserWeb;
 import com.tourism.webadmin.back.service.SmsService;
+import com.tourism.webadmin.back.service.SysUserWebService;
 import com.tourism.webadmin.config.ApplicationConfig;
-import com.tourism.webadmin.upms.dto.SysUserWebDto;
+import com.tourism.webadmin.back.dto.SysUserWebDto;
 import com.tourism.webadmin.upms.model.*;
 import com.tourism.webadmin.upms.model.constant.SysMenuType;
 import com.tourism.webadmin.upms.model.constant.SysOnlineMenuPermType;

+ 2 - 2
application-webadmin/src/main/java/com/tourism/webadmin/upms/dao/SysUserWebMapper.java → application-webadmin/src/main/java/com/tourism/webadmin/back/dao/SysUserWebMapper.java

@@ -1,8 +1,8 @@
-package com.tourism.webadmin.upms.dao;
+package com.tourism.webadmin.back.dao;
 
 import com.tourism.common.core.base.dao.BaseDaoMapper;
 import com.tourism.webadmin.upms.model.SysUser;
-import com.tourism.webadmin.upms.model.SysUserWeb;
+import com.tourism.webadmin.back.model.SysUserWeb;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.*;

+ 2 - 2
application-webadmin/src/main/java/com/tourism/webadmin/upms/dao/mapper/SysUserWebMapper.xml → application-webadmin/src/main/java/com/tourism/webadmin/back/dao/mapper/SysUserWebMapper.xml

@@ -1,7 +1,7 @@
 <?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.tourism.webadmin.upms.dao.SysUserWebMapper">
-    <resultMap id="BaseResultMap" type="com.tourism.webadmin.upms.model.SysUserWeb">
+<mapper namespace="com.tourism.webadmin.back.dao.SysUserWebMapper">
+    <resultMap id="BaseResultMap" type="com.tourism.webadmin.back.model.SysUserWeb">
         <id column="user_id" jdbcType="BIGINT" property="userId"/>
         <result column="login_name" jdbcType="VARCHAR" property="loginName"/>
         <result column="password" jdbcType="VARCHAR" property="password"/>

+ 1 - 1
application-webadmin/src/main/java/com/tourism/webadmin/upms/dto/SysUserWebDto.java → application-webadmin/src/main/java/com/tourism/webadmin/back/dto/SysUserWebDto.java

@@ -1,4 +1,4 @@
-package com.tourism.webadmin.upms.dto;
+package com.tourism.webadmin.back.dto;
 
 import com.tourism.common.core.validator.AddGroup;
 import com.tourism.common.core.validator.UpdateGroup;

+ 1 - 1
application-webadmin/src/main/java/com/tourism/webadmin/back/model/CompanyInfo.java

@@ -71,7 +71,7 @@ public class CompanyInfo {
     /**
      * 公司图片上传地址。
      */
-    @UploadFlagColumn(storeType = UploadStoreTypeEnum.LOCAL_SYSTEM)
+    @UploadFlagColumn(storeType = UploadStoreTypeEnum.HUAWEI_OBS_SYSTEM)
     @TableField(value = "company_url")
     private String companyUrl;
 

+ 1 - 1
application-webadmin/src/main/java/com/tourism/webadmin/upms/model/SysUserWeb.java → application-webadmin/src/main/java/com/tourism/webadmin/back/model/SysUserWeb.java

@@ -1,4 +1,4 @@
-package com.tourism.webadmin.upms.model;
+package com.tourism.webadmin.back.model;
 
 import com.baomidou.mybatisplus.annotation.*;
 import com.tourism.webadmin.upms.model.constant.SysUserType;

+ 2 - 7
application-webadmin/src/main/java/com/tourism/webadmin/upms/service/SysUserWebService.java → application-webadmin/src/main/java/com/tourism/webadmin/back/service/SysUserWebService.java

@@ -1,12 +1,7 @@
-package com.tourism.webadmin.upms.service;
+package com.tourism.webadmin.back.service;
 
 import com.tourism.common.core.base.service.IBaseService;
-import com.tourism.common.core.object.CallResult;
-import com.tourism.webadmin.upms.model.SysUser;
-import com.tourism.webadmin.upms.model.SysUserWeb;
-
-import java.util.List;
-import java.util.Set;
+import com.tourism.webadmin.back.model.SysUserWeb;
 
 /**
  * 用户管理数据操作服务接口。

+ 4 - 19
application-webadmin/src/main/java/com/tourism/webadmin/upms/service/impl/SysUserWebServiceImpl.java → application-webadmin/src/main/java/com/tourism/webadmin/back/service/impl/SysUserWebServiceImpl.java

@@ -1,38 +1,23 @@
-package com.tourism.webadmin.upms.service.impl;
+package com.tourism.webadmin.back.service.impl;
 
-import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.util.StrUtil;
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.*;
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
-import com.github.pagehelper.page.PageMethod;
-import com.tourism.webadmin.upms.service.*;
-import com.tourism.webadmin.upms.dao.*;
-import com.tourism.webadmin.upms.model.*;
+import com.tourism.webadmin.back.dao.SysUserWebMapper;
+import com.tourism.webadmin.back.model.SysUserWeb;
+import com.tourism.webadmin.back.service.SysUserWebService;
 import com.tourism.webadmin.upms.model.constant.SysUserStatus;
-import com.tourism.common.ext.util.BizWidgetDatasourceExtHelper;
 import com.tourism.common.ext.base.BizWidgetDatasource;
-import com.tourism.common.ext.constant.BizWidgetDatasourceType;
 import com.tourism.common.core.base.dao.BaseDaoMapper;
-import com.tourism.common.core.constant.UserFilterGroup;
 import com.tourism.common.core.constant.GlobalDeletedFlag;
 import com.tourism.common.core.object.*;
 import com.tourism.common.core.base.service.BaseService;
-import com.tourism.common.core.util.MyModelUtil;
-import com.tourism.common.core.util.MyPageUtil;
 import com.tourism.common.sequence.wrapper.IdGeneratorWrapper;
-import com.github.pagehelper.Page;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.security.crypto.password.PasswordEncoder;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import jakarta.annotation.PostConstruct;
 import java.util.*;
-import java.util.stream.Collectors;
 
 /**
  * 用户管理数据操作服务类。

+ 8 - 8
application-webadmin/src/main/resources/application-dev.yml

@@ -164,15 +164,15 @@ common-report:
   viewUrlList:
   - ${common-report.urlPrefix}/reportOperation/listData/
 
-qcloud:
-  cos:
-    enabled: false
+huaweicloud:
+  obs:
+    enabled: true
     expireSeconds: 1000
-    # 下面几项均需在申请腾讯云COS后,根据自己的实际情况进行配置。
-    accessKey: your-accessKey
-    secretKey: your-secretKey
-    region: your-region
-    bucketName: your-bucketname
+    # 下面几项均需在申请华为云OBS后,根据自己的实际情况进行配置。
+    endpoint: obs.cn-north-4.myhuaweicloud.com
+    accessKey: C9WI47G4DXXN2EMIL1OO
+    secretKey: tfrZ9aw8wjfotUlG6IUCMjtAgzIzErL5qpPPt9AO
+    bucketName: xiaoyaotravel
 
 sa-token:
   # token 名称(同时也是 cookie 名称)

+ 206 - 0
application-webadmin/src/main/resources/application-prod.yml

@@ -0,0 +1,206 @@
+spring:
+  data:
+    redis:
+      host: localhost
+      port: 6379
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    druid:
+      # 数据库链接 [主数据源]
+      main:
+        url: jdbc:mysql://192.168.0.190:3306/tourism?characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai
+        username: root
+        password: Lm10921234
+      # 默认生成的操作日志数据源配置。
+      operation-log:
+        url: jdbc:mysql://192.168.0.190:3306/tourism?characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai
+        username: root
+        password: Lm10921234
+      # 默认生成的全局编码字典数据源配置。
+      global-dict:
+        url: jdbc:mysql://192.168.0.190:3306/tourism?characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai
+        username: root
+        password: Lm10921234
+      # 默认生成的工作流及在线表单数据源配置。
+      common-flow-online:
+        url: jdbc:mysql://192.168.0.190:3306/tourism?characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai
+        username: root
+        password: Lm10921234
+      # 默认生成的统计打印模块的数据源配置。
+      common-report:
+        url: jdbc:mysql://192.168.0.190:3306/tourism?characterEncoding=utf8&useSSL=true&serverTimezone=Asia/Shanghai
+        username: root
+        password: Lm10921234
+      driverClassName: com.mysql.cj.jdbc.Driver
+      name: application-webadmin
+      initialSize: 10
+      minIdle: 10
+      maxActive: 50
+      maxWait: 60000
+      timeBetweenEvictionRunsMillis: 60000
+      minEvictableIdleTimeMillis: 300000
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      maxOpenPreparedStatements: 20
+      validationQuery: SELECT 'x'
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
+      filters: stat,wall
+      useGlobalDataSourceStat: true
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*,/actuator/*"
+      stat-view-servlet:
+        enabled: true
+        urlPattern: /druid/*
+        resetEnable: true
+
+application:
+  # 初始化密码。
+  defaultUserPassword: 123456
+  # 缺省的文件上传根目录。
+  uploadFileBaseDir: ./zz-resource/upload-files/app
+  # 跨域的IP(http://192.168.10.10:8086)白名单列表,多个IP之间逗号分隔(* 表示全部信任,空白表示禁用跨域信任)。
+  credentialIpList: "*"
+  # Session的用户和数据权限在Redis中的过期时间(秒)。一定要和sa-token.timeout
+  sessionExpiredSeconds: 86400
+  # 是否排他登录。
+  excludeLogin: false
+
+# 这里仅仅是一个第三方配置的示例,如果没有接入斯三方系统,
+# 这里的配置项也不会影响到系统的行为,如果觉得多余,也可以手动删除。
+third-party:
+  # 第三方系统接入的用户鉴权配置。
+  auth:
+  - appCode: orange-forms-default
+    # 访问第三方系统接口的URL前缀,橙单会根据功能添加接口路径的其余部分,
+    # 比如获取用户Token的接口 http://localhost:8083/orangePluginTest/getTokenData
+    baseUrl: http://localhost:8083/orangePlugin
+    # 第三方应用鉴权的HTTP请求令牌头的KEY。
+    tokenHeaderKey: Authorization
+    # 第三方返回的用户Token数据的缓存过期时长,单位秒。
+    # 如果为0,则不缓存,每次涉及第三方的请求,都会发出http请求,交由第三方验证,这样对系统性能会有影响。
+    tokenExpiredSeconds: 60
+    # 第三方返回的权限数据的缓存过期时长,单位秒。
+    permExpiredSeconds: 86400
+
+# 这里仅仅是一个第三方配置的示例,如果没有接入斯三方系统,
+# 这里的配置项也不会影响到系统的行为,如果觉得多余,也可以手动删除。
+common-ext:
+  urlPrefix: /admin/commonext
+  # 这里可以配置多个第三方应用,这里的应用数量,通常会和上面third-party.auth的配置数量一致。
+  apps:
+    # 应用唯一编码,尽量不要使用中文。
+  - appCode: orange-forms-default
+    # 业务组件的数据源配置。
+    bizWidgetDatasources:
+    # 组件的类型,多个类型之间可以逗号分隔。
+    - types: upms_user,upms_dept
+      # 组件获取列表数据的接口地址。
+      listUrl: http://localhost:8083/orangePlugin/listBizWidgetData
+      # 组件获取详情数据的接口地址。
+      viewUrl: http://localhost:8083/orangePlugin/viewBizWidgetData
+
+common-sequence:
+  # Snowflake 分布式Id生成算法所需的WorkNode参数值。
+  snowflakeWorkNode: 1
+
+# 存储session数据的Redis,所有服务均需要,因此放到公共配置中。
+# 根据实际情况,该Redis也可以用于存储其他数据。
+common-redis:
+  # redisson的配置。每个服务可以自己的配置文件中覆盖此选项。
+  redisson:
+    # 如果该值为false,系统将不会创建RedissionClient的bean。
+    enabled: true
+    # mode的可用值为,single/cluster/sentinel/master-slave
+    mode: single
+    # single: 单机模式
+    #   address: redis://localhost:6379
+    # cluster: 集群模式
+    #   每个节点逗号分隔,同时每个节点前必须以redis://开头。
+    #   address: redis://localhost:6379,redis://localhost:6378,...
+    # sentinel:
+    #   每个节点逗号分隔,同时每个节点前必须以redis://开头。
+    #   address: redis://localhost:6379,redis://localhost:6378,...
+    # master-slave:
+    #   每个节点逗号分隔,第一个为主节点,其余为从节点。同时每个节点前必须以redis://开头。
+    #   address: redis://localhost:6379,redis://localhost:6378,...
+    address: redis://localhost:6379
+    # 链接超时,单位毫秒。
+    timeout: 6000
+    # 单位毫秒。分布式锁的超时检测时长。
+    # 如果一次锁内操作超该毫秒数,或在释放锁之前异常退出,Redis会在该时长之后主动删除该锁使用的key。
+    lockWatchdogTimeout: 60000
+    # redis 密码,空可以不填。
+    password: 1234qwer
+    pool:
+      # 连接池数量。
+      poolSize: 20
+      # 连接池中最小空闲数量。
+      minIdle: 5
+
+common-report:
+  # 注意不要以反斜杠(/)结尾。
+  urlPrefix: /admin/report
+  # 统计打印表单业务数据上传资源路径
+  uploadFileBaseDir: ./zz-resource/upload-files/report
+  # 如果为false,报表模块的所有Controller中的接口将不能使用。
+  operationEnabled: true
+  # 该配置项仅当打印模板中,打印图片字段时,才会需要。
+  # 这里的url配置只是一个示例,并不能保证开箱即用,代码示例和说明可参考common-report模块
+  # example包内的ReportExampleController中的代码和详细说明。
+  imageDownloadUrl: "http://localhost:8082/admin/report/example/downloadDirectly"
+  # 该配置用于报表部分的数据权限过滤功能。
+  # 当前数据权限需要获取指定部门Ids的所有下级子部门Ids的时候,会调用该接口。
+  dataPermAllChildrenDeptIdUrl: "http://localhost:8082/admin/upms/sysDept/listAllChildDeptIdByParentIds"
+  # 业务表和统计打印内置表是否跨库。
+  enabledMultiDatabaseWrite: true
+  # 当前服务是否为可视化后台服务。
+  isVisualization: false
+  # 下面的url列表,请保持反斜杠(/)结尾。
+  viewUrlList:
+  - ${common-report.urlPrefix}/reportOperation/listData/
+
+huaweicloud:
+  obs:
+    enabled: true
+    expireSeconds: 1000
+    # 下面几项均需在申请华为云OBS后,根据自己的实际情况进行配置。
+    endpoint: obs.cn-north-4.myhuaweicloud.com
+    accessKey: C9WI47G4DXXN2EMIL1OO
+    secretKey: tfrZ9aw8wjfotUlG6IUCMjtAgzIzErL5qpPPt9AO
+    bucketName: xiaoyaotravel
+
+sa-token:
+  # token 名称(同时也是 cookie 名称)
+  token-name: Authorization
+  # token 有效期(单位:秒) 默认30天,-1 代表永久有效
+  timeout: ${application.sessionExpiredSeconds}
+  # token 最低活跃频率(单位:秒),如果 token 超过此时间没有访问系统就会被冻结,默认-1 代表不限制,永不冻结
+  active-timeout: -1
+  # 是否允许同一账号多地同时登录 (为 true 时允许一起登录, 为 false 时新登录挤掉旧登录)
+  is-concurrent: true
+  # 在多人登录同一账号时,是否共用一个 token (为 true 时所有登录共用一个 token, 为 false 时每次登录新建一个 token)
+  is-share: false
+  # token 风格(默认可取值:uuid、simple-uuid、random-32、random-64、random-128、tik)
+  token-style: uuid
+  # 是否输出操作日志
+  is-log: true
+  # 配置 Sa-Token 单独使用的 Redis 连接
+  # 修改这里Sa-Token的Redis配置,同时也要修改当前配置文件顶部spring.data.redis的相关配置。
+  alone-redis:
+    # Redis数据库索引(默认为0)
+    database: 0
+    # Redis服务器地址
+    host: localhost
+    # Redis服务器连接端口
+    port: 6379
+    # Redis服务器连接密码(默认为空)
+    password:
+    # 连接超时时间
+    timeout: 10s
+  is-read-header: true
+  is-read-cookie: false

+ 2 - 2
application-webadmin/src/main/resources/application.yml

@@ -22,7 +22,7 @@ spring:
   application:
     name: application-webadmin
   profiles:
-    active: dev
+    active: prod
   servlet:
     multipart:
       max-file-size: 50MB
@@ -173,4 +173,4 @@ management:
 common-log:
   # 操作日志配置,对应配置文件common-log/OperationLogProperties.java
   operation-log:
-    enabled: true
+    enabled: true

+ 1 - 1
application-webadmin/src/main/resources/logback-spring.xml

@@ -9,7 +9,7 @@ debug:当此属性设置为true时,将打印出logback内部日志信息,
     <springProperty scope="context" name="logging.level" source="logging.level" defaultValue="info"/>
 
     <!-- 定义日志的根目录 -->
-    <property name="LOG_HOME" value="./zzlogs/application-webadmin" />
+    <property name="LOG_HOME" value="/data/business/logs" />
     <!-- 定义日志文件名称 -->
     <property name="LOG_NAME" value="application-webadmin"></property>
     <property name="LOG_PATTERN" value="[%-5level] [%d{yyyy-MM-dd HH:mm:ss}] [%thread] ==> %msg%n" />

+ 8 - 5
common/common-qcloud/common-qcloud-cos/pom.xml → common/common-huaweicloud/common-huaweicloud-obs/pom.xml

@@ -3,19 +3,22 @@
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
-        <artifactId>common-qcloud</artifactId>
+        <artifactId>common-huaweicloud</artifactId>
         <groupId>com.tourism</groupId>
         <version>1.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>common-qcloud-cos</artifactId>
+    <artifactId>common-huaweicloud-obs</artifactId>
+    <version>1.0.0</version>
+    <name>common-huaweicloud-obs</name>
+    <packaging>jar</packaging>
 
     <dependencies>
         <dependency>
-            <groupId>com.qcloud</groupId>
-            <artifactId>cos_api</artifactId>
-            <version>5.6.54</version>
+            <groupId>com.huaweicloud</groupId>
+            <artifactId>esdk-obs-java-bundle</artifactId>
+            <version>3.23.9</version>
         </dependency>
         <dependency>
             <groupId>com.tourism</groupId>

+ 48 - 0
common/common-huaweicloud/common-huaweicloud-obs/src/main/java/com/tourism/common/huaweicloud/obs/config/HuaweicloudObsAutoConfiguration.java

@@ -0,0 +1,48 @@
+package com.tourism.common.huaweicloud.obs.config;
+
+import com.obs.services.ObsClient;
+import com.tourism.common.huaweicloud.obs.wrapper.HuaweicloudObsTemplate;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+
+/**
+ * common-huaweicloud-obs块的自动配置引导类。仅当配置项huaweicloud.obs.enabled为true的时候加载。
+ *
+ * @author 吃饭睡觉
+ * @date 2024-09-06
+ */
+@EnableConfigurationProperties(HuaweicloudObsProperties.class)
+@ConditionalOnProperty(prefix = "huaweicloud.obs", name = "enabled")
+public class HuaweicloudObsAutoConfiguration {
+
+    /**
+     * 将华为云OBS原生的客户端类封装成bean对象,便于集成,同时也可以灵活使用客户端的所有功能。
+     *
+     * @param p 属性配置对象。
+     * @return 华为云OBS的原生客户端对象。
+     */
+    @Bean
+    @ConditionalOnMissingBean
+    public ObsClient obsClient(HuaweicloudObsProperties p) {
+        ObsClient client = new ObsClient(p.getAccessKey(), p.getSecretKey(), p.getEndpoint());
+        if (!client.headBucket(p.getBucketName())) {
+            client.createBucket(p.getBucketName());
+        }
+        return client;
+    }
+
+    /**
+     * 封装的华为云OBS模板类。
+     *
+     * @param p 属性配置对象。
+     * @param c 华为云OBS的原生客户端bean对象。
+     * @return 华为云OBS模板的bean对象。
+     */
+    @Bean
+    @ConditionalOnMissingBean
+    public HuaweicloudObsTemplate huaweicloudObsTemplate(HuaweicloudObsProperties p, ObsClient c) {
+        return new HuaweicloudObsTemplate(p, c);
+    }
+}

+ 8 - 8
common/common-qcloud/common-qcloud-cos/src/main/java/com/tourism/common/qcloud/cos/config/QcloudCosProperties.java → common/common-huaweicloud/common-huaweicloud-obs/src/main/java/com/tourism/common/huaweicloud/obs/config/HuaweicloudObsProperties.java

@@ -1,19 +1,23 @@
-package com.tourism.common.qcloud.cos.config;
+package com.tourism.common.huaweicloud.obs.config;
 
 import lombok.Data;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 
 /**
- * common-qcloud-cos模块的配置类。
+ * common-huaweicloud-ob模块的配置类。
  *
  * @author 吃饭睡觉
  * @date 2024-09-06
  */
 @Data
-@ConfigurationProperties(prefix = "qcloud.cos")
-public class QcloudCosProperties {
+@ConfigurationProperties(prefix = "huaweicloud.obs")
+public class HuaweicloudObsProperties {
 
     /**
+     * 访问入口地址。
+     */
+    private String endpoint;
+    /**
      * 访问安全的key。
      */
     private String accessKey;
@@ -22,10 +26,6 @@ public class QcloudCosProperties {
      */
     private String secretKey;
     /**
-     * 存储桶所在区域。
-     */
-    private String region;
-    /**
      * 缺省桶名称。
      */
     private String bucketName;

+ 14 - 13
common/common-qcloud/common-qcloud-cos/src/main/java/com/tourism/common/qcloud/cos/util/QcloudCosUpDownloader.java → common/common-huaweicloud/common-huaweicloud-obs/src/main/java/com/tourism/common/huaweicloud/obs/util/HuaweicloudObsUpDownloader.java

@@ -1,4 +1,4 @@
-package com.tourism.common.qcloud.cos.util;
+package com.tourism.common.huaweicloud.obs.util;
 
 import cn.hutool.core.io.IoUtil;
 import cn.hutool.core.util.BooleanUtil;
@@ -7,7 +7,7 @@ import com.tourism.common.core.upload.BaseUpDownloader;
 import com.tourism.common.core.upload.UpDownloaderFactory;
 import com.tourism.common.core.upload.UploadResponseInfo;
 import com.tourism.common.core.upload.UploadStoreTypeEnum;
-import com.tourism.common.qcloud.cos.wrapper.QcloudCosTemplate;
+import com.tourism.common.huaweicloud.obs.wrapper.HuaweicloudObsTemplate;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@@ -20,24 +20,24 @@ import java.io.IOException;
 import java.io.InputStream;
 
 /**
- * 基于腾讯云COS上传和下载文件操作的工具类。
+ * 基于华为云OBS上传和下载文件操作的工具类。
  *
  * @author 吃饭睡觉
  * @date 2024-09-06
  */
 @Slf4j
 @Component
-@ConditionalOnProperty(prefix = "qcloud.cos", name = "enabled")
-public class QcloudCosUpDownloader extends BaseUpDownloader {
+@ConditionalOnProperty(prefix = "huaweicloud.obs", name = "enabled")
+public class HuaweicloudObsUpDownloader extends BaseUpDownloader {
 
     @Autowired
-    private QcloudCosTemplate qcloudCosTemplate;
+    private HuaweicloudObsTemplate huaweicloudObsTemplate;
     @Autowired
     private UpDownloaderFactory factory;
 
     @PostConstruct
     public void doRegister() {
-        factory.registerUpDownloader(UploadStoreTypeEnum.QCLOUD_COS_SYTEM, this);
+        factory.registerUpDownloader(UploadStoreTypeEnum.HUAWEI_OBS_SYSTEM, this);
     }
 
     @Override
@@ -71,7 +71,7 @@ public class QcloudCosUpDownloader extends BaseUpDownloader {
             boolean asImage) {
         String uploadPath = this.makeFullPath(null, modelName, fieldName, asImage);
         String fullFileanme = uploadPath + "/" + fileName;
-        return qcloudCosTemplate.getStream(fullFileanme);
+        return huaweicloudObsTemplate.getStream(fullFileanme);
     }
 
     @Override
@@ -86,7 +86,7 @@ public class QcloudCosUpDownloader extends BaseUpDownloader {
         String fullFileanme = uploadPath + "/" + fileName;
         this.downloadInternal(fullFileanme, fileName, response);
     }
-
+    
     @Override
     public void doDownload(
             String rootBaseDir,
@@ -101,7 +101,7 @@ public class QcloudCosUpDownloader extends BaseUpDownloader {
         String fullFileanme = pathBuilder.append(fileName).toString();
         this.downloadInternal(fullFileanme, fileName, response);
     }
-    
+
     private UploadResponseInfo doUploadInternally(
             String serviceContextPath,
             String uploadPath,
@@ -113,15 +113,16 @@ public class QcloudCosUpDownloader extends BaseUpDownloader {
         }
         responseInfo.setUploadPath(uploadPath);
         super.fillUploadResponseInfo(responseInfo, serviceContextPath, uploadFile.getOriginalFilename());
-        qcloudCosTemplate.putObject(uploadPath + "/" + responseInfo.getFilename(), uploadFile.getInputStream());
+        huaweicloudObsTemplate.putObject(uploadPath + "/" + responseInfo.getFilename(), uploadFile.getInputStream());
         return responseInfo;
     }
 
-    private void downloadInternal(String fullFileanme, String fileName, HttpServletResponse response) throws IOException {
+    private void downloadInternal(String fullFileanme, String fileName, HttpServletResponse response)
+            throws IOException {
         response.setHeader("content-type", "application/octet-stream");
         response.setContentType("application/octet-stream");
         response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
-        InputStream in = qcloudCosTemplate.getStream(fullFileanme);
+        InputStream in = huaweicloudObsTemplate.getStream(fullFileanme);
         IoUtil.copy(in, response.getOutputStream());
         in.close();
     }

+ 12 - 36
common/common-qcloud/common-qcloud-cos/src/main/java/com/tourism/common/qcloud/cos/wrapper/QcloudCosTemplate.java → common/common-huaweicloud/common-huaweicloud-obs/src/main/java/com/tourism/common/huaweicloud/obs/wrapper/HuaweicloudObsTemplate.java

@@ -1,11 +1,10 @@
-package com.tourism.common.qcloud.cos.wrapper;
+package com.tourism.common.huaweicloud.obs.wrapper;
 
 import cn.hutool.core.date.DateField;
 import cn.hutool.core.date.DateUtil;
-import com.tourism.common.qcloud.cos.config.QcloudCosProperties;
-import com.qcloud.cos.COSClient;
-import com.qcloud.cos.http.HttpMethodName;
-import com.qcloud.cos.model.ObjectMetadata;
+import com.obs.services.ObsClient;
+import com.obs.services.model.ObjectMetadata;
+import com.tourism.common.huaweicloud.obs.config.HuaweicloudObsProperties;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.io.FileUtils;
 
@@ -13,22 +12,21 @@ import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Date;
-import java.util.HashMap;
 
 /**
- * 封装的腾讯云COS客户端模板类。
+ * 封装的华为云OBS客户端模板类。
  *
  * @author 吃饭睡觉
  * @date 2024-09-06
  */
 @Slf4j
-public class QcloudCosTemplate {
+public class HuaweicloudObsTemplate {
 
     private static final String TMP_DIR = System.getProperty("java.io.tmpdir") + File.separator;
-    private final QcloudCosProperties properties;
-    private final COSClient client;
+    private final HuaweicloudObsProperties properties;
+    private final ObsClient client;
 
-    public QcloudCosTemplate(QcloudCosProperties properties, COSClient client) {
+    public HuaweicloudObsTemplate(HuaweicloudObsProperties properties, ObsClient client) {
         super();
         this.properties = properties;
         this.client = client;
@@ -42,7 +40,7 @@ public class QcloudCosTemplate {
      */
     public boolean bucketExists(String bucketName) {
         try {
-            return client.doesBucketExist(bucketName);
+            return client.headBucket(bucketName);
         } catch (Exception e) {
             log.error("", e);
         }
@@ -55,7 +53,7 @@ public class QcloudCosTemplate {
      * @param bucketName 桶名称。
      */
     public void makeBucket(String bucketName) {
-        if (!client.doesBucketExist(bucketName)) {
+        if (!client.headBucket(bucketName)) {
             client.createBucket(bucketName);
         }
     }
@@ -89,7 +87,7 @@ public class QcloudCosTemplate {
      * @param stream     读取后上传的文件流。
      */
     public void putObject(String bucketName, String objectName, InputStream stream) {
-        client.putObject(bucketName, objectName, stream, null);
+        client.putObject(bucketName, objectName, stream);
     }
 
     /**
@@ -172,28 +170,6 @@ public class QcloudCosTemplate {
     }
 
     /**
-     * 获取指定文件的URL。
-     *
-     * @param bucketName 桶名称。
-     * @param objectName 对象名称。
-     * @return 指定文件的URL。
-     */
-    public String getObjectUrl(String bucketName, String objectName) {
-        return client.generatePresignedUrl(bucketName, objectName, getExpiredDate(),
-                HttpMethodName.GET, new HashMap<>(1), new HashMap<>(1)).toString();
-    }
-
-    /**
-     * 获取指定文件的URL。桶名称为配置中的桶名称。
-     *
-     * @param objectName 对象名称。
-     * @return 指定文件的URL。
-     */
-    public String getObjectUrl(String objectName) {
-        return this.getObjectUrl(properties.getBucketName(), objectName);
-    }
-
-    /**
      * 获取对象状态信息。
      *
      * @param bucketName 桶名称。

+ 1 - 0
common/common-huaweicloud/common-huaweicloud-obs/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@@ -0,0 +1 @@
+com.tourism.common.huaweicloud.obs.config.HuaweicloudObsAutoConfiguration

+ 2 - 2
common/common-qcloud/pom.xml → common/common-huaweicloud/pom.xml

@@ -9,10 +9,10 @@
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>common-qcloud</artifactId>
+    <artifactId>common-huaweicloud</artifactId>
     <packaging>pom</packaging>
 
     <modules>
-        <module>common-qcloud-cos</module>
+        <module>common-huaweicloud-obs</module>
     </modules>
 </project>

+ 1 - 1
common/common-mobile/pom.xml

@@ -37,7 +37,7 @@
         </dependency>
         <dependency>
             <groupId>com.tourism</groupId>
-            <artifactId>common-qcloud-cos</artifactId>
+            <artifactId>common-huaweicloud-obs</artifactId>
             <version>1.0.0</version>
         </dependency>
         <dependency>

+ 1 - 1
common/common-online/pom.xml

@@ -52,7 +52,7 @@
         </dependency>
         <dependency>
             <groupId>com.tourism</groupId>
-            <artifactId>common-qcloud-cos</artifactId>
+            <artifactId>common-huaweicloud-obs</artifactId>
             <version>1.0.0</version>
         </dependency>
         <dependency>

+ 0 - 59
common/common-qcloud/common-qcloud-cos/src/main/java/com/tourism/common/qcloud/cos/config/QcloudCosAutoConfiguration.java

@@ -1,59 +0,0 @@
-package com.tourism.common.qcloud.cos.config;
-
-import com.tourism.common.qcloud.cos.wrapper.QcloudCosTemplate;
-import com.qcloud.cos.COSClient;
-import com.qcloud.cos.ClientConfig;
-import com.qcloud.cos.auth.BasicCOSCredentials;
-import com.qcloud.cos.auth.COSCredentials;
-import com.qcloud.cos.http.HttpProtocol;
-import com.qcloud.cos.region.Region;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-
-/**
- * common-qcloud-cos块的自动配置引导类。仅当配置项qcloud.cos.enabled为true的时候加载。
- *
- * @author 吃饭睡觉
- * @date 2024-09-06
- */
-@EnableConfigurationProperties(QcloudCosProperties.class)
-@ConditionalOnProperty(prefix = "qcloud.cos", name = "enabled")
-public class QcloudCosAutoConfiguration {
-
-    /**
-     * 将腾讯云COS原生的客户端类封装成bean对象,便于集成,同时也可以灵活使用客户端的所有功能。
-     *
-     * @param p 属性配置对象。
-     * @return 腾讯云COS的原生客户端对象。
-     */
-    @Bean
-    @ConditionalOnMissingBean
-    public COSClient qcloudCosClient(QcloudCosProperties p) {
-        COSCredentials cred = new BasicCOSCredentials(p.getAccessKey(), p.getSecretKey());
-        Region region = new Region(p.getRegion());
-        ClientConfig clientConfig = new ClientConfig(region);
-        // 这里建议设置使用 https 协议
-        // 从 5.6.54 版本开始,默认使用了 https
-        clientConfig.setHttpProtocol(HttpProtocol.https);
-        COSClient client = new COSClient(cred, clientConfig);
-        if (!client.doesBucketExist(p.getBucketName())) {
-            client.createBucket(p.getBucketName());
-        }
-        return client;
-    }
-
-    /**
-     * 封装的腾讯云COS模板类。
-     *
-     * @param p 属性配置对象。
-     * @param c 腾讯云COS的原生客户端bean对象。
-     * @return 腾讯云COS模板的bean对象。
-     */
-    @Bean
-    @ConditionalOnMissingBean
-    public QcloudCosTemplate qcloudCosTemplate(QcloudCosProperties p, COSClient c) {
-        return new QcloudCosTemplate(p, c);
-    }
-}

+ 0 - 1
common/common-qcloud/common-qcloud-cos/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@@ -1 +0,0 @@
-com.tourism.common.qcloud.cos.config.QcloudCosAutoConfiguration

+ 5 - 5
common/common-report/pom.xml

@@ -16,6 +16,11 @@
 
     <dependencies>
         <dependency>
+            <groupId>com.deepoove</groupId>
+            <artifactId>poi-tl</artifactId>
+            <version>1.12.2</version>
+        </dependency>
+        <dependency>
             <groupId>com.tourism</groupId>
             <artifactId>common-satoken</artifactId>
             <version>1.0.0</version>
@@ -41,11 +46,6 @@
             <version>1.0.0</version>
         </dependency>
         <dependency>
-            <groupId>com.deepoove</groupId>
-            <artifactId>poi-tl</artifactId>
-            <version>1.12.2</version>
-        </dependency>
-        <dependency>
             <groupId>wiki.xsx</groupId>
             <artifactId>x-easypdf</artifactId>
             <version>2.10.1</version>

+ 1 - 1
common/pom.xml

@@ -25,7 +25,7 @@
         <module>common-flow</module>
         <module>common-report</module>
         <module>common-redis</module>
-        <module>common-qcloud</module>
+        <module>common-huaweicloud</module>
         <module>common-sequence</module>
         <module>common-swagger</module>
     </modules>

+ 1 - 0
pom.xml

@@ -46,6 +46,7 @@
     <modules>
         <module>application-webadmin</module>
         <module>common</module>
+<!--        <module>common/common-captcha</module>-->
     </modules>
 
     <dependencies>