feat: 优化代码生成策略,完美适配项目结构
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.schisandra.auth.infra.basic.mapper.SchisandraAuthUserDao">
|
||||
<mapper namespace="com.schisandra.auth.infra.basic.dao.SchisandraAuthUserDao">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.schisandra.auth.infra.basic.entity.SchisandraAuthUser">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
|
@@ -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
|
@@ -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 中替换
|
||||
|
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -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
|
||||
*
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -3,6 +3,7 @@ package com.schisandra.${module}.application.dto;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* ${tableComment} dto
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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} 表服务接口
|
||||
|
@@ -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} 表服务实现类
|
||||
|
@@ -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
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.schisandra.${module}.infra.basic.mapper.${modelName}Dao">
|
||||
<mapper namespace="com.schisandra.${module}.infra.basic.dao.${modelName}Dao">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.schisandra.${module}.infra.basic.entity.${modelName}">
|
||||
#foreach($field in $fields)
|
||||
|
@@ -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<Boolean> 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<Boolean> 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<Boolean> 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("删除亚马逊对象存储配置表信息失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -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<Boolean> 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<Boolean> 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<Boolean> 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("删除腾讯云对象存储配置表信息失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -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);
|
||||
|
||||
}
|
@@ -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);
|
||||
|
||||
}
|
@@ -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;
|
||||
|
||||
}
|
||||
|
@@ -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;
|
||||
|
||||
}
|
||||
|
@@ -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;
|
||||
|
||||
}
|
||||
|
@@ -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;
|
||||
|
||||
}
|
||||
|
@@ -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);
|
||||
|
||||
}
|
@@ -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);
|
||||
|
||||
}
|
@@ -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);
|
||||
|
||||
}
|
@@ -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);
|
||||
|
||||
}
|
@@ -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;
|
||||
}
|
||||
|
||||
}
|
@@ -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;
|
||||
}
|
||||
|
||||
}
|
@@ -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<SchisandraOssAws> {
|
||||
|
||||
}
|
||||
|
@@ -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<SchisandraOssTencent> {
|
||||
|
||||
}
|
||||
|
@@ -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;
|
||||
|
||||
}
|
||||
|
@@ -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;
|
||||
|
||||
}
|
||||
|
@@ -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);
|
||||
|
||||
|
||||
}
|
@@ -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);
|
||||
|
||||
|
||||
}
|
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.schisandra.oss.infra.basic.mapper.SchisandraOssAliDao">
|
||||
<mapper namespace="com.schisandra.oss.infra.basic.dao.SchisandraOssAliDao">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.schisandra.oss.infra.basic.entity.SchisandraOssAli">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
|
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.schisandra.oss.infra.basic.dao.SchisandraOssAwsDao">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.schisandra.oss.infra.basic.entity.SchisandraOssAws">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="user_id" jdbcType="BIGINT" property="userId"/>
|
||||
<result column="base_path" jdbcType="VARCHAR" property="basePath"/>
|
||||
<result column="bucket_name" jdbcType="VARCHAR" property="bucketName"/>
|
||||
<result column="access_key_id" jdbcType="VARCHAR" property="accessKeyId"/>
|
||||
<result column="secret_access_key" jdbcType="VARCHAR" property="secretAccessKey"/>
|
||||
<result column="region" jdbcType="VARCHAR" property="region"/>
|
||||
<result column="mode" jdbcType="VARCHAR" property="mode"/>
|
||||
<result column="accelerate_mode_enabled" jdbcType="VARCHAR" property="accelerateModeEnabled"/>
|
||||
<result column="checksum_validation_enabled" jdbcType="VARCHAR" property="checksumValidationEnabled"/>
|
||||
<result column="multi_region_enabled" jdbcType="VARCHAR" property="multiRegionEnabled"/>
|
||||
<result column="chunked_encoding_enabled" jdbcType="VARCHAR" property="chunkedEncodingEnabled"/>
|
||||
<result column="path_style_access_enabled" jdbcType="VARCHAR" property="pathStyleAccessEnabled"/>
|
||||
<result column="use_arn_region_enabled" jdbcType="VARCHAR" property="useArnRegionEnabled"/>
|
||||
<result column="fips_enabled" jdbcType="VARCHAR" property="fipsEnabled"/>
|
||||
<result column="dualstack_enabled" jdbcType="VARCHAR" property="dualstackEnabled"/>
|
||||
<result column="part_size" jdbcType="INTEGER" property="partSize"/>
|
||||
<result column="task_num" jdbcType="INTEGER" property="taskNum"/>
|
||||
<result column="status" jdbcType="VARCHAR" property="status"/>
|
||||
<result column="open_advanced_setup" jdbcType="VARCHAR" property="openAdvancedSetup"/>
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
|
||||
<result column="created_time" jdbcType="TIMESTAMP" property="createdTime"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
|
||||
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted"/>
|
||||
<result column="extra_json" jdbcType="VARCHAR" property="extraJson"/>
|
||||
<result column="create_bucket" jdbcType="VARCHAR" property="createBucket"/>
|
||||
<result column="check_bucket" jdbcType="VARCHAR" property="checkBucket"/>
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.schisandra.oss.infra.basic.mapper.SchisandraOssMinioDao">
|
||||
<mapper namespace="com.schisandra.oss.infra.basic.dao.SchisandraOssMinioDao">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.schisandra.oss.infra.basic.entity.SchisandraOssMinio">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
|
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.schisandra.oss.infra.basic.dao.SchisandraOssTencentDao">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.schisandra.oss.infra.basic.entity.SchisandraOssTencent">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="user_id" jdbcType="BIGINT" property="userId"/>
|
||||
<result column="base_path" jdbcType="VARCHAR" property="basePath"/>
|
||||
<result column="bucket_name" jdbcType="VARCHAR" property="bucketName"/>
|
||||
<result column="secret_id" jdbcType="VARCHAR" property="secretId"/>
|
||||
<result column="secret_key" jdbcType="VARCHAR" property="secretKey"/>
|
||||
<result column="region" jdbcType="VARCHAR" property="region"/>
|
||||
<result column="http_protocol" jdbcType="VARCHAR" property="httpProtocol"/>
|
||||
<result column="end_point_suffix" jdbcType="VARCHAR" property="endPointSuffix"/>
|
||||
<result column="http_proxy_Ip" jdbcType="VARCHAR" property="httpProxyIp"/>
|
||||
<result column="http_proxy_port" jdbcType="INTEGER" property="httpProxyPort"/>
|
||||
<result column="proxy_user_name" jdbcType="VARCHAR" property="proxyUserName"/>
|
||||
<result column="proxy_password" jdbcType="VARCHAR" property="proxyPassword"/>
|
||||
<result column="use_basic_auth" jdbcType="VARCHAR" property="useBasicAuth"/>
|
||||
<result column="sign_expired" jdbcType="BIGINT" property="signExpired"/>
|
||||
<result column="connection_request_timeout" jdbcType="INTEGER" property="connectionRequestTimeout"/>
|
||||
<result column="connection_timeout" jdbcType="INTEGER" property="connectionTimeout"/>
|
||||
<result column="socket_timeout" jdbcType="INTEGER" property="socketTimeout"/>
|
||||
<result column="max_connections_count" jdbcType="INTEGER" property="maxConnectionsCount"/>
|
||||
<result column="idle_connection_alive" jdbcType="INTEGER" property="idleConnectionAlive"/>
|
||||
<result column="user_agent" jdbcType="VARCHAR" property="userAgent"/>
|
||||
<result column="read_limit" jdbcType="VARCHAR" property="readLimit"/>
|
||||
<result column="ci_special_request" jdbcType="VARCHAR" property="ciSpecialRequest"/>
|
||||
<result column="max_error_retry" jdbcType="INTEGER" property="maxErrorRetry"/>
|
||||
<result column="extra_json" jdbcType="VARCHAR" property="extraJson"/>
|
||||
<result column="status" jdbcType="VARCHAR" property="status"/>
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
|
||||
<result column="created_time" jdbcType="TIMESTAMP" property="createdTime"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
|
||||
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted"/>
|
||||
<result column="open_advanced_setup" jdbcType="VARCHAR" property="openAdvancedSetup"/>
|
||||
<result column="create_bucket" jdbcType="VARCHAR" property="createBucket"/>
|
||||
<result column="check_bucket" jdbcType="VARCHAR" property="checkBucket"/>
|
||||
<result column="part_size" jdbcType="BIGINT" property="partSize"/>
|
||||
<result column="task_num" jdbcType="INTEGER" property="taskNum"/>
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user