From a9d0bb01cc2f77806442f3f88d6c37fdd5fceb99 Mon Sep 17 00:00:00 2001 From: landaiqing <3517283258@qq.com> Date: Sun, 2 Jun 2024 21:52:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=94=9F=E6=88=90=E7=AD=96=E7=95=A5=EF=BC=8C=E5=AE=8C=E7=BE=8E?= =?UTF-8?q?=E9=80=82=E9=85=8D=E9=A1=B9=E7=9B=AE=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/SchisandraAuthUserDao.xml | 2 +- .../genCode/{authMapper.yml => Mapper.yml} | 4 +- .../src/main/resources/genCode/gen.yml | 8 +- .../src/main/resources/genCode/ossMapper.yml | 69 ----- .../resources/genCode/systemLogMapper.yml | 69 ----- .../main/resources/genCode/systemMapper.yml | 69 ----- .../resources/genCode/template/DemoBO.java.vm | 4 +- .../genCode/template/DemoBOConverter.java.vm | 4 +- .../genCode/template/DemoController.java.vm | 10 +- .../genCode/template/DemoDTO.java.vm | 1 + .../genCode/template/DemoDTOConverter.java.vm | 4 +- .../genCode/template/DemoDao.java.vm | 4 +- .../template/DemoDomainService.java.vm | 4 +- .../template/DemoDomainServiceImpl.java.vm | 12 +- .../genCode/template/DemoService.java.vm | 4 +- .../genCode/template/DemoServiceImpl.java.vm | 7 +- .../genCode/template/DemoTable.java.vm | 8 +- .../resources/genCode/template/DemoXml.xml.vm | 2 +- .../SchisandraOssAwsController.java | 172 +++++++++++++ .../SchisandraOssTencentController.java | 196 ++++++++++++++ .../convert/SchisandraOssAwsDTOConverter.java | 22 ++ .../SchisandraOssTencentDTOConverter.java | 23 ++ .../application/dto/SchisandraOssAwsDTO.java | 158 ++++++++++++ .../dto/SchisandraOssTencentDTO.java | 198 +++++++++++++++ .../oss/domain/bo/SchisandraOssAwsBO.java | 157 ++++++++++++ .../oss/domain/bo/SchisandraOssTencentBO.java | 198 +++++++++++++++ .../convert/SchisandraOssAwsBOConverter.java | 23 ++ .../SchisandraOssTencentBOConverter.java | 23 ++ .../SchisandraOssAwsDomainService.java | 28 ++ .../SchisandraOssTencentDomainService.java | 28 ++ .../SchisandraOssAwsDomainServiceImpl.java | 48 ++++ ...SchisandraOssTencentDomainServiceImpl.java | 48 ++++ .../infra/basic/dao/SchisandraOssAwsDao.java | 17 ++ .../basic/dao/SchisandraOssTencentDao.java | 17 ++ .../infra/basic/entity/SchisandraOssAws.java | 191 ++++++++++++++ .../basic/entity/SchisandraOssTencent.java | 239 ++++++++++++++++++ .../service/SchisandraOssAwsService.java | 46 ++++ .../service/SchisandraOssTencentService.java | 46 ++++ .../impl/SchisandraOssAwsServiceImpl.java | 67 +++++ .../impl/SchisandraOssTencentServiceImpl.java | 67 +++++ .../resources/mapper/SchisandraOssAliDao.xml | 2 +- .../resources/mapper/SchisandraOssAwsDao.xml | 36 +++ .../mapper/SchisandraOssMinioDao.xml | 2 +- .../mapper/SchisandraOssTencentDao.xml | 44 ++++ 44 files changed, 2137 insertions(+), 244 deletions(-) rename schisandra-cloud-storage-gen/src/main/resources/genCode/{authMapper.yml => Mapper.yml} (98%) delete mode 100644 schisandra-cloud-storage-gen/src/main/resources/genCode/ossMapper.yml delete mode 100644 schisandra-cloud-storage-gen/src/main/resources/genCode/systemLogMapper.yml delete mode 100644 schisandra-cloud-storage-gen/src/main/resources/genCode/systemMapper.yml create mode 100644 schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/controller/SchisandraOssAwsController.java create mode 100644 schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/controller/SchisandraOssTencentController.java create mode 100644 schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/convert/SchisandraOssAwsDTOConverter.java create mode 100644 schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/convert/SchisandraOssTencentDTOConverter.java create mode 100644 schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/dto/SchisandraOssAwsDTO.java create mode 100644 schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/dto/SchisandraOssTencentDTO.java create mode 100644 schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/bo/SchisandraOssAwsBO.java create mode 100644 schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/bo/SchisandraOssTencentBO.java create mode 100644 schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/convert/SchisandraOssAwsBOConverter.java create mode 100644 schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/convert/SchisandraOssTencentBOConverter.java create mode 100644 schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/service/SchisandraOssAwsDomainService.java create mode 100644 schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/service/SchisandraOssTencentDomainService.java create mode 100644 schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/service/impl/SchisandraOssAwsDomainServiceImpl.java create mode 100644 schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/service/impl/SchisandraOssTencentDomainServiceImpl.java create mode 100644 schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/dao/SchisandraOssAwsDao.java create mode 100644 schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/dao/SchisandraOssTencentDao.java create mode 100644 schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/entity/SchisandraOssAws.java create mode 100644 schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/entity/SchisandraOssTencent.java create mode 100644 schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/service/SchisandraOssAwsService.java create mode 100644 schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/service/SchisandraOssTencentService.java create mode 100644 schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/service/impl/SchisandraOssAwsServiceImpl.java create mode 100644 schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/service/impl/SchisandraOssTencentServiceImpl.java create mode 100644 schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/resources/mapper/SchisandraOssAwsDao.xml create mode 100644 schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/resources/mapper/SchisandraOssTencentDao.xml diff --git a/schisandra-cloud-storage-auth/schisandra-cloud-storage-auth-infra/src/main/resources/mapper/SchisandraAuthUserDao.xml b/schisandra-cloud-storage-auth/schisandra-cloud-storage-auth-infra/src/main/resources/mapper/SchisandraAuthUserDao.xml index 83f4209..ea169a6 100644 --- a/schisandra-cloud-storage-auth/schisandra-cloud-storage-auth-infra/src/main/resources/mapper/SchisandraAuthUserDao.xml +++ b/schisandra-cloud-storage-auth/schisandra-cloud-storage-auth-infra/src/main/resources/mapper/SchisandraAuthUserDao.xml @@ -1,6 +1,6 @@ - + diff --git a/schisandra-cloud-storage-gen/src/main/resources/genCode/authMapper.yml b/schisandra-cloud-storage-gen/src/main/resources/genCode/Mapper.yml similarity index 98% rename from schisandra-cloud-storage-gen/src/main/resources/genCode/authMapper.yml rename to schisandra-cloud-storage-gen/src/main/resources/genCode/Mapper.yml index 7b767d6..6e52500 100644 --- a/schisandra-cloud-storage-gen/src/main/resources/genCode/authMapper.yml +++ b/schisandra-cloud-storage-gen/src/main/resources/genCode/Mapper.yml @@ -44,7 +44,7 @@ mappers: ext: java - fileId: 009 template: genCode/template/DemoTable.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/java/com/schisandra/${module}/infra/basic/bo + filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/java/com/schisandra/${module}/infra/basic/entity name: ${modelName} ext: java - fileId: 010 @@ -54,7 +54,7 @@ mappers: ext: java - fileId: 011 template: genCode/template/DemoDao.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/java/com/schisandra/${module}/infra/basic/mapper + filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/java/com/schisandra/${module}/infra/basic/dao name: ${modelName}Dao ext: java - fileId: 012 diff --git a/schisandra-cloud-storage-gen/src/main/resources/genCode/gen.yml b/schisandra-cloud-storage-gen/src/main/resources/genCode/gen.yml index 034868b..7dfed72 100644 --- a/schisandra-cloud-storage-gen/src/main/resources/genCode/gen.yml +++ b/schisandra-cloud-storage-gen/src/main/resources/genCode/gen.yml @@ -8,23 +8,23 @@ # 数据库连接信息 jdbc: dbName: schisandra-cloud-storage - tableName: schisandra_auth_role_permission + tableName: schisandra_oss_aws url: jdbc:mysql://1.95.0.111:3306/ username: root password: LDQ20020618xxx driver: com.mysql.cj.jdbc.Driver # 使用的模板与生成文件映射给关系 -mapperInfos: genCode/authMapper.yml +mapperInfos: genCode/Mapper.yml # 全局参数 params: # 作者 author: landaiqing # 模块 - module: auth + module: oss # controller 通用前缀 - api: /auth/permission/ + api: /oss/aws/ # 生成对象是否移除前缀 removePre: false # 使用内置函数赋值给变量 FunctionUtils 中替换 diff --git a/schisandra-cloud-storage-gen/src/main/resources/genCode/ossMapper.yml b/schisandra-cloud-storage-gen/src/main/resources/genCode/ossMapper.yml deleted file mode 100644 index 7b767d6..0000000 --- a/schisandra-cloud-storage-gen/src/main/resources/genCode/ossMapper.yml +++ /dev/null @@ -1,69 +0,0 @@ -# auth模块映射关系 ${module} 占位符 -# 模板文件和生成类的映射关系 多个文件 数组形式配置 -mappers: - - - - fileId: 001 - template: genCode/template/DemoDTO.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-application/schisandra-cloud-storage-${module}-application-controller/src/main/java/com/schisandra/${module}/application/dto - name: ${modelName}DTO - ext: java - - fileId: 002 - template: genCode/template/DemoController.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-application/schisandra-cloud-storage-${module}-application-controller/src/main/java/com/schisandra/${module}/application/controller - name: ${modelName}Controller - ext: java - - fileId: 003 - template: genCode/template/DemoDTOConverter.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-application/schisandra-cloud-storage-${module}-application-controller/src/main/java/com/schisandra/${module}/application/convert - name: ${modelName}DTOConverter - ext: java - - fileId: 004 - template: genCode/template/DemoBO.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-domain/src/main/java/com/schisandra/${module}/domain/bo - name: ${modelName}BO - ext: java - - fileId: 005 - template: genCode/template/DemoDomainService.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-domain/src/main/java/com/schisandra/${module}/domain/service - name: ${modelName}DomainService - ext: java - - fileId: 006 - template: genCode/template/DemoDomainServiceImpl.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-domain/src/main/java/com/schisandra/${module}/domain/service/impl - name: ${modelName}DomainServiceImpl - ext: java - - fileId: 007 - template: genCode/template/DemoBOConverter.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-domain/src/main/java/com/schisandra/${module}/domain/convert - name: ${modelName}BOConverter - ext: java - - fileId: 008 - template: genCode/template/DemoService.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/java/com/schisandra/${module}/infra/basic/service - name: ${modelName}Service - ext: java - - fileId: 009 - template: genCode/template/DemoTable.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/java/com/schisandra/${module}/infra/basic/bo - name: ${modelName} - ext: java - - fileId: 010 - template: genCode/template/DemoServiceImpl.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/java/com/schisandra/${module}/infra/basic/service/impl - name: ${modelName}ServiceImpl - ext: java - - fileId: 011 - template: genCode/template/DemoDao.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/java/com/schisandra/${module}/infra/basic/mapper - name: ${modelName}Dao - ext: java - - fileId: 012 - template: genCode/template/DemoXml.xml.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/resources/mapper - name: ${modelName}Dao - ext: xml - - - - - diff --git a/schisandra-cloud-storage-gen/src/main/resources/genCode/systemLogMapper.yml b/schisandra-cloud-storage-gen/src/main/resources/genCode/systemLogMapper.yml deleted file mode 100644 index 7b767d6..0000000 --- a/schisandra-cloud-storage-gen/src/main/resources/genCode/systemLogMapper.yml +++ /dev/null @@ -1,69 +0,0 @@ -# auth模块映射关系 ${module} 占位符 -# 模板文件和生成类的映射关系 多个文件 数组形式配置 -mappers: - - - - fileId: 001 - template: genCode/template/DemoDTO.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-application/schisandra-cloud-storage-${module}-application-controller/src/main/java/com/schisandra/${module}/application/dto - name: ${modelName}DTO - ext: java - - fileId: 002 - template: genCode/template/DemoController.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-application/schisandra-cloud-storage-${module}-application-controller/src/main/java/com/schisandra/${module}/application/controller - name: ${modelName}Controller - ext: java - - fileId: 003 - template: genCode/template/DemoDTOConverter.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-application/schisandra-cloud-storage-${module}-application-controller/src/main/java/com/schisandra/${module}/application/convert - name: ${modelName}DTOConverter - ext: java - - fileId: 004 - template: genCode/template/DemoBO.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-domain/src/main/java/com/schisandra/${module}/domain/bo - name: ${modelName}BO - ext: java - - fileId: 005 - template: genCode/template/DemoDomainService.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-domain/src/main/java/com/schisandra/${module}/domain/service - name: ${modelName}DomainService - ext: java - - fileId: 006 - template: genCode/template/DemoDomainServiceImpl.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-domain/src/main/java/com/schisandra/${module}/domain/service/impl - name: ${modelName}DomainServiceImpl - ext: java - - fileId: 007 - template: genCode/template/DemoBOConverter.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-domain/src/main/java/com/schisandra/${module}/domain/convert - name: ${modelName}BOConverter - ext: java - - fileId: 008 - template: genCode/template/DemoService.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/java/com/schisandra/${module}/infra/basic/service - name: ${modelName}Service - ext: java - - fileId: 009 - template: genCode/template/DemoTable.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/java/com/schisandra/${module}/infra/basic/bo - name: ${modelName} - ext: java - - fileId: 010 - template: genCode/template/DemoServiceImpl.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/java/com/schisandra/${module}/infra/basic/service/impl - name: ${modelName}ServiceImpl - ext: java - - fileId: 011 - template: genCode/template/DemoDao.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/java/com/schisandra/${module}/infra/basic/mapper - name: ${modelName}Dao - ext: java - - fileId: 012 - template: genCode/template/DemoXml.xml.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/resources/mapper - name: ${modelName}Dao - ext: xml - - - - - diff --git a/schisandra-cloud-storage-gen/src/main/resources/genCode/systemMapper.yml b/schisandra-cloud-storage-gen/src/main/resources/genCode/systemMapper.yml deleted file mode 100644 index 7b767d6..0000000 --- a/schisandra-cloud-storage-gen/src/main/resources/genCode/systemMapper.yml +++ /dev/null @@ -1,69 +0,0 @@ -# auth模块映射关系 ${module} 占位符 -# 模板文件和生成类的映射关系 多个文件 数组形式配置 -mappers: - - - - fileId: 001 - template: genCode/template/DemoDTO.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-application/schisandra-cloud-storage-${module}-application-controller/src/main/java/com/schisandra/${module}/application/dto - name: ${modelName}DTO - ext: java - - fileId: 002 - template: genCode/template/DemoController.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-application/schisandra-cloud-storage-${module}-application-controller/src/main/java/com/schisandra/${module}/application/controller - name: ${modelName}Controller - ext: java - - fileId: 003 - template: genCode/template/DemoDTOConverter.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-application/schisandra-cloud-storage-${module}-application-controller/src/main/java/com/schisandra/${module}/application/convert - name: ${modelName}DTOConverter - ext: java - - fileId: 004 - template: genCode/template/DemoBO.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-domain/src/main/java/com/schisandra/${module}/domain/bo - name: ${modelName}BO - ext: java - - fileId: 005 - template: genCode/template/DemoDomainService.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-domain/src/main/java/com/schisandra/${module}/domain/service - name: ${modelName}DomainService - ext: java - - fileId: 006 - template: genCode/template/DemoDomainServiceImpl.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-domain/src/main/java/com/schisandra/${module}/domain/service/impl - name: ${modelName}DomainServiceImpl - ext: java - - fileId: 007 - template: genCode/template/DemoBOConverter.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-domain/src/main/java/com/schisandra/${module}/domain/convert - name: ${modelName}BOConverter - ext: java - - fileId: 008 - template: genCode/template/DemoService.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/java/com/schisandra/${module}/infra/basic/service - name: ${modelName}Service - ext: java - - fileId: 009 - template: genCode/template/DemoTable.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/java/com/schisandra/${module}/infra/basic/bo - name: ${modelName} - ext: java - - fileId: 010 - template: genCode/template/DemoServiceImpl.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/java/com/schisandra/${module}/infra/basic/service/impl - name: ${modelName}ServiceImpl - ext: java - - fileId: 011 - template: genCode/template/DemoDao.java.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/java/com/schisandra/${module}/infra/basic/mapper - name: ${modelName}Dao - ext: java - - fileId: 012 - template: genCode/template/DemoXml.xml.vm - filePath: /schisandra-cloud-storage-${module}/schisandra-cloud-storage-${module}-infra/src/main/resources/mapper - name: ${modelName}Dao - ext: xml - - - - - diff --git a/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoBO.java.vm b/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoBO.java.vm index d430907..55e68eb 100644 --- a/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoBO.java.vm +++ b/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoBO.java.vm @@ -1,9 +1,9 @@ -package com.schisandra.${module}.domain.entity; +package com.schisandra.${module}.domain.bo; import lombok.Data; import java.io.Serializable; - +import java.util.Date; /** * ${tableComment} bo * diff --git a/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoBOConverter.java.vm b/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoBOConverter.java.vm index d4eaaf0..6a59887 100644 --- a/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoBOConverter.java.vm +++ b/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoBOConverter.java.vm @@ -1,7 +1,7 @@ package com.schisandra.${module}.domain.convert; - ${module}.domain.entity.${modelName}BO; - ${module}.infra.basic.entity.${modelName}; +import com.schisandra.${module}.domain.bo.${modelName}BO; +import com.schisandra.${module}.infra.basic.entity.${modelName}; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; diff --git a/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoController.java.vm b/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoController.java.vm index 5ac6130..c069791 100644 --- a/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoController.java.vm +++ b/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoController.java.vm @@ -2,11 +2,11 @@ package com.schisandra.${module}.application.controller; import com.alibaba.fastjson.JSON; import com.google.common.base.Preconditions; - ${module}.application.convert.${modelName}DTOConverter; - ${module}.application.dto.${modelName}DTO; - ${module}.common.entity.Result; - ${module}.domain.entity.${modelName}BO; - ${module}.domain.service.${modelName}DomainService; +import com.schisandra.${module}.application.convert.${modelName}DTOConverter; +import com.schisandra.${module}.application.dto.${modelName}DTO; +import com.schisandra.${module}.common.entity.Result; +import com.schisandra.${module}.domain.bo.${modelName}BO; +import com.schisandra.${module}.domain.service.${modelName}DomainService; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoDTO.java.vm b/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoDTO.java.vm index 32f678d..babd791 100644 --- a/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoDTO.java.vm +++ b/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoDTO.java.vm @@ -3,6 +3,7 @@ package com.schisandra.${module}.application.dto; import lombok.Data; import java.io.Serializable; +import java.util.Date; /** * ${tableComment} dto diff --git a/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoDTOConverter.java.vm b/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoDTOConverter.java.vm index b5d0a02..e556f07 100644 --- a/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoDTOConverter.java.vm +++ b/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoDTOConverter.java.vm @@ -1,7 +1,7 @@ package com.schisandra.${module}.application.convert; - ${module}.application.dto.${modelName}DTO; - ${module}.domain.entity.${modelName}BO; +import com.schisandra.${module}.application.dto.${modelName}DTO; +import com.schisandra.${module}.domain.bo.${modelName}BO; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; diff --git a/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoDao.java.vm b/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoDao.java.vm index dc4c816..dfddcd7 100644 --- a/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoDao.java.vm +++ b/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoDao.java.vm @@ -1,6 +1,6 @@ -package com.schisandra.${module}.infra.basic.mapper; +package com.schisandra.${module}.infra.basic.dao; - ${module}.infra.basic.entity.${modelName}; +import com.schisandra.${module}.infra.basic.entity.${modelName}; import com.mybatisflex.core.BaseMapper; import org.springframework.stereotype.Repository; diff --git a/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoDomainService.java.vm b/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoDomainService.java.vm index 20e8039..16e7c11 100644 --- a/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoDomainService.java.vm +++ b/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoDomainService.java.vm @@ -1,4 +1,6 @@ -package com.schisandra.${module}.domain.service;${module}.domain.entity.${modelName}BO; +package com.schisandra.${module}.domain.service; + +import com.schisandra.${module}.domain.bo.${modelName}BO; /** * ${tableComment} 领域service diff --git a/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoDomainServiceImpl.java.vm b/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoDomainServiceImpl.java.vm index 8c433ef..57a20eb 100644 --- a/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoDomainServiceImpl.java.vm +++ b/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoDomainServiceImpl.java.vm @@ -1,11 +1,11 @@ package com.schisandra.${module}.domain.service.impl; - ${module}.common.enums.IsDeletedFlagEnum; - ${module}.domain.convert.${modelName}BOConverter; - ${module}.domain.entity.${modelName}BO; - ${module}.domain.service.${modelName}DomainService; - ${module}.infra.basic.entity.${modelName}; - ${module}.infra.basic.service.${modelName}Service; +import com.schisandra.${module}.common.enums.IsDeletedFlagEnum; +import com.schisandra.${module}.domain.convert.${modelName}BOConverter; +import com.schisandra.${module}.domain.bo.${modelName}BO; +import com.schisandra.${module}.domain.service.${modelName}DomainService; +import com.schisandra.${module}.infra.basic.entity.${modelName}; +import com.schisandra.${module}.infra.basic.service.${modelName}Service; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; diff --git a/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoService.java.vm b/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoService.java.vm index 7523f3f..db97d91 100644 --- a/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoService.java.vm +++ b/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoService.java.vm @@ -1,4 +1,6 @@ -package com.schisandra.${module}.infra.basic.service;${module}.infra.basic.entity.${modelName}; +package com.schisandra.${module}.infra.basic.service; + +import com.schisandra.${module}.infra.basic.entity.${modelName}; /** * ${tableComment} 表服务接口 diff --git a/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoServiceImpl.java.vm b/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoServiceImpl.java.vm index c34b968..09d6b3e 100644 --- a/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoServiceImpl.java.vm +++ b/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoServiceImpl.java.vm @@ -1,12 +1,11 @@ package com.schisandra.${module}.infra.basic.service.impl; -import ${module}.infra.basic.entity.${modelName}; -import ${module}.infra.basic.mapper.${modelName}Dao; -import ${module}.infra.basic.service.${modelName}Service; +import com.schisandra.${module}.infra.basic.entity.${modelName}; +import com.schisandra.${module}.infra.basic.dao.${modelName}Dao; +import com.schisandra.${module}.infra.basic.service.${modelName}Service; import org.springframework.stereotype.Service; import javax.annotation.Resource; -import java.util.Objects; /** * ${tableComment} 表服务实现类 diff --git a/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoTable.java.vm b/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoTable.java.vm index 055c901..e4178af 100644 --- a/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoTable.java.vm +++ b/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoTable.java.vm @@ -4,6 +4,10 @@ import com.mybatisflex.annotation.Column; import com.mybatisflex.annotation.Id; import com.mybatisflex.annotation.KeyType; import com.mybatisflex.annotation.Table; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; /** * ${tableComment} 实体类 @@ -20,10 +24,10 @@ public class ${modelName} implements Serializable { * ${field.comment} */ #if($field.keyType=='PRI') - @Id(value = "`$field.col`", type = KeyType.Auto) + @Id(value = "$field.col", keyType = KeyType.Auto) #end #if($field.keyType!='PRI') - @Column("`$field.col`") + @Column("$field.col") #end private $field.type $field.name; #end diff --git a/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoXml.xml.vm b/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoXml.xml.vm index 89b8ad2..38d4744 100644 --- a/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoXml.xml.vm +++ b/schisandra-cloud-storage-gen/src/main/resources/genCode/template/DemoXml.xml.vm @@ -1,6 +1,6 @@ - + #foreach($field in $fields) diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/controller/SchisandraOssAwsController.java b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/controller/SchisandraOssAwsController.java new file mode 100644 index 0000000..4125656 --- /dev/null +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/controller/SchisandraOssAwsController.java @@ -0,0 +1,172 @@ +package com.schisandra.oss.application.controller; + +import com.alibaba.fastjson.JSON; +import com.google.common.base.Preconditions; +import com.schisandra.oss.application.convert.SchisandraOssAwsDTOConverter; +import com.schisandra.oss.application.dto.SchisandraOssAwsDTO; +import com.schisandra.oss.common.entity.Result; +import com.schisandra.oss.domain.bo.SchisandraOssAwsBO; +import com.schisandra.oss.domain.service.SchisandraOssAwsDomainService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +/** + * 亚马逊对象存储配置表 controller + * + * @author landaiqing + * @since 2024-06-02 21:48:16 + */ +@RestController +@RequestMapping("/oss/aws//") +@Slf4j +public class SchisandraOssAwsController { + + @Resource + private SchisandraOssAwsDomainService schisandraOssAwsDomainService; + + /** + * 新增亚马逊对象存储配置表 + */ + @RequestMapping("add") + public Result add(@RequestBody SchisandraOssAwsDTO schisandraOssAwsDTO) { + + try { + if (log.isInfoEnabled()) { + log.info("SchisandraOssAwsController.add.dto:{}", JSON.toJSONString(schisandraOssAwsDTO)); + } + Preconditions.checkNotNull(schisandraOssAwsDTO.getId(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getUserId(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getBasePath(), "数据存储路径不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getBucketName(), "Bucket名称不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getAccessKeyId(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getSecretAccessKey(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getRegion(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getMode(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getAccelerateModeEnabled(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getChecksumValidationEnabled(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getMultiRegionEnabled(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getChunkedEncodingEnabled(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getPathStyleAccessEnabled(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getUseArnRegionEnabled(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getFipsEnabled(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getDualstackEnabled(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getPartSize(), "分片大小,默认5MB不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getTaskNum(), "并发线程数,默认等于CPU的核数不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getStatus(), "状态不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getOpenAdvancedSetup(), "是否开启高级设置不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getCreatedBy(), "创建人不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getCreatedTime(), "创建时间不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getUpdateTime(), "更新时间不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getUpdateBy(), "更新人不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getIsDeleted(), "是否删除 0 未删除 1已删除不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getExtraJson(), "额外字段不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getCreateBucket(), "当桶不存在,是否创建不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getCheckBucket(), "启动检测桶,是否存在不能为空"); + SchisandraOssAwsBO SchisandraOssAwsBO = SchisandraOssAwsDTOConverter.INSTANCE.convertDTOToBO(schisandraOssAwsDTO); + return Result.ok(schisandraOssAwsDomainService.add(SchisandraOssAwsBO)); + } catch (Exception e) { + log.error("SchisandraOssAwsController.register.error:{}", e.getMessage(), e); + return Result.fail("新增亚马逊对象存储配置表失败"); + } + + } + + /** + * 修改亚马逊对象存储配置表 + */ + @RequestMapping("update") + public Result update(@RequestBody SchisandraOssAwsDTO schisandraOssAwsDTO) { + + try { + if (log.isInfoEnabled()) { + log.info("SchisandraOssAwsController.update.dto:{}", JSON.toJSONString(schisandraOssAwsDTO)); + } + Preconditions.checkNotNull(schisandraOssAwsDTO.getId(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getUserId(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getBasePath(), "数据存储路径不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getBucketName(), "Bucket名称不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getAccessKeyId(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getSecretAccessKey(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getRegion(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getMode(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getAccelerateModeEnabled(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getChecksumValidationEnabled(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getMultiRegionEnabled(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getChunkedEncodingEnabled(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getPathStyleAccessEnabled(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getUseArnRegionEnabled(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getFipsEnabled(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getDualstackEnabled(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getPartSize(), "分片大小,默认5MB不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getTaskNum(), "并发线程数,默认等于CPU的核数不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getStatus(), "状态不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getOpenAdvancedSetup(), "是否开启高级设置不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getCreatedBy(), "创建人不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getCreatedTime(), "创建时间不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getUpdateTime(), "更新时间不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getUpdateBy(), "更新人不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getIsDeleted(), "是否删除 0 未删除 1已删除不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getExtraJson(), "额外字段不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getCreateBucket(), "当桶不存在,是否创建不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getCheckBucket(), "启动检测桶,是否存在不能为空"); + SchisandraOssAwsBO schisandraOssAwsBO = SchisandraOssAwsDTOConverter.INSTANCE.convertDTOToBO(schisandraOssAwsDTO); + return Result.ok(schisandraOssAwsDomainService.update(schisandraOssAwsBO)); + } catch (Exception e) { + log.error("SchisandraOssAwsController.update.error:{}", e.getMessage(), e); + return Result.fail("更新亚马逊对象存储配置表信息失败"); + } + + } + + /** + * 删除亚马逊对象存储配置表 + */ + @RequestMapping("delete") + public Result delete(@RequestBody SchisandraOssAwsDTO schisandraOssAwsDTO) { + + try { + if (log.isInfoEnabled()) { + log.info("SchisandraOssAwsController.delete.dto:{}", JSON.toJSONString(schisandraOssAwsDTO)); + } + Preconditions.checkNotNull(schisandraOssAwsDTO.getId(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getUserId(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getBasePath(), "数据存储路径不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getBucketName(), "Bucket名称不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getAccessKeyId(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getSecretAccessKey(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getRegion(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getMode(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getAccelerateModeEnabled(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getChecksumValidationEnabled(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getMultiRegionEnabled(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getChunkedEncodingEnabled(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getPathStyleAccessEnabled(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getUseArnRegionEnabled(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getFipsEnabled(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getDualstackEnabled(), "不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getPartSize(), "分片大小,默认5MB不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getTaskNum(), "并发线程数,默认等于CPU的核数不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getStatus(), "状态不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getOpenAdvancedSetup(), "是否开启高级设置不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getCreatedBy(), "创建人不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getCreatedTime(), "创建时间不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getUpdateTime(), "更新时间不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getUpdateBy(), "更新人不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getIsDeleted(), "是否删除 0 未删除 1已删除不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getExtraJson(), "额外字段不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getCreateBucket(), "当桶不存在,是否创建不能为空"); + Preconditions.checkNotNull(schisandraOssAwsDTO.getCheckBucket(), "启动检测桶,是否存在不能为空"); + SchisandraOssAwsBO schisandraOssAwsBO = SchisandraOssAwsDTOConverter.INSTANCE.convertDTOToBO(schisandraOssAwsDTO); + return Result.ok(schisandraOssAwsDomainService.delete(schisandraOssAwsBO)); + } catch (Exception e) { + log.error("SchisandraOssAwsController.delete.error:{}", e.getMessage(), e); + return Result.fail("删除亚马逊对象存储配置表信息失败"); + } + + } + +} diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/controller/SchisandraOssTencentController.java b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/controller/SchisandraOssTencentController.java new file mode 100644 index 0000000..e2dfc71 --- /dev/null +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/controller/SchisandraOssTencentController.java @@ -0,0 +1,196 @@ +package com.schisandra.oss.application.controller; + +import com.alibaba.fastjson.JSON; +import com.google.common.base.Preconditions; +import com.schisandra.oss.application.convert.SchisandraOssTencentDTOConverter; +import com.schisandra.oss.application.dto.SchisandraOssTencentDTO; +import com.schisandra.oss.common.entity.Result; +import com.schisandra.oss.domain.bo.SchisandraOssTencentBO; +import com.schisandra.oss.domain.service.SchisandraOssTencentDomainService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +/** + * 腾讯云对象存储配置表 controller + * + * @author landaiqing + * @since 2024-06-02 21:38:56 + */ +@RestController +@RequestMapping("/oss/tencent//") +@Slf4j +public class SchisandraOssTencentController { + + @Resource + private SchisandraOssTencentDomainService schisandraOssTencentDomainService; + + /** + * 新增腾讯云对象存储配置表 + */ + @RequestMapping("add") + public Result add(@RequestBody SchisandraOssTencentDTO schisandraOssTencentDTO) { + + try { + if (log.isInfoEnabled()) { + log.info("SchisandraOssTencentController.add.dto:{}", JSON.toJSONString(schisandraOssTencentDTO)); + } + Preconditions.checkNotNull(schisandraOssTencentDTO.getId(), "不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getUserId(), "不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getBasePath(), "不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getBucketName(), "不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getSecretId(), "不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getSecretKey(), "不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getRegion(), "地域不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getHttpProtocol(), "连接OSS所采用的协议(HTTP或HTTPS),默认为HTTPS。不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getEndPointSuffix(), "域名后缀不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getHttpProxyIp(), "http proxy代理,如果使用http proxy代理,需要设置IP与端口不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getHttpProxyPort(), "代理服务器端口不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getProxyUserName(), "代理服务器验证的用户名。不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getProxyPassword(), "代理服务器验证的密码。不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getUseBasicAuth(), "是否使用基本身份验证不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getSignExpired(), "多次签名的过期时间,单位秒不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getConnectionRequestTimeout(), "获取连接的超时时间, 单位ms不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getConnectionTimeout(), "默认连接超时, 单位ms不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getSocketTimeout(), "SOCKET读取超时时间, 单位ms不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getMaxConnectionsCount(), "最大HTTP连接数不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getIdleConnectionAlive(), "空闲连接存活时间不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getUserAgent(), "user_agent标识不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getReadLimit(), "读取限制不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getCiSpecialRequest(), "数据万象特殊请求配置不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getMaxErrorRetry(), "请求失败后最大的重试次数。默认3次。不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getExtraJson(), "额外json不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getStatus(), "状态不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getCreatedBy(), "创建人不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getCreatedTime(), "创建时间不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getUpdateTime(), "更新时间不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getUpdateBy(), "更新人不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getIsDeleted(), "是否删除 0 未删除 1已删除不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getOpenAdvancedSetup(), "是否开启高级设置不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getCreateBucket(), "当桶不存在,是否创建不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getCheckBucket(), "启动检测桶,是否存在不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getPartSize(), "分片大小,默认5MB不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getTaskNum(), "并发线程数,默认等于CPU的核数不能为空"); + SchisandraOssTencentBO SchisandraOssTencentBO = SchisandraOssTencentDTOConverter.INSTANCE.convertDTOToBO(schisandraOssTencentDTO); + return Result.ok(schisandraOssTencentDomainService.add(SchisandraOssTencentBO)); + } catch (Exception e) { + log.error("SchisandraOssTencentController.register.error:{}", e.getMessage(), e); + return Result.fail("新增腾讯云对象存储配置表失败"); + } + + } + + /** + * 修改腾讯云对象存储配置表 + */ + @RequestMapping("update") + public Result update(@RequestBody SchisandraOssTencentDTO schisandraOssTencentDTO) { + + try { + if (log.isInfoEnabled()) { + log.info("SchisandraOssTencentController.update.dto:{}", JSON.toJSONString(schisandraOssTencentDTO)); + } + Preconditions.checkNotNull(schisandraOssTencentDTO.getId(), "不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getUserId(), "不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getBasePath(), "不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getBucketName(), "不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getSecretId(), "不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getSecretKey(), "不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getRegion(), "地域不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getHttpProtocol(), "连接OSS所采用的协议(HTTP或HTTPS),默认为HTTPS。不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getEndPointSuffix(), "域名后缀不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getHttpProxyIp(), "http proxy代理,如果使用http proxy代理,需要设置IP与端口不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getHttpProxyPort(), "代理服务器端口不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getProxyUserName(), "代理服务器验证的用户名。不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getProxyPassword(), "代理服务器验证的密码。不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getUseBasicAuth(), "是否使用基本身份验证不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getSignExpired(), "多次签名的过期时间,单位秒不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getConnectionRequestTimeout(), "获取连接的超时时间, 单位ms不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getConnectionTimeout(), "默认连接超时, 单位ms不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getSocketTimeout(), "SOCKET读取超时时间, 单位ms不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getMaxConnectionsCount(), "最大HTTP连接数不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getIdleConnectionAlive(), "空闲连接存活时间不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getUserAgent(), "user_agent标识不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getReadLimit(), "读取限制不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getCiSpecialRequest(), "数据万象特殊请求配置不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getMaxErrorRetry(), "请求失败后最大的重试次数。默认3次。不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getExtraJson(), "额外json不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getStatus(), "状态不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getCreatedBy(), "创建人不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getCreatedTime(), "创建时间不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getUpdateTime(), "更新时间不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getUpdateBy(), "更新人不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getIsDeleted(), "是否删除 0 未删除 1已删除不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getOpenAdvancedSetup(), "是否开启高级设置不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getCreateBucket(), "当桶不存在,是否创建不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getCheckBucket(), "启动检测桶,是否存在不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getPartSize(), "分片大小,默认5MB不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getTaskNum(), "并发线程数,默认等于CPU的核数不能为空"); + SchisandraOssTencentBO schisandraOssTencentBO = SchisandraOssTencentDTOConverter.INSTANCE.convertDTOToBO(schisandraOssTencentDTO); + return Result.ok(schisandraOssTencentDomainService.update(schisandraOssTencentBO)); + } catch (Exception e) { + log.error("SchisandraOssTencentController.update.error:{}", e.getMessage(), e); + return Result.fail("更新腾讯云对象存储配置表信息失败"); + } + + } + + /** + * 删除腾讯云对象存储配置表 + */ + @RequestMapping("delete") + public Result delete(@RequestBody SchisandraOssTencentDTO schisandraOssTencentDTO) { + + try { + if (log.isInfoEnabled()) { + log.info("SchisandraOssTencentController.delete.dto:{}", JSON.toJSONString(schisandraOssTencentDTO)); + } + Preconditions.checkNotNull(schisandraOssTencentDTO.getId(), "不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getUserId(), "不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getBasePath(), "不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getBucketName(), "不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getSecretId(), "不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getSecretKey(), "不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getRegion(), "地域不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getHttpProtocol(), "连接OSS所采用的协议(HTTP或HTTPS),默认为HTTPS。不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getEndPointSuffix(), "域名后缀不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getHttpProxyIp(), "http proxy代理,如果使用http proxy代理,需要设置IP与端口不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getHttpProxyPort(), "代理服务器端口不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getProxyUserName(), "代理服务器验证的用户名。不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getProxyPassword(), "代理服务器验证的密码。不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getUseBasicAuth(), "是否使用基本身份验证不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getSignExpired(), "多次签名的过期时间,单位秒不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getConnectionRequestTimeout(), "获取连接的超时时间, 单位ms不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getConnectionTimeout(), "默认连接超时, 单位ms不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getSocketTimeout(), "SOCKET读取超时时间, 单位ms不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getMaxConnectionsCount(), "最大HTTP连接数不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getIdleConnectionAlive(), "空闲连接存活时间不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getUserAgent(), "user_agent标识不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getReadLimit(), "读取限制不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getCiSpecialRequest(), "数据万象特殊请求配置不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getMaxErrorRetry(), "请求失败后最大的重试次数。默认3次。不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getExtraJson(), "额外json不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getStatus(), "状态不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getCreatedBy(), "创建人不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getCreatedTime(), "创建时间不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getUpdateTime(), "更新时间不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getUpdateBy(), "更新人不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getIsDeleted(), "是否删除 0 未删除 1已删除不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getOpenAdvancedSetup(), "是否开启高级设置不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getCreateBucket(), "当桶不存在,是否创建不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getCheckBucket(), "启动检测桶,是否存在不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getPartSize(), "分片大小,默认5MB不能为空"); + Preconditions.checkNotNull(schisandraOssTencentDTO.getTaskNum(), "并发线程数,默认等于CPU的核数不能为空"); + SchisandraOssTencentBO schisandraOssTencentBO = SchisandraOssTencentDTOConverter.INSTANCE.convertDTOToBO(schisandraOssTencentDTO); + return Result.ok(schisandraOssTencentDomainService.delete(schisandraOssTencentBO)); + } catch (Exception e) { + log.error("SchisandraOssTencentController.delete.error:{}", e.getMessage(), e); + return Result.fail("删除腾讯云对象存储配置表信息失败"); + } + + } + +} diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/convert/SchisandraOssAwsDTOConverter.java b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/convert/SchisandraOssAwsDTOConverter.java new file mode 100644 index 0000000..ca7c61d --- /dev/null +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/convert/SchisandraOssAwsDTOConverter.java @@ -0,0 +1,22 @@ +package com.schisandra.oss.application.convert; + +import com.schisandra.oss.application.dto.SchisandraOssAwsDTO; +import com.schisandra.oss.domain.bo.SchisandraOssAwsBO; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +/** + * 亚马逊对象存储配置表 dto转换器 + * + * @author landaiqing + * @since 2024-06-02 21:48:16 + */ +@Mapper +public interface SchisandraOssAwsDTOConverter { + + SchisandraOssAwsDTOConverter INSTANCE = Mappers.getMapper(SchisandraOssAwsDTOConverter.class); + + SchisandraOssAwsBO convertDTOToBO(SchisandraOssAwsDTO schisandraOssAwsDTO); + SchisandraOssAwsDTO convertBOToDTO(SchisandraOssAwsBO schisandraOssAwsBO); + +} diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/convert/SchisandraOssTencentDTOConverter.java b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/convert/SchisandraOssTencentDTOConverter.java new file mode 100644 index 0000000..412628a --- /dev/null +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/convert/SchisandraOssTencentDTOConverter.java @@ -0,0 +1,23 @@ +package com.schisandra.oss.application.convert; + +import com.schisandra.oss.application.dto.SchisandraOssTencentDTO; +import com.schisandra.oss.domain.bo.SchisandraOssTencentBO; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +/** + * 腾讯云对象存储配置表 dto转换器 + * + * @author landaiqing + * @since 2024-06-02 21:38:56 + */ +@Mapper +public interface SchisandraOssTencentDTOConverter { + + SchisandraOssTencentDTOConverter INSTANCE = Mappers.getMapper(SchisandraOssTencentDTOConverter.class); + + SchisandraOssTencentBO convertDTOToBO(SchisandraOssTencentDTO schisandraOssTencentDTO); + + SchisandraOssTencentDTO convertBOToDTO(SchisandraOssTencentBO schisandraOssTencentBO); + +} diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/dto/SchisandraOssAwsDTO.java b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/dto/SchisandraOssAwsDTO.java new file mode 100644 index 0000000..22ad33c --- /dev/null +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/dto/SchisandraOssAwsDTO.java @@ -0,0 +1,158 @@ +package com.schisandra.oss.application.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 亚马逊对象存储配置表 dto + * + * @author landaiqing + * @since 2024-06-02 21:48:16 + */ +@Data +public class SchisandraOssAwsDTO implements Serializable { + + /** + * + */ + private Long id; + + /** + * + */ + private Long userId; + + /** + * 数据存储路径 + */ + private String basePath; + + /** + * Bucket名称 + */ + private String bucketName; + + /** + * + */ + private String accessKeyId; + + /** + * + */ + private String secretAccessKey; + + /** + * + */ + private String region; + + /** + * + */ + private String mode; + + /** + * + */ + private String accelerateModeEnabled; + + /** + * + */ + private String checksumValidationEnabled; + + /** + * + */ + private String multiRegionEnabled; + + /** + * + */ + private String chunkedEncodingEnabled; + + /** + * + */ + private String pathStyleAccessEnabled; + + /** + * + */ + private String useArnRegionEnabled; + + /** + * + */ + private String fipsEnabled; + + /** + * + */ + private String dualstackEnabled; + + /** + * 分片大小,默认5MB + */ + private Integer partSize; + + /** + * 并发线程数,默认等于CPU的核数 + */ + private Integer taskNum; + + /** + * 状态 + */ + private String status; + + /** + * 是否开启高级设置 + */ + private String openAdvancedSetup; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 更新人 + */ + private String updateBy; + + /** + * 是否删除 0 未删除 1已删除 + */ + private Integer isDeleted; + + /** + * 额外字段 + */ + private String extraJson; + + /** + * 当桶不存在,是否创建 + */ + private String createBucket; + + /** + * 启动检测桶,是否存在 + */ + private String checkBucket; + +} + diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/dto/SchisandraOssTencentDTO.java b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/dto/SchisandraOssTencentDTO.java new file mode 100644 index 0000000..85b277a --- /dev/null +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/dto/SchisandraOssTencentDTO.java @@ -0,0 +1,198 @@ +package com.schisandra.oss.application.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 腾讯云对象存储配置表 dto + * + * @author landaiqing + * @since 2024-06-02 21:38:56 + */ +@Data +public class SchisandraOssTencentDTO implements Serializable { + + /** + * + */ + private Long id; + + /** + * + */ + private Long userId; + + /** + * + */ + private String basePath; + + /** + * + */ + private String bucketName; + + /** + * + */ + private String secretId; + + /** + * + */ + private String secretKey; + + /** + * 地域 + */ + private String region; + + /** + * 连接OSS所采用的协议(HTTP或HTTPS),默认为HTTPS。 + */ + private String httpProtocol; + + /** + * 域名后缀 + */ + private String endPointSuffix; + + /** + * http proxy代理,如果使用http proxy代理,需要设置IP与端口 + */ + private String httpProxyIp; + + /** + * 代理服务器端口 + */ + private Integer httpProxyPort; + + /** + * 代理服务器验证的用户名。 + */ + private String proxyUserName; + + /** + * 代理服务器验证的密码。 + */ + private String proxyPassword; + + /** + * 是否使用基本身份验证 + */ + private String useBasicAuth; + + /** + * 多次签名的过期时间,单位秒 + */ + private Long signExpired; + + /** + * 获取连接的超时时间, 单位ms + */ + private Integer connectionRequestTimeout; + + /** + * 默认连接超时, 单位ms + */ + private Integer connectionTimeout; + + /** + * SOCKET读取超时时间, 单位ms + */ + private Integer socketTimeout; + + /** + * 最大HTTP连接数 + */ + private Integer maxConnectionsCount; + + /** + * 空闲连接存活时间 + */ + private Integer idleConnectionAlive; + + /** + * user_agent标识 + */ + private String userAgent; + + /** + * 读取限制 + */ + private String readLimit; + + /** + * 数据万象特殊请求配置 + */ + private String ciSpecialRequest; + + /** + * 请求失败后最大的重试次数。默认3次。 + */ + private Integer maxErrorRetry; + + /** + * 额外json + */ + private String extraJson; + + /** + * 状态 + */ + private String status; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 更新人 + */ + private String updateBy; + + /** + * 是否删除 0 未删除 1已删除 + */ + private Integer isDeleted; + + /** + * 是否开启高级设置 + */ + private String openAdvancedSetup; + + /** + * 当桶不存在,是否创建 + */ + private String createBucket; + + /** + * 启动检测桶,是否存在 + */ + private String checkBucket; + + /** + * 分片大小,默认5MB + */ + private Long partSize; + + /** + * 并发线程数,默认等于CPU的核数 + */ + private Integer taskNum; + +} + diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/bo/SchisandraOssAwsBO.java b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/bo/SchisandraOssAwsBO.java new file mode 100644 index 0000000..c2f219f --- /dev/null +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/bo/SchisandraOssAwsBO.java @@ -0,0 +1,157 @@ +package com.schisandra.oss.domain.bo; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +/** + * 亚马逊对象存储配置表 bo + * + * @author landaiqing + * @since 2024-06-02 21:48:16 + */ +@Data +public class SchisandraOssAwsBO implements Serializable { + + /** + * + */ + private Long id; + + /** + * + */ + private Long userId; + + /** + * 数据存储路径 + */ + private String basePath; + + /** + * Bucket名称 + */ + private String bucketName; + + /** + * + */ + private String accessKeyId; + + /** + * + */ + private String secretAccessKey; + + /** + * + */ + private String region; + + /** + * + */ + private String mode; + + /** + * + */ + private String accelerateModeEnabled; + + /** + * + */ + private String checksumValidationEnabled; + + /** + * + */ + private String multiRegionEnabled; + + /** + * + */ + private String chunkedEncodingEnabled; + + /** + * + */ + private String pathStyleAccessEnabled; + + /** + * + */ + private String useArnRegionEnabled; + + /** + * + */ + private String fipsEnabled; + + /** + * + */ + private String dualstackEnabled; + + /** + * 分片大小,默认5MB + */ + private Integer partSize; + + /** + * 并发线程数,默认等于CPU的核数 + */ + private Integer taskNum; + + /** + * 状态 + */ + private String status; + + /** + * 是否开启高级设置 + */ + private String openAdvancedSetup; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 更新人 + */ + private String updateBy; + + /** + * 是否删除 0 未删除 1已删除 + */ + private Integer isDeleted; + + /** + * 额外字段 + */ + private String extraJson; + + /** + * 当桶不存在,是否创建 + */ + private String createBucket; + + /** + * 启动检测桶,是否存在 + */ + private String checkBucket; + +} + diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/bo/SchisandraOssTencentBO.java b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/bo/SchisandraOssTencentBO.java new file mode 100644 index 0000000..2d01d0c --- /dev/null +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/bo/SchisandraOssTencentBO.java @@ -0,0 +1,198 @@ +package com.schisandra.oss.domain.bo; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 腾讯云对象存储配置表 bo + * + * @author landaiqing + * @since 2024-06-02 21:38:56 + */ +@Data +public class SchisandraOssTencentBO implements Serializable { + + /** + * + */ + private Long id; + + /** + * + */ + private Long userId; + + /** + * + */ + private String basePath; + + /** + * + */ + private String bucketName; + + /** + * + */ + private String secretId; + + /** + * + */ + private String secretKey; + + /** + * 地域 + */ + private String region; + + /** + * 连接OSS所采用的协议(HTTP或HTTPS),默认为HTTPS。 + */ + private String httpProtocol; + + /** + * 域名后缀 + */ + private String endPointSuffix; + + /** + * http proxy代理,如果使用http proxy代理,需要设置IP与端口 + */ + private String httpProxyIp; + + /** + * 代理服务器端口 + */ + private Integer httpProxyPort; + + /** + * 代理服务器验证的用户名。 + */ + private String proxyUserName; + + /** + * 代理服务器验证的密码。 + */ + private String proxyPassword; + + /** + * 是否使用基本身份验证 + */ + private String useBasicAuth; + + /** + * 多次签名的过期时间,单位秒 + */ + private Long signExpired; + + /** + * 获取连接的超时时间, 单位ms + */ + private Integer connectionRequestTimeout; + + /** + * 默认连接超时, 单位ms + */ + private Integer connectionTimeout; + + /** + * SOCKET读取超时时间, 单位ms + */ + private Integer socketTimeout; + + /** + * 最大HTTP连接数 + */ + private Integer maxConnectionsCount; + + /** + * 空闲连接存活时间 + */ + private Integer idleConnectionAlive; + + /** + * user_agent标识 + */ + private String userAgent; + + /** + * 读取限制 + */ + private String readLimit; + + /** + * 数据万象特殊请求配置 + */ + private String ciSpecialRequest; + + /** + * 请求失败后最大的重试次数。默认3次。 + */ + private Integer maxErrorRetry; + + /** + * 额外json + */ + private String extraJson; + + /** + * 状态 + */ + private String status; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 更新人 + */ + private String updateBy; + + /** + * 是否删除 0 未删除 1已删除 + */ + private Integer isDeleted; + + /** + * 是否开启高级设置 + */ + private String openAdvancedSetup; + + /** + * 当桶不存在,是否创建 + */ + private String createBucket; + + /** + * 启动检测桶,是否存在 + */ + private String checkBucket; + + /** + * 分片大小,默认5MB + */ + private Long partSize; + + /** + * 并发线程数,默认等于CPU的核数 + */ + private Integer taskNum; + +} + diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/convert/SchisandraOssAwsBOConverter.java b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/convert/SchisandraOssAwsBOConverter.java new file mode 100644 index 0000000..11c446a --- /dev/null +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/convert/SchisandraOssAwsBOConverter.java @@ -0,0 +1,23 @@ +package com.schisandra.oss.domain.convert; + +import com.schisandra.oss.domain.bo.SchisandraOssAwsBO; +import com.schisandra.oss.infra.basic.entity.SchisandraOssAws; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +/** + * 亚马逊对象存储配置表 bo转换器 + * + * @author landaiqing + * @since 2024-06-02 21:48:16 + */ +@Mapper +public interface SchisandraOssAwsBOConverter { + + SchisandraOssAwsBOConverter INSTANCE = Mappers.getMapper(SchisandraOssAwsBOConverter.class); + + SchisandraOssAws convertBOToEntity(SchisandraOssAwsBO schisandraOssAwsBO); + + SchisandraOssAwsBO convertEntityToBO(SchisandraOssAws schisandraOssAws); + +} diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/convert/SchisandraOssTencentBOConverter.java b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/convert/SchisandraOssTencentBOConverter.java new file mode 100644 index 0000000..7d5a178 --- /dev/null +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/convert/SchisandraOssTencentBOConverter.java @@ -0,0 +1,23 @@ +package com.schisandra.oss.domain.convert; + +import com.schisandra.oss.domain.bo.SchisandraOssTencentBO; +import com.schisandra.oss.infra.basic.entity.SchisandraOssTencent; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +/** + * 腾讯云对象存储配置表 bo转换器 + * + * @author landaiqing + * @since 2024-06-02 21:38:56 + */ +@Mapper +public interface SchisandraOssTencentBOConverter { + + SchisandraOssTencentBOConverter INSTANCE = Mappers.getMapper(SchisandraOssTencentBOConverter.class); + + SchisandraOssTencent convertBOToEntity(SchisandraOssTencentBO schisandraOssTencentBO); + + SchisandraOssTencentBO convertEntityToBO(SchisandraOssTencent schisandraOssTencent); + +} diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/service/SchisandraOssAwsDomainService.java b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/service/SchisandraOssAwsDomainService.java new file mode 100644 index 0000000..9b78b47 --- /dev/null +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/service/SchisandraOssAwsDomainService.java @@ -0,0 +1,28 @@ +package com.schisandra.oss.domain.service; + +import com.schisandra.oss.domain.bo.SchisandraOssAwsBO; + +/** + * 亚马逊对象存储配置表 领域service + * + * @author landaiqing + * @since 2024-06-02 21:48:16 + */ +public interface SchisandraOssAwsDomainService { + + /** + * 添加 亚马逊对象存储配置表 信息 + */ + Boolean add(SchisandraOssAwsBO schisandraOssAwsBO); + + /** + * 更新 亚马逊对象存储配置表 信息 + */ + Boolean update(SchisandraOssAwsBO schisandraOssAwsBO); + + /** + * 删除 亚马逊对象存储配置表 信息 + */ + Boolean delete(SchisandraOssAwsBO schisandraOssAwsBO); + +} diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/service/SchisandraOssTencentDomainService.java b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/service/SchisandraOssTencentDomainService.java new file mode 100644 index 0000000..890b79e --- /dev/null +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/service/SchisandraOssTencentDomainService.java @@ -0,0 +1,28 @@ +package com.schisandra.oss.domain.service; + +import com.schisandra.oss.domain.bo.SchisandraOssTencentBO; + +/** + * 腾讯云对象存储配置表 领域service + * + * @author landaiqing + * @since 2024-06-02 21:38:56 + */ +public interface SchisandraOssTencentDomainService { + + /** + * 添加 腾讯云对象存储配置表 信息 + */ + Boolean add(SchisandraOssTencentBO schisandraOssTencentBO); + + /** + * 更新 腾讯云对象存储配置表 信息 + */ + Boolean update(SchisandraOssTencentBO schisandraOssTencentBO); + + /** + * 删除 腾讯云对象存储配置表 信息 + */ + Boolean delete(SchisandraOssTencentBO schisandraOssTencentBO); + +} diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/service/impl/SchisandraOssAwsDomainServiceImpl.java b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/service/impl/SchisandraOssAwsDomainServiceImpl.java new file mode 100644 index 0000000..c51ed65 --- /dev/null +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/service/impl/SchisandraOssAwsDomainServiceImpl.java @@ -0,0 +1,48 @@ +package com.schisandra.oss.domain.service.impl; + +import com.schisandra.oss.common.enums.IsDeletedFlagEnum; +import com.schisandra.oss.domain.convert.SchisandraOssAwsBOConverter; +import com.schisandra.oss.domain.bo.SchisandraOssAwsBO; +import com.schisandra.oss.domain.service.SchisandraOssAwsDomainService; +import com.schisandra.oss.infra.basic.entity.SchisandraOssAws; +import com.schisandra.oss.infra.basic.service.SchisandraOssAwsService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * 亚马逊对象存储配置表 领域service实现了 + * + * @author landaiqing + * @since 2024-06-02 21:48:16 + */ +@Service +@Slf4j +public class SchisandraOssAwsDomainServiceImpl implements SchisandraOssAwsDomainService { + + @Resource + private SchisandraOssAwsService schisandraOssAwsService; + + @Override + public Boolean add(SchisandraOssAwsBO schisandraOssAwsBO) { + SchisandraOssAws schisandraOssAws = SchisandraOssAwsBOConverter.INSTANCE.convertBOToEntity(schisandraOssAwsBO); + schisandraOssAws.setIsDeleted(IsDeletedFlagEnum.UN_DELETED.getCode()); + return schisandraOssAwsService.insert(schisandraOssAws) > 0; + } + + @Override + public Boolean update(SchisandraOssAwsBO schisandraOssAwsBO) { + SchisandraOssAws schisandraOssAws = SchisandraOssAwsBOConverter.INSTANCE.convertBOToEntity(schisandraOssAwsBO); + return schisandraOssAwsService.update(schisandraOssAws) > 0; + } + + @Override + public Boolean delete(SchisandraOssAwsBO schisandraOssAwsBO) { + SchisandraOssAws schisandraOssAws = new SchisandraOssAws(); + schisandraOssAws.setId(schisandraOssAwsBO.getId()); + schisandraOssAws.setIsDeleted(IsDeletedFlagEnum.DELETED.getCode()); + return schisandraOssAwsService.update(schisandraOssAws) > 0; + } + +} diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/service/impl/SchisandraOssTencentDomainServiceImpl.java b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/service/impl/SchisandraOssTencentDomainServiceImpl.java new file mode 100644 index 0000000..8f422c3 --- /dev/null +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-domain/src/main/java/com/schisandra/oss/domain/service/impl/SchisandraOssTencentDomainServiceImpl.java @@ -0,0 +1,48 @@ +package com.schisandra.oss.domain.service.impl; + +import com.schisandra.oss.common.enums.IsDeletedFlagEnum; +import com.schisandra.oss.domain.convert.SchisandraOssTencentBOConverter; +import com.schisandra.oss.domain.bo.SchisandraOssTencentBO; +import com.schisandra.oss.domain.service.SchisandraOssTencentDomainService; +import com.schisandra.oss.infra.basic.entity.SchisandraOssTencent; +import com.schisandra.oss.infra.basic.service.SchisandraOssTencentService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * 腾讯云对象存储配置表 领域service实现了 + * + * @author landaiqing + * @since 2024-06-02 21:38:56 + */ +@Service +@Slf4j +public class SchisandraOssTencentDomainServiceImpl implements SchisandraOssTencentDomainService { + + @Resource + private SchisandraOssTencentService schisandraOssTencentService; + + @Override + public Boolean add(SchisandraOssTencentBO schisandraOssTencentBO) { + SchisandraOssTencent schisandraOssTencent = SchisandraOssTencentBOConverter.INSTANCE.convertBOToEntity(schisandraOssTencentBO); + schisandraOssTencent.setIsDeleted(IsDeletedFlagEnum.UN_DELETED.getCode()); + return schisandraOssTencentService.insert(schisandraOssTencent) > 0; + } + + @Override + public Boolean update(SchisandraOssTencentBO schisandraOssTencentBO) { + SchisandraOssTencent schisandraOssTencent = SchisandraOssTencentBOConverter.INSTANCE.convertBOToEntity(schisandraOssTencentBO); + return schisandraOssTencentService.update(schisandraOssTencent) > 0; + } + + @Override + public Boolean delete(SchisandraOssTencentBO schisandraOssTencentBO) { + SchisandraOssTencent schisandraOssTencent = new SchisandraOssTencent(); + schisandraOssTencent.setId(schisandraOssTencentBO.getId()); + schisandraOssTencent.setIsDeleted(IsDeletedFlagEnum.DELETED.getCode()); + return schisandraOssTencentService.update(schisandraOssTencent) > 0; + } + +} diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/dao/SchisandraOssAwsDao.java b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/dao/SchisandraOssAwsDao.java new file mode 100644 index 0000000..a56796b --- /dev/null +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/dao/SchisandraOssAwsDao.java @@ -0,0 +1,17 @@ +package com.schisandra.oss.infra.basic.dao; + +import com.schisandra.oss.infra.basic.entity.SchisandraOssAws; +import com.mybatisflex.core.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * 亚马逊对象存储配置表 表数据库访问层 + * + * @author landaiqing + * @since 2024-06-02 21:48:16 + */ +@Repository +public interface SchisandraOssAwsDao extends BaseMapper { + +} + diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/dao/SchisandraOssTencentDao.java b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/dao/SchisandraOssTencentDao.java new file mode 100644 index 0000000..c53578a --- /dev/null +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/dao/SchisandraOssTencentDao.java @@ -0,0 +1,17 @@ +package com.schisandra.oss.infra.basic.dao; + +import com.schisandra.oss.infra.basic.entity.SchisandraOssTencent; +import com.mybatisflex.core.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * 腾讯云对象存储配置表 表数据库访问层 + * + * @author landaiqing + * @since 2024-06-02 21:38:56 + */ +@Repository +public interface SchisandraOssTencentDao extends BaseMapper { + +} + diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/entity/SchisandraOssAws.java b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/entity/SchisandraOssAws.java new file mode 100644 index 0000000..d8345cb --- /dev/null +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/entity/SchisandraOssAws.java @@ -0,0 +1,191 @@ +package com.schisandra.oss.infra.basic.entity; + +import com.mybatisflex.annotation.Column; +import com.mybatisflex.annotation.Id; +import com.mybatisflex.annotation.KeyType; +import com.mybatisflex.annotation.Table; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 亚马逊对象存储配置表 实体类 + * + * @author landaiqing + * @since 2024-06-02 21:48:16 + */ +@Data +@Table("schisandra_oss_aws") +public class SchisandraOssAws implements Serializable { + + /** + * + */ + @Id(value = "id", keyType = KeyType.Auto) + private Long id; + + /** + * + */ + @Column("user_id") + private Long userId; + + /** + * 数据存储路径 + */ + @Column("base_path") + private String basePath; + + /** + * Bucket名称 + */ + @Column("bucket_name") + private String bucketName; + + /** + * + */ + @Column("access_key_id") + private String accessKeyId; + + /** + * + */ + @Column("secret_access_key") + private String secretAccessKey; + + /** + * + */ + @Column("region") + private String region; + + /** + * + */ + @Column("mode") + private String mode; + + /** + * + */ + @Column("accelerate_mode_enabled") + private String accelerateModeEnabled; + + /** + * + */ + @Column("checksum_validation_enabled") + private String checksumValidationEnabled; + + /** + * + */ + @Column("multi_region_enabled") + private String multiRegionEnabled; + + /** + * + */ + @Column("chunked_encoding_enabled") + private String chunkedEncodingEnabled; + + /** + * + */ + @Column("path_style_access_enabled") + private String pathStyleAccessEnabled; + + /** + * + */ + @Column("use_arn_region_enabled") + private String useArnRegionEnabled; + + /** + * + */ + @Column("fips_enabled") + private String fipsEnabled; + + /** + * + */ + @Column("dualstack_enabled") + private String dualstackEnabled; + + /** + * 分片大小,默认5MB + */ + @Column("part_size") + private Integer partSize; + + /** + * 并发线程数,默认等于CPU的核数 + */ + @Column("task_num") + private Integer taskNum; + + /** + * 状态 + */ + @Column("status") + private String status; + + /** + * 是否开启高级设置 + */ + @Column("open_advanced_setup") + private String openAdvancedSetup; + + /** + * 创建人 + */ + @Column("created_by") + private String createdBy; + + /** + * 创建时间 + */ + @Column("created_time") + private Date createdTime; + + /** + * 更新时间 + */ + @Column("update_time") + private Date updateTime; + + /** + * 更新人 + */ + @Column("update_by") + private String updateBy; + + /** + * 是否删除 0 未删除 1已删除 + */ + @Column(value = "is_deleted",isLogicDelete = true) + private Integer isDeleted; + + /** + * 额外字段 + */ + @Column("extra_json") + private String extraJson; + + /** + * 当桶不存在,是否创建 + */ + @Column("create_bucket") + private String createBucket; + + /** + * 启动检测桶,是否存在 + */ + @Column("check_bucket") + private String checkBucket; + +} + diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/entity/SchisandraOssTencent.java b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/entity/SchisandraOssTencent.java new file mode 100644 index 0000000..88bc46f --- /dev/null +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/entity/SchisandraOssTencent.java @@ -0,0 +1,239 @@ +package com.schisandra.oss.infra.basic.entity; + +import com.mybatisflex.annotation.Column; +import com.mybatisflex.annotation.Id; +import com.mybatisflex.annotation.KeyType; +import com.mybatisflex.annotation.Table; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 腾讯云对象存储配置表 实体类 + * + * @author landaiqing + * @since 2024-06-02 21:38:56 + */ +@Data +@Table("schisandra_oss_tencent") +public class SchisandraOssTencent implements Serializable { + + /** + * + */ + @Id(value = "id", keyType = KeyType.Auto) + private Long id; + + /** + * + */ + @Column("user_id") + private Long userId; + + /** + * + */ + @Column("base_path") + private String basePath; + + /** + * + */ + @Column("bucket_name") + private String bucketName; + + /** + * + */ + @Column("secret_id") + private String secretId; + + /** + * + */ + @Column("secret_key") + private String secretKey; + + /** + * 地域 + */ + @Column("region") + private String region; + + /** + * 连接OSS所采用的协议(HTTP或HTTPS),默认为HTTPS。 + */ + @Column("http_protocol") + private String httpProtocol; + + /** + * 域名后缀 + */ + @Column("end_point_suffix") + private String endPointSuffix; + + /** + * http proxy代理,如果使用http proxy代理,需要设置IP与端口 + */ + @Column("http_proxy_Ip") + private String httpProxyIp; + + /** + * 代理服务器端口 + */ + @Column("http_proxy_port") + private Integer httpProxyPort; + + /** + * 代理服务器验证的用户名。 + */ + @Column("proxy_user_name") + private String proxyUserName; + + /** + * 代理服务器验证的密码。 + */ + @Column("proxy_password") + private String proxyPassword; + + /** + * 是否使用基本身份验证 + */ + @Column("use_basic_auth") + private String useBasicAuth; + + /** + * 多次签名的过期时间,单位秒 + */ + @Column("sign_expired") + private Long signExpired; + + /** + * 获取连接的超时时间, 单位ms + */ + @Column("connection_request_timeout") + private Integer connectionRequestTimeout; + + /** + * 默认连接超时, 单位ms + */ + @Column("connection_timeout") + private Integer connectionTimeout; + + /** + * SOCKET读取超时时间, 单位ms + */ + @Column("socket_timeout") + private Integer socketTimeout; + + /** + * 最大HTTP连接数 + */ + @Column("max_connections_count") + private Integer maxConnectionsCount; + + /** + * 空闲连接存活时间 + */ + @Column("idle_connection_alive") + private Integer idleConnectionAlive; + + /** + * user_agent标识 + */ + @Column("user_agent") + private String userAgent; + + /** + * 读取限制 + */ + @Column("read_limit") + private String readLimit; + + /** + * 数据万象特殊请求配置 + */ + @Column("ci_special_request") + private String ciSpecialRequest; + + /** + * 请求失败后最大的重试次数。默认3次。 + */ + @Column("max_error_retry") + private Integer maxErrorRetry; + + /** + * 额外json + */ + @Column("extra_json") + private String extraJson; + + /** + * 状态 + */ + @Column("status") + private String status; + + /** + * 创建人 + */ + @Column("created_by") + private String createdBy; + + /** + * 创建时间 + */ + @Column("created_time") + private Date createdTime; + + /** + * 更新时间 + */ + @Column("update_time") + private Date updateTime; + + /** + * 更新人 + */ + @Column("update_by") + private String updateBy; + + /** + * 是否删除 0 未删除 1已删除 + */ + @Column(value = "is_deleted",isLogicDelete = true) + private Integer isDeleted; + + /** + * 是否开启高级设置 + */ + @Column("open_advanced_setup") + private String openAdvancedSetup; + + /** + * 当桶不存在,是否创建 + */ + @Column("create_bucket") + private String createBucket; + + /** + * 启动检测桶,是否存在 + */ + @Column("check_bucket") + private String checkBucket; + + /** + * 分片大小,默认5MB + */ + @Column("part_size") + private Long partSize; + + /** + * 并发线程数,默认等于CPU的核数 + */ + @Column("task_num") + private Integer taskNum; + +} + diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/service/SchisandraOssAwsService.java b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/service/SchisandraOssAwsService.java new file mode 100644 index 0000000..d41f981 --- /dev/null +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/service/SchisandraOssAwsService.java @@ -0,0 +1,46 @@ +package com.schisandra.oss.infra.basic.service; + +import com.schisandra.oss.infra.basic.entity.SchisandraOssAws; + +/** + * 亚马逊对象存储配置表 表服务接口 + * + * @author landaiqing + * @since 2024-06-02 21:48:16 + */ +public interface SchisandraOssAwsService { + + /** + * 通过ID查询单条数据 + * + * @param id 主键 + * @return 实例对象 + */ + SchisandraOssAws queryById(Long id); + + /** + * 新增数据 + * + * @param schisandraOssAws 实例对象 + * @return 实例对象 + */ + int insert(SchisandraOssAws schisandraOssAws); + + /** + * 修改数据 + * + * @param schisandraOssAws 实例对象 + * @return 实例对象 + */ + int update(SchisandraOssAws schisandraOssAws); + + /** + * 通过主键删除数据 + * + * @param id 主键 + * @return 是否成功 + */ + boolean deleteById(Long id); + + +} diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/service/SchisandraOssTencentService.java b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/service/SchisandraOssTencentService.java new file mode 100644 index 0000000..8a0bae2 --- /dev/null +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/service/SchisandraOssTencentService.java @@ -0,0 +1,46 @@ +package com.schisandra.oss.infra.basic.service; + +import com.schisandra.oss.infra.basic.entity.SchisandraOssTencent; + +/** + * 腾讯云对象存储配置表 表服务接口 + * + * @author landaiqing + * @since 2024-06-02 21:38:56 + */ +public interface SchisandraOssTencentService { + + /** + * 通过ID查询单条数据 + * + * @param id 主键 + * @return 实例对象 + */ + SchisandraOssTencent queryById(Long id); + + /** + * 新增数据 + * + * @param schisandraOssTencent 实例对象 + * @return 实例对象 + */ + int insert(SchisandraOssTencent schisandraOssTencent); + + /** + * 修改数据 + * + * @param schisandraOssTencent 实例对象 + * @return 实例对象 + */ + int update(SchisandraOssTencent schisandraOssTencent); + + /** + * 通过主键删除数据 + * + * @param id 主键 + * @return 是否成功 + */ + boolean deleteById(Long id); + + +} diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/service/impl/SchisandraOssAwsServiceImpl.java b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/service/impl/SchisandraOssAwsServiceImpl.java new file mode 100644 index 0000000..475362d --- /dev/null +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/service/impl/SchisandraOssAwsServiceImpl.java @@ -0,0 +1,67 @@ +package com.schisandra.oss.infra.basic.service.impl; + +import com.schisandra.oss.infra.basic.entity.SchisandraOssAws; +import com.schisandra.oss.infra.basic.dao.SchisandraOssAwsDao; +import com.schisandra.oss.infra.basic.service.SchisandraOssAwsService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * 亚马逊对象存储配置表 表服务实现类 + * + * @author landaiqing + * @since 2024-06-02 21:48:16 + */ +@Service("SchisandraOssAwsService") +public class SchisandraOssAwsServiceImpl implements SchisandraOssAwsService { + + @Resource + private SchisandraOssAwsDao schisandraOssAwsDao; + + /** + * 通过ID查询单条数据 + * + * @param id 主键 + * @return 实例对象 + */ + @Override + public SchisandraOssAws queryById(Long id) { + return this.schisandraOssAwsDao.selectOneById(id); + } + + /** + * 新增数据 + * + * @param schisandraOssAws 实例对象 + * @return 实例对象 + */ + @Override + public int insert(SchisandraOssAws schisandraOssAws) { + return this.schisandraOssAwsDao.insert(schisandraOssAws,true); + } + + /** + * 修改数据 + * + * @param schisandraOssAws 实例对象 + * @return 实例对象 + */ + @Override + public int update(SchisandraOssAws schisandraOssAws) { + return this.schisandraOssAwsDao.update(schisandraOssAws,true); + } + + /** + * 通过主键删除数据 + * + * @param id 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Long id) { + return this.schisandraOssAwsDao.deleteById(id) > 0; + } + + +} diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/service/impl/SchisandraOssTencentServiceImpl.java b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/service/impl/SchisandraOssTencentServiceImpl.java new file mode 100644 index 0000000..354e82c --- /dev/null +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/java/com/schisandra/oss/infra/basic/service/impl/SchisandraOssTencentServiceImpl.java @@ -0,0 +1,67 @@ +package com.schisandra.oss.infra.basic.service.impl; + +import com.schisandra.oss.infra.basic.dao.SchisandraOssTencentDao; +import com.schisandra.oss.infra.basic.entity.SchisandraOssTencent; +import com.schisandra.oss.infra.basic.service.SchisandraOssTencentService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * 腾讯云对象存储配置表 表服务实现类 + * + * @author landaiqing + * @since 2024-06-02 21:38:56 + */ +@Service("SchisandraOssTencentService") +public class SchisandraOssTencentServiceImpl implements SchisandraOssTencentService { + + @Resource + private SchisandraOssTencentDao schisandraOssTencentDao; + + /** + * 通过ID查询单条数据 + * + * @param id 主键 + * @return 实例对象 + */ + @Override + public SchisandraOssTencent queryById(Long id) { + return this.schisandraOssTencentDao.selectOneById(id); + } + + /** + * 新增数据 + * + * @param schisandraOssTencent 实例对象 + * @return 实例对象 + */ + @Override + public int insert(SchisandraOssTencent schisandraOssTencent) { + return this.schisandraOssTencentDao.insert(schisandraOssTencent,true); + } + + /** + * 修改数据 + * + * @param schisandraOssTencent 实例对象 + * @return 实例对象 + */ + @Override + public int update(SchisandraOssTencent schisandraOssTencent) { + return this.schisandraOssTencentDao.update(schisandraOssTencent,true); + } + + /** + * 通过主键删除数据 + * + * @param id 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Long id) { + return this.schisandraOssTencentDao.deleteById(id) > 0; + } + + +} diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/resources/mapper/SchisandraOssAliDao.xml b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/resources/mapper/SchisandraOssAliDao.xml index c533d24..884a23a 100644 --- a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/resources/mapper/SchisandraOssAliDao.xml +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/resources/mapper/SchisandraOssAliDao.xml @@ -1,6 +1,6 @@ - + diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/resources/mapper/SchisandraOssAwsDao.xml b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/resources/mapper/SchisandraOssAwsDao.xml new file mode 100644 index 0000000..ebb318f --- /dev/null +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/resources/mapper/SchisandraOssAwsDao.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/resources/mapper/SchisandraOssMinioDao.xml b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/resources/mapper/SchisandraOssMinioDao.xml index 814321b..e71d5f2 100644 --- a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/resources/mapper/SchisandraOssMinioDao.xml +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/resources/mapper/SchisandraOssMinioDao.xml @@ -1,6 +1,6 @@ - + diff --git a/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/resources/mapper/SchisandraOssTencentDao.xml b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/resources/mapper/SchisandraOssTencentDao.xml new file mode 100644 index 0000000..9533736 --- /dev/null +++ b/schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-infra/src/main/resources/mapper/SchisandraOssTencentDao.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +