feat: 代码生成
This commit is contained in:
@@ -116,6 +116,12 @@
|
||||
<version>1.8</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.ben-manes.caffeine</groupId>
|
||||
<artifactId>caffeine</artifactId>
|
||||
<version>3.1.8</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.xkcoding</groupId>
|
||||
<artifactId>justauth-spring-boot-starter</artifactId>
|
||||
|
@@ -8,23 +8,23 @@
|
||||
# 数据库连接信息
|
||||
jdbc:
|
||||
dbName: schisandra-cloud-storage
|
||||
tableName: subject_liked
|
||||
tableName: schisandra_oss_config
|
||||
url: jdbc:mysql://1.95.0.111:3306/
|
||||
username: landaiqing
|
||||
username: root
|
||||
password: LDQ20020618xxx
|
||||
driver: com.mysql.cj.jdbc.Driver
|
||||
|
||||
# 使用的模板与生成文件映射给关系
|
||||
mapperInfos: genCode/systemMapper.yml
|
||||
mapperInfos: genCode/ossMapper.yml
|
||||
|
||||
# 全局参数
|
||||
params:
|
||||
# 作者
|
||||
author: landaiqing
|
||||
# 模块
|
||||
module: system
|
||||
module: oss
|
||||
# controller 通用前缀
|
||||
api: /system
|
||||
api: /oss
|
||||
# 生成对象是否移除前缀
|
||||
removePre: false
|
||||
# 使用内置函数赋值给变量 FunctionUtils 中替换
|
||||
|
@@ -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
|
@@ -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
|
||||
|
@@ -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);
|
||||
|
@@ -0,0 +1,122 @@
|
||||
package com.schisandra.system.application.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import com.schisandra.system.application.convert.SchisandraSysConfigDTOConverter;
|
||||
import com.schisandra.system.application.dto.SchisandraSysConfigDTO;
|
||||
import com.schisandra.system.common.entity.Result;
|
||||
import com.schisandra.system.domain.entity.SchisandraSysConfigBO;
|
||||
import com.schisandra.system.domain.service.SchisandraSysConfigDomainService;
|
||||
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:45:55
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/")
|
||||
@Slf4j
|
||||
public class SchisandraSysConfigController {
|
||||
|
||||
@Resource
|
||||
private SchisandraSysConfigDomainService schisandraSysConfigDomainService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@RequestMapping("add")
|
||||
public Result<Boolean> add(@RequestBody SchisandraSysConfigDTO schisandraSysConfigDTO) {
|
||||
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("SchisandraSysConfigController.add.dto:{}", JSON.toJSONString(schisandraSysConfigDTO));
|
||||
}
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getId(), "id不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getConfigName(), "名称不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getConfigKey(), "参数键不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getConfigValue(), "参数值不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getCreateBy(), "创建者不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getConfigType(), "系统内置(0是 1否)不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getCreateDate(), "创建时间不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getUpdateBy(), "更新者不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getUpdateDate(), "更新时间不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getRemarks(), "备注信息不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getIsDeleted(), "是否删除 0未删除 1已删除不能为空");
|
||||
SchisandraSysConfigBO SchisandraSysConfigBO = SchisandraSysConfigDTOConverter.INSTANCE.convertDTOToBO(schisandraSysConfigDTO);
|
||||
return Result.ok(schisandraSysConfigDomainService.add(SchisandraSysConfigBO));
|
||||
} catch (Exception e) {
|
||||
log.error("SchisandraSysConfigController.register.error:{}", e.getMessage(), e);
|
||||
return Result.fail("新增失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("update")
|
||||
public Result<Boolean> update(@RequestBody SchisandraSysConfigDTO schisandraSysConfigDTO) {
|
||||
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("SchisandraSysConfigController.update.dto:{}", JSON.toJSONString(schisandraSysConfigDTO));
|
||||
}
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getId(), "id不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getConfigName(), "名称不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getConfigKey(), "参数键不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getConfigValue(), "参数值不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getCreateBy(), "创建者不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getConfigType(), "系统内置(0是 1否)不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getCreateDate(), "创建时间不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getUpdateBy(), "更新者不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getUpdateDate(), "更新时间不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getRemarks(), "备注信息不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getIsDeleted(), "是否删除 0未删除 1已删除不能为空");
|
||||
SchisandraSysConfigBO schisandraSysConfigBO = SchisandraSysConfigDTOConverter.INSTANCE.convertDTOToBO(schisandraSysConfigDTO);
|
||||
return Result.ok(schisandraSysConfigDomainService.update(schisandraSysConfigBO));
|
||||
} catch (Exception e) {
|
||||
log.error("SchisandraSysConfigController.update.error:{}", e.getMessage(), e);
|
||||
return Result.fail("更新信息失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("delete")
|
||||
public Result<Boolean> delete(@RequestBody SchisandraSysConfigDTO schisandraSysConfigDTO) {
|
||||
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("SchisandraSysConfigController.delete.dto:{}", JSON.toJSONString(schisandraSysConfigDTO));
|
||||
}
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getId(), "id不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getConfigName(), "名称不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getConfigKey(), "参数键不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getConfigValue(), "参数值不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getCreateBy(), "创建者不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getConfigType(), "系统内置(0是 1否)不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getCreateDate(), "创建时间不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getUpdateBy(), "更新者不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getUpdateDate(), "更新时间不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getRemarks(), "备注信息不能为空");
|
||||
Preconditions.checkNotNull(schisandraSysConfigDTO.getIsDeleted(), "是否删除 0未删除 1已删除不能为空");
|
||||
SchisandraSysConfigBO schisandraSysConfigBO = SchisandraSysConfigDTOConverter.INSTANCE.convertDTOToBO(schisandraSysConfigDTO);
|
||||
return Result.ok(schisandraSysConfigDomainService.delete(schisandraSysConfigBO));
|
||||
} catch (Exception e) {
|
||||
log.error("SchisandraSysConfigController.delete.error:{}", e.getMessage(), e);
|
||||
return Result.fail("删除信息失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
package com.schisandra.system.application.convert;
|
||||
|
||||
|
||||
import com.schisandra.system.application.dto.SchisandraSysConfigDTO;
|
||||
import com.schisandra.system.domain.entity.SchisandraSysConfigBO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* dto转换器
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-11 22:45:55
|
||||
*/
|
||||
@Mapper
|
||||
public interface SchisandraSysConfigDTOConverter {
|
||||
|
||||
SchisandraSysConfigDTOConverter INSTANCE = Mappers.getMapper(SchisandraSysConfigDTOConverter.class);
|
||||
|
||||
SchisandraSysConfigBO convertDTOToBO(SchisandraSysConfigDTO schisandraSysConfigDTO);
|
||||
|
||||
}
|
@@ -0,0 +1,73 @@
|
||||
package com.schisandra.system.application.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* dto
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-11 22:45:55
|
||||
*/
|
||||
@Data
|
||||
public class SchisandraSysConfigDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String configName;
|
||||
|
||||
/**
|
||||
* 参数键
|
||||
*/
|
||||
private String configKey;
|
||||
|
||||
/**
|
||||
* 参数值
|
||||
*/
|
||||
private String configValue;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 系统内置(0是 1否)
|
||||
*/
|
||||
private Integer configType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createDate;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateDate;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
private String remarks;
|
||||
|
||||
/**
|
||||
* 是否删除 0未删除 1已删除
|
||||
*/
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
|
@@ -91,15 +91,18 @@
|
||||
<version>2.9.0</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.directory.studio</groupId>
|
||||
<artifactId>org.apache.commons.codec</artifactId>
|
||||
<version>1.8</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.ben-manes.caffeine</groupId>
|
||||
<artifactId>caffeine</artifactId>
|
||||
<version>3.1.8</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
@@ -1,13 +0,0 @@
|
||||
package com.schisandra.system;
|
||||
|
||||
/**
|
||||
* Hello world!
|
||||
*
|
||||
*/
|
||||
public class App
|
||||
{
|
||||
public static void main( String[] args )
|
||||
{
|
||||
System.out.println( "Hello World!" );
|
||||
}
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
package com.schisandra.system.domain.convert;
|
||||
|
||||
import com.schisandra.system.domain.entity.SchisandraSysConfigBO;
|
||||
import com.schisandra.system.infra.basic.entity.SchisandraSysConfig;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* bo转换器
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-11 22:45:55
|
||||
*/
|
||||
@Mapper
|
||||
public interface SchisandraSysConfigBOConverter {
|
||||
|
||||
SchisandraSysConfigBOConverter INSTANCE = Mappers.getMapper(SchisandraSysConfigBOConverter.class);
|
||||
|
||||
SchisandraSysConfig convertBOToEntity(SchisandraSysConfigBO schisandraSysConfigBO);
|
||||
|
||||
}
|
@@ -0,0 +1,73 @@
|
||||
package com.schisandra.system.domain.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* bo
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-11 22:45:55
|
||||
*/
|
||||
@Data
|
||||
public class SchisandraSysConfigBO implements Serializable {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String configName;
|
||||
|
||||
/**
|
||||
* 参数键
|
||||
*/
|
||||
private String configKey;
|
||||
|
||||
/**
|
||||
* 参数值
|
||||
*/
|
||||
private String configValue;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 系统内置(0是 1否)
|
||||
*/
|
||||
private Integer configType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createDate;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateDate;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
private String remarks;
|
||||
|
||||
/**
|
||||
* 是否删除 0未删除 1已删除
|
||||
*/
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,28 @@
|
||||
package com.schisandra.system.domain.service;
|
||||
|
||||
import com.schisandra.system.domain.entity.SchisandraSysConfigBO;
|
||||
|
||||
/**
|
||||
* 领域service
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-11 22:45:55
|
||||
*/
|
||||
public interface SchisandraSysConfigDomainService {
|
||||
|
||||
/**
|
||||
* 添加 信息
|
||||
*/
|
||||
Boolean add(SchisandraSysConfigBO schisandraSysConfigBO);
|
||||
|
||||
/**
|
||||
* 更新 信息
|
||||
*/
|
||||
Boolean update(SchisandraSysConfigBO schisandraSysConfigBO);
|
||||
|
||||
/**
|
||||
* 删除 信息
|
||||
*/
|
||||
Boolean delete(SchisandraSysConfigBO schisandraSysConfigBO);
|
||||
|
||||
}
|
@@ -0,0 +1,49 @@
|
||||
package com.schisandra.system.domain.service.impl;
|
||||
|
||||
|
||||
import com.schisandra.system.common.enums.IsDeletedFlagEnum;
|
||||
import com.schisandra.system.domain.convert.SchisandraSysConfigBOConverter;
|
||||
import com.schisandra.system.domain.entity.SchisandraSysConfigBO;
|
||||
import com.schisandra.system.domain.service.SchisandraSysConfigDomainService;
|
||||
import com.schisandra.system.infra.basic.entity.SchisandraSysConfig;
|
||||
import com.schisandra.system.infra.basic.service.SchisandraSysConfigService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 领域service实现了
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-11 22:45:55
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SchisandraSysConfigDomainServiceImpl implements SchisandraSysConfigDomainService {
|
||||
|
||||
@Resource
|
||||
private SchisandraSysConfigService schisandraSysConfigService;
|
||||
|
||||
@Override
|
||||
public Boolean add(SchisandraSysConfigBO schisandraSysConfigBO) {
|
||||
SchisandraSysConfig schisandraSysConfig = SchisandraSysConfigBOConverter.INSTANCE.convertBOToEntity(schisandraSysConfigBO);
|
||||
schisandraSysConfig.setIsDeleted(IsDeletedFlagEnum.UN_DELETED.getCode());
|
||||
return schisandraSysConfigService.insert(schisandraSysConfig) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(SchisandraSysConfigBO schisandraSysConfigBO) {
|
||||
SchisandraSysConfig schisandraSysConfig = SchisandraSysConfigBOConverter.INSTANCE.convertBOToEntity(schisandraSysConfigBO);
|
||||
return schisandraSysConfigService.update(schisandraSysConfig) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean delete(SchisandraSysConfigBO schisandraSysConfigBO) {
|
||||
SchisandraSysConfig schisandraSysConfig = new SchisandraSysConfig();
|
||||
schisandraSysConfig.setId(schisandraSysConfigBO.getId());
|
||||
schisandraSysConfig.setIsDeleted(IsDeletedFlagEnum.DELETED.getCode());
|
||||
return schisandraSysConfigService.update(schisandraSysConfig) > 0;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
package com.schisandra.system.infra.basic.dao;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.schisandra.system.infra.basic.entity.SchisandraSysConfig;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 表数据库访问层
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-11 22:45:55
|
||||
*/
|
||||
@Repository
|
||||
public interface SchisandraSysConfigDao extends BaseMapper<SchisandraSysConfig> {
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,89 @@
|
||||
package com.schisandra.system.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:45:55
|
||||
*/
|
||||
@Data
|
||||
@TableName("schisandra_sys_config")
|
||||
public class SchisandraSysConfig implements Serializable {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "`id`", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@TableField("`config_name`")
|
||||
private String configName;
|
||||
|
||||
/**
|
||||
* 参数键
|
||||
*/
|
||||
@TableField("`config_key`")
|
||||
private String configKey;
|
||||
|
||||
/**
|
||||
* 参数值
|
||||
*/
|
||||
@TableField("`config_value`")
|
||||
private String configValue;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableField("`create_by`")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 系统内置(0是 1否)
|
||||
*/
|
||||
@TableField("`config_type`")
|
||||
private Integer configType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("`create_date`")
|
||||
private Date createDate;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@TableField("`update_by`")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("`update_date`")
|
||||
private Date updateDate;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
@TableField("`remarks`")
|
||||
private String remarks;
|
||||
|
||||
/**
|
||||
* 是否删除 0未删除 1已删除
|
||||
*/
|
||||
@TableField("`is_deleted`")
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,51 @@
|
||||
package com.schisandra.system.infra.basic.service;
|
||||
|
||||
import com.schisandra.system.infra.basic.entity.SchisandraSysConfig;
|
||||
|
||||
|
||||
/**
|
||||
* 表服务接口
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-11 22:45:55
|
||||
*/
|
||||
public interface SchisandraSysConfigService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
SchisandraSysConfig queryById(Long id);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param schisandraSysConfig 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
int insert(SchisandraSysConfig schisandraSysConfig);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param schisandraSysConfig 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
int update(SchisandraSysConfig schisandraSysConfig);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 根据条件查询角色
|
||||
*/
|
||||
SchisandraSysConfig queryByCondition(SchisandraSysConfig schisandraSysConfig);
|
||||
|
||||
}
|
@@ -0,0 +1,96 @@
|
||||
package com.schisandra.system.infra.basic.service.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.schisandra.system.infra.basic.entity.SchisandraSysConfig;
|
||||
import com.schisandra.system.infra.basic.dao.SchisandraSysConfigDao;
|
||||
import com.schisandra.system.infra.basic.service.SchisandraSysConfigService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 表服务实现类
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-11 22:45:55
|
||||
*/
|
||||
@Service("SchisandraSysConfigService")
|
||||
public class SchisandraSysConfigServiceImpl implements SchisandraSysConfigService {
|
||||
|
||||
@Resource
|
||||
private SchisandraSysConfigDao schisandraSysConfigDao;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public SchisandraSysConfig queryById(Long id) {
|
||||
return this.schisandraSysConfigDao.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param schisandraSysConfig 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public int insert(SchisandraSysConfig schisandraSysConfig) {
|
||||
return this.schisandraSysConfigDao.insert(schisandraSysConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param schisandraSysConfig 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public int update(SchisandraSysConfig schisandraSysConfig) {
|
||||
return this.schisandraSysConfigDao.updateById(schisandraSysConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Long id) {
|
||||
return this.schisandraSysConfigDao.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
* @param schisandraSysConfig 条件
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public SchisandraSysConfig queryByCondition(SchisandraSysConfig schisandraSysConfig) {
|
||||
|
||||
LambdaQueryWrapper<SchisandraSysConfig> queryWrapper = Wrappers.<SchisandraSysConfig>lambdaQuery()
|
||||
.eq(Objects.nonNull(schisandraSysConfig.getId()), SchisandraSysConfig::getId, schisandraSysConfig.getId())
|
||||
.eq(Objects.nonNull(schisandraSysConfig.getConfigName()), SchisandraSysConfig::getConfigName, schisandraSysConfig.getConfigName())
|
||||
.eq(Objects.nonNull(schisandraSysConfig.getConfigKey()), SchisandraSysConfig::getConfigKey, schisandraSysConfig.getConfigKey())
|
||||
.eq(Objects.nonNull(schisandraSysConfig.getConfigValue()), SchisandraSysConfig::getConfigValue, schisandraSysConfig.getConfigValue())
|
||||
.eq(Objects.nonNull(schisandraSysConfig.getCreateBy()), SchisandraSysConfig::getCreateBy, schisandraSysConfig.getCreateBy())
|
||||
.eq(Objects.nonNull(schisandraSysConfig.getConfigType()), SchisandraSysConfig::getConfigType, schisandraSysConfig.getConfigType())
|
||||
.eq(Objects.nonNull(schisandraSysConfig.getCreateDate()), SchisandraSysConfig::getCreateDate, schisandraSysConfig.getCreateDate())
|
||||
.eq(Objects.nonNull(schisandraSysConfig.getUpdateBy()), SchisandraSysConfig::getUpdateBy, schisandraSysConfig.getUpdateBy())
|
||||
.eq(Objects.nonNull(schisandraSysConfig.getUpdateDate()), SchisandraSysConfig::getUpdateDate, schisandraSysConfig.getUpdateDate())
|
||||
.eq(Objects.nonNull(schisandraSysConfig.getRemarks()), SchisandraSysConfig::getRemarks, schisandraSysConfig.getRemarks())
|
||||
.eq(Objects.nonNull(schisandraSysConfig.getIsDeleted()), SchisandraSysConfig::getIsDeleted, schisandraSysConfig.getIsDeleted())
|
||||
;
|
||||
return schisandraSysConfigDao.selectOne(queryWrapper);
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,19 @@
|
||||
<?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.system.infra.basic.dao.SchisandraSysConfigDao">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.schisandra.system.infra.basic.entity.SchisandraSysConfig">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="config_name" jdbcType="VARCHAR" property="configName"/>
|
||||
<result column="config_key" jdbcType="VARCHAR" property="configKey"/>
|
||||
<result column="config_value" jdbcType="VARCHAR" property="configValue"/>
|
||||
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
|
||||
<result column="config_type" jdbcType="INTEGER" property="configType"/>
|
||||
<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="remarks" jdbcType="VARCHAR" property="remarks"/>
|
||||
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted"/>
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
@@ -1,5 +1,6 @@
|
||||
package com.schisandra.system;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
@@ -12,6 +13,7 @@ import org.springframework.context.annotation.ComponentScan;
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@ComponentScan("com.schisandra")
|
||||
@MapperScan("com.schisandra.**.dao")
|
||||
public class SystemApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SystemApplication.class);
|
||||
|
@@ -56,4 +56,22 @@ logging:
|
||||
mybatis-plus:
|
||||
global-config:
|
||||
banner: false
|
||||
############## Sa-Token 配置 (文档: https://sa-token.cc) ##############
|
||||
sa-token:
|
||||
# token 名称(同时也是 cookie 名称)
|
||||
token-name: token
|
||||
# token 有效期(单位:秒) 默认30天,-1 代表永久有效
|
||||
timeout: 2592000
|
||||
# token 最低活跃频率(单位:秒),如果 token 超过此时间没有访问系统就会被冻结,默认-1 代表不限制,永不冻结
|
||||
active-timeout: -1
|
||||
# 是否允许同一账号多地同时登录 (为 true 时允许一起登录, 为 false 时新登录挤掉旧登录)
|
||||
is-concurrent: true
|
||||
# 在多人登录同一账号时,是否共用一个 token (为 true 时所有登录共用一个 token, 为 false 时每次登录新建一个 token)
|
||||
is-share: true
|
||||
# token 风格(默认可取值:uuid、simple-uuid、random-32、random-64、random-128、tik)
|
||||
token-style: random-32
|
||||
# 是否输出操作日志
|
||||
is-log: false
|
||||
token-prefix: schisandra
|
||||
is-print: false
|
||||
|
||||
|
Reference in New Issue
Block a user