feat: 代码生成
This commit is contained in:
@@ -0,0 +1,176 @@
|
||||
package com.schisandra.oss.application.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.schisandra.oss.application.convert.SchisandraOssConfigDTOConverter;
|
||||
import com.schisandra.oss.application.dto.SchisandraOssConfigDTO;
|
||||
import com.schisandra.oss.common.entity.Result;
|
||||
import com.schisandra.oss.domain.bo.SchisandraOssConfigBO;
|
||||
import com.schisandra.oss.domain.service.SchisandraOssConfigDomainService;
|
||||
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-05-11 22:58:14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/oss/")
|
||||
@Slf4j
|
||||
public class SchisandraOssConfigController {
|
||||
|
||||
@Resource
|
||||
private SchisandraOssConfigDomainService schisandraOssConfigDomainService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@RequestMapping("add")
|
||||
public Result<Boolean> add(@RequestBody SchisandraOssConfigDTO schisandraOssConfigDTO) {
|
||||
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("SchisandraOssConfigController.add.dto:{}", JSON.toJSONString(schisandraOssConfigDTO));
|
||||
}
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getId(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getOssType(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getEndpoint(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getAccessKey(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getSecretKey(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getBucketName(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getBasePath(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getRegion(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getTaskNum(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getPartSize(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getImgSize(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getFileSize(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getConnectTimeout(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getWriteTimeout(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getReadTimeout(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getZone(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getPublicKey(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getPrivateKey(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getCustomHost(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getHost(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getPort(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getUser(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getPassword(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getCharset(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getExtraJson(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getCreateDate(), "创建时间不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getUpdateBy(), "更新者不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getUpdateDate(), "更新时间不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getIsDeleted(), "是否删除 0未删除 1已删除不能为空");
|
||||
SchisandraOssConfigBO SchisandraOssConfigBO = SchisandraOssConfigDTOConverter.INSTANCE.convertDTOToBO(schisandraOssConfigDTO);
|
||||
return Result.ok(schisandraOssConfigDomainService.add(SchisandraOssConfigBO));
|
||||
} catch (Exception e) {
|
||||
log.error("SchisandraOssConfigController.register.error:{}", e.getMessage(), e);
|
||||
return Result.fail("新增失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("update")
|
||||
public Result<Boolean> update(@RequestBody SchisandraOssConfigDTO schisandraOssConfigDTO) {
|
||||
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("SchisandraOssConfigController.update.dto:{}", JSON.toJSONString(schisandraOssConfigDTO));
|
||||
}
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getId(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getOssType(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getEndpoint(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getAccessKey(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getSecretKey(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getBucketName(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getBasePath(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getRegion(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getTaskNum(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getPartSize(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getImgSize(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getFileSize(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getConnectTimeout(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getWriteTimeout(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getReadTimeout(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getZone(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getPublicKey(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getPrivateKey(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getCustomHost(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getHost(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getPort(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getUser(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getPassword(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getCharset(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getExtraJson(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getCreateDate(), "创建时间不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getUpdateBy(), "更新者不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getUpdateDate(), "更新时间不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getIsDeleted(), "是否删除 0未删除 1已删除不能为空");
|
||||
SchisandraOssConfigBO schisandraOssConfigBO = SchisandraOssConfigDTOConverter.INSTANCE.convertDTOToBO(schisandraOssConfigDTO);
|
||||
return Result.ok(schisandraOssConfigDomainService.update(schisandraOssConfigBO));
|
||||
} catch (Exception e) {
|
||||
log.error("SchisandraOssConfigController.update.error:{}", e.getMessage(), e);
|
||||
return Result.fail("更新信息失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("delete")
|
||||
public Result<Boolean> delete(@RequestBody SchisandraOssConfigDTO schisandraOssConfigDTO) {
|
||||
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("SchisandraOssConfigController.delete.dto:{}", JSON.toJSONString(schisandraOssConfigDTO));
|
||||
}
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getId(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getOssType(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getEndpoint(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getAccessKey(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getSecretKey(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getBucketName(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getBasePath(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getRegion(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getTaskNum(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getPartSize(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getImgSize(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getFileSize(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getConnectTimeout(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getWriteTimeout(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getReadTimeout(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getZone(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getPublicKey(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getPrivateKey(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getCustomHost(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getHost(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getPort(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getUser(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getPassword(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getCharset(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getExtraJson(), "不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getCreateDate(), "创建时间不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getUpdateBy(), "更新者不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getUpdateDate(), "更新时间不能为空");
|
||||
Preconditions.checkNotNull(schisandraOssConfigDTO.getIsDeleted(), "是否删除 0未删除 1已删除不能为空");
|
||||
SchisandraOssConfigBO schisandraOssConfigBO = SchisandraOssConfigDTOConverter.INSTANCE.convertDTOToBO(schisandraOssConfigDTO);
|
||||
return Result.ok(schisandraOssConfigDomainService.delete(schisandraOssConfigBO));
|
||||
} catch (Exception e) {
|
||||
log.error("SchisandraOssConfigController.delete.error:{}", e.getMessage(), e);
|
||||
return Result.fail("删除信息失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
package com.schisandra.oss.application.convert;
|
||||
|
||||
|
||||
import com.schisandra.oss.application.dto.SchisandraOssConfigDTO;
|
||||
import com.schisandra.oss.domain.bo.SchisandraOssConfigBO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* dto转换器
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-11 22:58:14
|
||||
*/
|
||||
@Mapper
|
||||
public interface SchisandraOssConfigDTOConverter {
|
||||
|
||||
SchisandraOssConfigDTOConverter INSTANCE = Mappers.getMapper(SchisandraOssConfigDTOConverter.class);
|
||||
|
||||
SchisandraOssConfigBO convertDTOToBO(SchisandraOssConfigDTO schisandraOssConfigDTO);
|
||||
|
||||
}
|
@@ -0,0 +1,163 @@
|
||||
package com.schisandra.oss.application.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* dto
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-11 22:58:14
|
||||
*/
|
||||
@Data
|
||||
public class SchisandraOssConfigDTO implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String ossType;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String endpoint;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String accessKey;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String secretKey;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String bucketName;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String basePath;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String region;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer taskNum;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String partSize;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Double imgSize;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Double fileSize;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer connectTimeout;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer writeTimeout;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer readTimeout;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String zone;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String publicKey;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String privateKey;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String customHost;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String host;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String port;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String user;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String charset;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String extraJson;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createDate;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateDate;
|
||||
|
||||
/**
|
||||
* 是否删除 0未删除 1已删除
|
||||
*/
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
|
@@ -95,6 +95,12 @@
|
||||
<version>1.8</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.ben-manes.caffeine</groupId>
|
||||
<artifactId>caffeine</artifactId>
|
||||
<version>3.1.8</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
@@ -0,0 +1,163 @@
|
||||
package com.schisandra.oss.domain.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* bo
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-11 22:58:14
|
||||
*/
|
||||
@Data
|
||||
public class SchisandraOssConfigBO implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String ossType;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String endpoint;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String accessKey;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String secretKey;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String bucketName;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String basePath;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String region;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer taskNum;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String partSize;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Double imgSize;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Double fileSize;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer connectTimeout;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer writeTimeout;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer readTimeout;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String zone;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String publicKey;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String privateKey;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String customHost;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String host;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String port;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String user;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String charset;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String extraJson;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createDate;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateDate;
|
||||
|
||||
/**
|
||||
* 是否删除 0未删除 1已删除
|
||||
*/
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,22 @@
|
||||
package com.schisandra.oss.domain.convert;
|
||||
|
||||
|
||||
import com.schisandra.oss.domain.bo.SchisandraOssConfigBO;
|
||||
import com.schisandra.oss.infra.basic.entity.SchisandraOssConfig;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* bo转换器
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-11 22:58:14
|
||||
*/
|
||||
@Mapper
|
||||
public interface SchisandraOssConfigBOConverter {
|
||||
|
||||
SchisandraOssConfigBOConverter INSTANCE = Mappers.getMapper(SchisandraOssConfigBOConverter.class);
|
||||
|
||||
SchisandraOssConfig convertBOToEntity(SchisandraOssConfigBO schisandraOssConfigBO);
|
||||
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
package com.schisandra.oss.domain.service;
|
||||
|
||||
import com.schisandra.oss.domain.bo.SchisandraOssConfigBO;
|
||||
|
||||
/**
|
||||
* 领域service
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-11 22:58:14
|
||||
*/
|
||||
public interface SchisandraOssConfigDomainService {
|
||||
|
||||
/**
|
||||
* 添加 信息
|
||||
*/
|
||||
Boolean add(SchisandraOssConfigBO schisandraOssConfigBO);
|
||||
|
||||
/**
|
||||
* 更新 信息
|
||||
*/
|
||||
Boolean update(SchisandraOssConfigBO schisandraOssConfigBO);
|
||||
|
||||
/**
|
||||
* 删除 信息
|
||||
*/
|
||||
Boolean delete(SchisandraOssConfigBO schisandraOssConfigBO);
|
||||
|
||||
}
|
@@ -0,0 +1,49 @@
|
||||
package com.schisandra.oss.domain.service.impl;
|
||||
|
||||
|
||||
import com.schisandra.oss.common.enums.IsDeletedFlagEnum;
|
||||
import com.schisandra.oss.domain.convert.SchisandraOssConfigBOConverter;
|
||||
import com.schisandra.oss.domain.bo.SchisandraOssConfigBO;
|
||||
import com.schisandra.oss.domain.service.SchisandraOssConfigDomainService;
|
||||
import com.schisandra.oss.infra.basic.entity.SchisandraOssConfig;
|
||||
import com.schisandra.oss.infra.basic.service.SchisandraOssConfigService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 领域service实现了
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-11 22:58:14
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SchisandraOssConfigDomainServiceImpl implements SchisandraOssConfigDomainService {
|
||||
|
||||
@Resource
|
||||
private SchisandraOssConfigService schisandraOssConfigService;
|
||||
|
||||
@Override
|
||||
public Boolean add(SchisandraOssConfigBO schisandraOssConfigBO) {
|
||||
SchisandraOssConfig schisandraOssConfig = SchisandraOssConfigBOConverter.INSTANCE.convertBOToEntity(schisandraOssConfigBO);
|
||||
schisandraOssConfig.setIsDeleted(IsDeletedFlagEnum.UN_DELETED.getCode());
|
||||
return schisandraOssConfigService.insert(schisandraOssConfig) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(SchisandraOssConfigBO schisandraOssConfigBO) {
|
||||
SchisandraOssConfig schisandraOssConfig = SchisandraOssConfigBOConverter.INSTANCE.convertBOToEntity(schisandraOssConfigBO);
|
||||
return schisandraOssConfigService.update(schisandraOssConfig) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean delete(SchisandraOssConfigBO schisandraOssConfigBO) {
|
||||
SchisandraOssConfig schisandraOssConfig = new SchisandraOssConfig();
|
||||
schisandraOssConfig.setId(schisandraOssConfigBO.getId());
|
||||
schisandraOssConfig.setIsDeleted(IsDeletedFlagEnum.DELETED.getCode());
|
||||
return schisandraOssConfigService.update(schisandraOssConfig) > 0;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
package com.schisandra.oss.infra.basic.dao;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.schisandra.oss.infra.basic.entity.SchisandraOssConfig;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 表数据库访问层
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-11 22:58:14
|
||||
*/
|
||||
@Repository
|
||||
public interface SchisandraOssConfigDao extends BaseMapper<SchisandraOssConfig> {
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,197 @@
|
||||
package com.schisandra.oss.infra.basic.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 实体类
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-11 22:58:14
|
||||
*/
|
||||
@Data
|
||||
@TableName("schisandra_oss_config")
|
||||
public class SchisandraOssConfig implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "`id`", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField("`oss_type`")
|
||||
private String ossType;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField("`endpoint`")
|
||||
private String endpoint;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField("`access_key`")
|
||||
private String accessKey;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField("`secret_key`")
|
||||
private String secretKey;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField("`bucket_name`")
|
||||
private String bucketName;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField("`base_path`")
|
||||
private String basePath;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField("`region`")
|
||||
private String region;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField("`task_num`")
|
||||
private Integer taskNum;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField("`part_size`")
|
||||
private String partSize;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField("`img_size`")
|
||||
private Double imgSize;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField("`file_size`")
|
||||
private Double fileSize;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField("`connect_timeout`")
|
||||
private Integer connectTimeout;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField("`write_timeout`")
|
||||
private Integer writeTimeout;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField("`read_timeout`")
|
||||
private Integer readTimeout;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField("`zone`")
|
||||
private String zone;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField("`public_key`")
|
||||
private String publicKey;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField("`private_key`")
|
||||
private String privateKey;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField("`custom_host`")
|
||||
private String customHost;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField("`host`")
|
||||
private String host;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField("`port`")
|
||||
private String port;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField("`user`")
|
||||
private String user;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField("`password`")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField("`charset`")
|
||||
private String charset;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField("`extra_json`")
|
||||
private String extraJson;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("`create_date`")
|
||||
private Date createDate;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@TableField("`update_by`")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("`update_date`")
|
||||
private Date updateDate;
|
||||
|
||||
/**
|
||||
* 是否删除 0未删除 1已删除
|
||||
*/
|
||||
@TableField("`is_deleted`")
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,50 @@
|
||||
package com.schisandra.oss.infra.basic.service;
|
||||
|
||||
import com.schisandra.oss.infra.basic.entity.SchisandraOssConfig;
|
||||
|
||||
/**
|
||||
* 表服务接口
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-11 22:58:14
|
||||
*/
|
||||
public interface SchisandraOssConfigService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
SchisandraOssConfig queryById(Long id);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param schisandraOssConfig 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
int insert(SchisandraOssConfig schisandraOssConfig);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param schisandraOssConfig 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
int update(SchisandraOssConfig schisandraOssConfig);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 根据条件查询角色
|
||||
*/
|
||||
SchisandraOssConfig queryByCondition(SchisandraOssConfig schisandraOssConfig);
|
||||
|
||||
}
|
@@ -0,0 +1,114 @@
|
||||
package com.schisandra.oss.infra.basic.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.schisandra.oss.infra.basic.dao.SchisandraOssConfigDao;
|
||||
import com.schisandra.oss.infra.basic.entity.SchisandraOssConfig;
|
||||
import com.schisandra.oss.infra.basic.service.SchisandraOssConfigService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 表服务实现类
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-11 22:58:14
|
||||
*/
|
||||
@Service("SchisandraOssConfigService")
|
||||
public class SchisandraOssConfigServiceImpl implements SchisandraOssConfigService {
|
||||
|
||||
@Resource
|
||||
private SchisandraOssConfigDao schisandraOssConfigDao;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public SchisandraOssConfig queryById(Long id) {
|
||||
return this.schisandraOssConfigDao.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param schisandraOssConfig 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public int insert(SchisandraOssConfig schisandraOssConfig) {
|
||||
return this.schisandraOssConfigDao.insert(schisandraOssConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param schisandraOssConfig 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public int update(SchisandraOssConfig schisandraOssConfig) {
|
||||
return this.schisandraOssConfigDao.updateById(schisandraOssConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Long id) {
|
||||
return this.schisandraOssConfigDao.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
* @param schisandraOssConfig 条件
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public SchisandraOssConfig queryByCondition(SchisandraOssConfig schisandraOssConfig) {
|
||||
|
||||
LambdaQueryWrapper<SchisandraOssConfig> queryWrapper = Wrappers.<SchisandraOssConfig>lambdaQuery()
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getId()), SchisandraOssConfig::getId, schisandraOssConfig.getId())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getOssType()), SchisandraOssConfig::getOssType, schisandraOssConfig.getOssType())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getEndpoint()), SchisandraOssConfig::getEndpoint, schisandraOssConfig.getEndpoint())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getAccessKey()), SchisandraOssConfig::getAccessKey, schisandraOssConfig.getAccessKey())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getSecretKey()), SchisandraOssConfig::getSecretKey, schisandraOssConfig.getSecretKey())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getBucketName()), SchisandraOssConfig::getBucketName, schisandraOssConfig.getBucketName())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getBasePath()), SchisandraOssConfig::getBasePath, schisandraOssConfig.getBasePath())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getRegion()), SchisandraOssConfig::getRegion, schisandraOssConfig.getRegion())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getTaskNum()), SchisandraOssConfig::getTaskNum, schisandraOssConfig.getTaskNum())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getPartSize()), SchisandraOssConfig::getPartSize, schisandraOssConfig.getPartSize())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getImgSize()), SchisandraOssConfig::getImgSize, schisandraOssConfig.getImgSize())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getFileSize()), SchisandraOssConfig::getFileSize, schisandraOssConfig.getFileSize())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getConnectTimeout()), SchisandraOssConfig::getConnectTimeout, schisandraOssConfig.getConnectTimeout())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getWriteTimeout()), SchisandraOssConfig::getWriteTimeout, schisandraOssConfig.getWriteTimeout())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getReadTimeout()), SchisandraOssConfig::getReadTimeout, schisandraOssConfig.getReadTimeout())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getZone()), SchisandraOssConfig::getZone, schisandraOssConfig.getZone())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getPublicKey()), SchisandraOssConfig::getPublicKey, schisandraOssConfig.getPublicKey())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getPrivateKey()), SchisandraOssConfig::getPrivateKey, schisandraOssConfig.getPrivateKey())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getCustomHost()), SchisandraOssConfig::getCustomHost, schisandraOssConfig.getCustomHost())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getHost()), SchisandraOssConfig::getHost, schisandraOssConfig.getHost())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getPort()), SchisandraOssConfig::getPort, schisandraOssConfig.getPort())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getUser()), SchisandraOssConfig::getUser, schisandraOssConfig.getUser())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getPassword()), SchisandraOssConfig::getPassword, schisandraOssConfig.getPassword())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getCharset()), SchisandraOssConfig::getCharset, schisandraOssConfig.getCharset())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getExtraJson()), SchisandraOssConfig::getExtraJson, schisandraOssConfig.getExtraJson())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getCreateDate()), SchisandraOssConfig::getCreateDate, schisandraOssConfig.getCreateDate())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getUpdateBy()), SchisandraOssConfig::getUpdateBy, schisandraOssConfig.getUpdateBy())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getUpdateDate()), SchisandraOssConfig::getUpdateDate, schisandraOssConfig.getUpdateDate())
|
||||
.eq(Objects.nonNull(schisandraOssConfig.getIsDeleted()), SchisandraOssConfig::getIsDeleted, schisandraOssConfig.getIsDeleted())
|
||||
;
|
||||
return schisandraOssConfigDao.selectOne(queryWrapper);
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,37 @@
|
||||
<?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.SchisandraOssConfigDao">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.schisandra.oss.infra.basic.entity.SchisandraOssConfig">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="oss_type" jdbcType="VARCHAR" property="ossType"/>
|
||||
<result column="endpoint" jdbcType="VARCHAR" property="endpoint"/>
|
||||
<result column="access_key" jdbcType="VARCHAR" property="accessKey"/>
|
||||
<result column="secret_key" jdbcType="VARCHAR" property="secretKey"/>
|
||||
<result column="bucket_name" jdbcType="VARCHAR" property="bucketName"/>
|
||||
<result column="base_path" jdbcType="VARCHAR" property="basePath"/>
|
||||
<result column="region" jdbcType="VARCHAR" property="region"/>
|
||||
<result column="task_num" jdbcType="INTEGER" property="taskNum"/>
|
||||
<result column="part_size" jdbcType="VARCHAR" property="partSize"/>
|
||||
<result column="img_size" jdbcType="DOUBLE" property="imgSize"/>
|
||||
<result column="file_size" jdbcType="DOUBLE" property="fileSize"/>
|
||||
<result column="connect_timeout" jdbcType="INTEGER" property="connectTimeout"/>
|
||||
<result column="write_timeout" jdbcType="INTEGER" property="writeTimeout"/>
|
||||
<result column="read_timeout" jdbcType="INTEGER" property="readTimeout"/>
|
||||
<result column="zone" jdbcType="VARCHAR" property="zone"/>
|
||||
<result column="public_key" jdbcType="VARCHAR" property="publicKey"/>
|
||||
<result column="private_key" jdbcType="VARCHAR" property="privateKey"/>
|
||||
<result column="custom_host" jdbcType="VARCHAR" property="customHost"/>
|
||||
<result column="host" jdbcType="VARCHAR" property="host"/>
|
||||
<result column="port" jdbcType="VARCHAR" property="port"/>
|
||||
<result column="user" jdbcType="VARCHAR" property="user"/>
|
||||
<result column="password" jdbcType="VARCHAR" property="password"/>
|
||||
<result column="charset" jdbcType="VARCHAR" property="charset"/>
|
||||
<result column="extra_json" jdbcType="VARCHAR" property="extraJson"/>
|
||||
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
|
||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
|
||||
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
|
||||
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted"/>
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
@@ -13,6 +13,7 @@ import org.springframework.context.annotation.ComponentScan;
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@ComponentScan("com.schisandra")
|
||||
@MapperScan("com.schisandra.**.dao")
|
||||
public class OssApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(OssApplication.class);
|
||||
|
Reference in New Issue
Block a user