feat: mybatis-plus --> mybatis-flex
This commit is contained in:
3
schisandra-cloud-storage-system/mybatis-flex.config
Normal file
3
schisandra-cloud-storage-system/mybatis-flex.config
Normal file
@@ -0,0 +1,3 @@
|
||||
processor.enable=true
|
||||
processor.allInTables.enable=false
|
||||
processor.allInTables.package=com.schisandra.system
|
||||
@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@FeignClient("schisandra-cloud-storage-system-dev")
|
||||
public interface SchisandraSystemFeignService {
|
||||
@RequestMapping(value = "/system/getConfigByKey",method = RequestMethod.GET)
|
||||
@PostMapping(value = "/system/getConfigByKey")
|
||||
Result<SchisandraSysConfigDTO> getConfigByKey(@RequestParam(value = "key") String key);
|
||||
@PostMapping("/system/oauth/getOauthConfigByType")
|
||||
Result<SchisandraSysOauthDTO> getOauthConfigByType(@RequestParam("type") String type);
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>schisandra-cloud-storage-system-application</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
<modules>
|
||||
<module>schisandra-cloud-storage-system-application-controller</module>
|
||||
<module>schisandra-cloud-storage-system-application-job</module>
|
||||
@@ -23,11 +22,5 @@
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -11,6 +11,32 @@
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>schisandra-cloud-storage-system-application-controller</name>
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.schisandra.system</groupId>
|
||||
<artifactId>schisandra-cloud-storage-system-domain</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.schisandra.system</groupId>
|
||||
<artifactId>schisandra-cloud-storage-system-api</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
@@ -39,34 +65,14 @@
|
||||
<artifactId>lombok-mapstruct-binding</artifactId>
|
||||
<version>0.2.0</version>
|
||||
</path>
|
||||
<path>
|
||||
<groupId>com.mybatis-flex</groupId>
|
||||
<artifactId>mybatis-flex-processor</artifactId>
|
||||
<version>1.9.0</version>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.schisandra.system</groupId>
|
||||
<artifactId>schisandra-cloud-storage-system-domain</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.schisandra.system</groupId>
|
||||
<artifactId>schisandra-cloud-storage-system-api</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -30,7 +30,7 @@ public class SchisandraSysConfigController {
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@RequestMapping("add")
|
||||
@PostMapping("add")
|
||||
public Result<Boolean> add(@RequestBody SchisandraSysConfigDTO schisandraSysConfigDTO) {
|
||||
|
||||
try {
|
||||
@@ -60,7 +60,7 @@ public class SchisandraSysConfigController {
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("update")
|
||||
@PostMapping("update")
|
||||
public Result<Boolean> update(@RequestBody SchisandraSysConfigDTO schisandraSysConfigDTO) {
|
||||
|
||||
try {
|
||||
@@ -90,7 +90,7 @@ public class SchisandraSysConfigController {
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("delete")
|
||||
@DeleteMapping("delete")
|
||||
public Result<Boolean> delete(@RequestBody SchisandraSysConfigDTO schisandraSysConfigDTO) {
|
||||
|
||||
try {
|
||||
@@ -117,7 +117,7 @@ public class SchisandraSysConfigController {
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value = "getConfigByKey",method = RequestMethod.GET)
|
||||
@PostMapping(value = "getConfigByKey")
|
||||
public Result<SchisandraSysConfigDTO> getConfigByKey(@RequestParam(value = "key") String key) {
|
||||
try {
|
||||
if (log.isInfoEnabled()) {
|
||||
|
||||
@@ -39,6 +39,11 @@
|
||||
<artifactId>lombok-mapstruct-binding</artifactId>
|
||||
<version>0.2.0</version>
|
||||
</path>
|
||||
<path>
|
||||
<groupId>com.mybatis-flex</groupId>
|
||||
<artifactId>mybatis-flex-processor</artifactId>
|
||||
<version>1.9.0</version>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
@@ -38,11 +38,17 @@
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.33</version>
|
||||
</dependency>
|
||||
<!--mybatis plus-->
|
||||
<!--mybatis flex-->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.4.0</version>
|
||||
<groupId>com.mybatis-flex</groupId>
|
||||
<artifactId>mybatis-flex-spring-boot-starter</artifactId>
|
||||
<version>1.9.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.mybatis-flex</groupId>
|
||||
<artifactId>mybatis-flex-processor</artifactId>
|
||||
<version>1.9.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.schisandra.system</groupId>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.schisandra.system.infra.basic.dao;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.schisandra.system.infra.basic.entity.SchisandraSysConfig;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package com.schisandra.system.infra.basic.dao;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.schisandra.system.infra.basic.entity.SchisandraSysLog;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package com.schisandra.system.infra.basic.dao;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.schisandra.system.infra.basic.entity.SchisandraSysOauth;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
||||
@@ -1,88 +1,88 @@
|
||||
package com.schisandra.system.infra.basic.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import lombok.Data;
|
||||
import 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")
|
||||
@Table("schisandra_sys_config")
|
||||
public class SchisandraSysConfig implements Serializable {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "`id`", type = IdType.AUTO)
|
||||
@Id(value = "id", keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@TableField("`config_name`")
|
||||
@Column("config_name")
|
||||
private String configName;
|
||||
|
||||
/**
|
||||
* 参数键
|
||||
*/
|
||||
@TableField("`config_key`")
|
||||
@Column("config_key")
|
||||
private String configKey;
|
||||
|
||||
/**
|
||||
* 参数值
|
||||
*/
|
||||
@TableField("`config_value`")
|
||||
@Column("config_value")
|
||||
private String configValue;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableField("`create_by`")
|
||||
@Column("create_by")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 系统内置(0是 1否)
|
||||
*/
|
||||
@TableField("`config_type`")
|
||||
@Column("config_type")
|
||||
private Integer configType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("`create_date`")
|
||||
@Column("create_date")
|
||||
private Date createDate;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@TableField("`update_by`")
|
||||
@Column("update_by")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("`update_date`")
|
||||
@Column("update_date")
|
||||
private Date updateDate;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
@TableField("`remarks`")
|
||||
@Column("remarks")
|
||||
private String remarks;
|
||||
|
||||
/**
|
||||
* 是否删除 0未删除 1已删除
|
||||
*/
|
||||
@TableField("`is_deleted`")
|
||||
@Column("is_deleted")
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,143 +1,144 @@
|
||||
package com.schisandra.system.infra.basic.entity;
|
||||
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import lombok.Data;
|
||||
import 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.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 实体类
|
||||
* 实体类
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-12 14:21:42
|
||||
*/
|
||||
@Data
|
||||
@TableName("schisandra_sys_log")
|
||||
@Table("schisandra_sys_log")
|
||||
public class SchisandraSysLog implements Serializable {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(value = "`id`", type = IdType.AUTO)
|
||||
@Id(value = "id", keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 日志类型
|
||||
*/
|
||||
@TableField("`log_type`")
|
||||
@Column("log_type")
|
||||
private String logType;
|
||||
|
||||
/**
|
||||
* 日志标题
|
||||
*/
|
||||
@TableField("`log_title`")
|
||||
@Column("log_title")
|
||||
private String logTitle;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableField("`create_by`")
|
||||
@Column("create_by")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
@TableField("`create_by_name`")
|
||||
@Column("create_by_name")
|
||||
private String createByName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("`create_date`")
|
||||
@Column("create_date")
|
||||
private Date createDate;
|
||||
|
||||
/**
|
||||
* 请求URI
|
||||
*/
|
||||
@TableField("`request_uri`")
|
||||
@Column("request_uri")
|
||||
private String requestUri;
|
||||
|
||||
/**
|
||||
* 操作方式
|
||||
*/
|
||||
@TableField("`request_method`")
|
||||
@Column("request_method")
|
||||
private String requestMethod;
|
||||
|
||||
/**
|
||||
* 操作提交的数据
|
||||
*/
|
||||
@TableField("`request_params`")
|
||||
@Column("request_params")
|
||||
private String requestParams;
|
||||
|
||||
/**
|
||||
* 新旧数据比较结果
|
||||
*/
|
||||
@TableField("`diff_modify_data`")
|
||||
@Column("diff_modify_data")
|
||||
private String diffModifyData;
|
||||
|
||||
/**
|
||||
* 业务主键
|
||||
*/
|
||||
@TableField("`biz_key`")
|
||||
@Column("biz_key")
|
||||
private String bizKey;
|
||||
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
@TableField("`biz_type`")
|
||||
@Column("biz_type")
|
||||
private String bizType;
|
||||
|
||||
/**
|
||||
* 操作IP地址
|
||||
*/
|
||||
@TableField("`remote_addr`")
|
||||
@Column("remote_addr")
|
||||
private String remoteAddr;
|
||||
|
||||
/**
|
||||
* 请求服务器地址
|
||||
*/
|
||||
@TableField("`server_addr`")
|
||||
@Column("server_addr")
|
||||
private String serverAddr;
|
||||
|
||||
/**
|
||||
* 是否异常
|
||||
*/
|
||||
@TableField("`is_exception`")
|
||||
@Column("is_exception")
|
||||
private String isException;
|
||||
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
@TableField("`exception_info`")
|
||||
@Column("exception_info")
|
||||
private String exceptionInfo;
|
||||
|
||||
/**
|
||||
* 用户代理
|
||||
*/
|
||||
@TableField("`user_agent`")
|
||||
@Column("user_agent")
|
||||
private String userAgent;
|
||||
|
||||
/**
|
||||
* 设备名称/操作系统
|
||||
*/
|
||||
@TableField("`device_name`")
|
||||
@Column("device_name")
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 浏览器名称
|
||||
*/
|
||||
@TableField("`browser_name`")
|
||||
@Column("browser_name")
|
||||
private String browserName;
|
||||
|
||||
/**
|
||||
* 执行时间
|
||||
*/
|
||||
@TableField("`execute_time`")
|
||||
@Column("execute_time")
|
||||
private BigDecimal executeTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,118 +1,118 @@
|
||||
package com.schisandra.system.infra.basic.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import lombok.Data;
|
||||
import 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-25 23:08:26
|
||||
*/
|
||||
@Data
|
||||
@TableName("schisandra_sys_oauth")
|
||||
@Table("schisandra_sys_oauth")
|
||||
public class SchisandraSysOauth implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
@TableId(value = "`id`", type = IdType.AUTO)
|
||||
@Id(value = "id", keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@TableField("`client_type`")
|
||||
@Column("client_type")
|
||||
private String clientType;
|
||||
|
||||
/**
|
||||
* Client Id
|
||||
*/
|
||||
@TableField("`client_id`")
|
||||
@Column("client_id")
|
||||
private String clientId;
|
||||
|
||||
/**
|
||||
* Client Secret
|
||||
*/
|
||||
@TableField("`client_secret`")
|
||||
@Column("client_secret")
|
||||
private String clientSecret;
|
||||
|
||||
/**
|
||||
* 应用回调地址
|
||||
*/
|
||||
@TableField("`redirect_uri`")
|
||||
@Column("redirect_uri")
|
||||
private String redirectUri;
|
||||
|
||||
/**
|
||||
* Key
|
||||
*/
|
||||
@TableField("`stack_overflow_Key`")
|
||||
@Column("stack_overflow_Key")
|
||||
private String stackOverflowKey;
|
||||
|
||||
/**
|
||||
* 团队名
|
||||
*/
|
||||
@TableField("`domain_prefix`")
|
||||
@Column("domain_prefix")
|
||||
private String domainPrefix;
|
||||
|
||||
/**
|
||||
* 目录(租户) ID
|
||||
*/
|
||||
@TableField("`tenant_id`")
|
||||
@Column("tenant_id")
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
@TableField("`alipay_public_key`")
|
||||
@Column("alipay_public_key")
|
||||
private String alipayPublicKey;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
@TableField("`agent_id`")
|
||||
@Column("agent_id")
|
||||
private String agentId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField("`created_by`")
|
||||
@Column("created_by")
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("`created_time`")
|
||||
@Column("created_time")
|
||||
private Date createdTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("`update_time`")
|
||||
@Column("update_time")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField("`update_by`")
|
||||
@Column("update_by")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 是否删除 0 未删除 1已删除
|
||||
*/
|
||||
@TableField("`is_deleted`")
|
||||
@Column("is_deleted")
|
||||
private Integer isDeleted;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@TableField("`status`")
|
||||
@Column("status")
|
||||
private String status;
|
||||
|
||||
}
|
||||
|
||||
@@ -43,10 +43,6 @@ public interface SchisandraSysConfigService {
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 根据条件查询角色
|
||||
*/
|
||||
SchisandraSysConfig queryByCondition(SchisandraSysConfig schisandraSysConfig);
|
||||
|
||||
SchisandraSysConfig getConfigByKey(String key);
|
||||
}
|
||||
|
||||
@@ -42,9 +42,5 @@ public interface SchisandraSysLogService {
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 根据条件查询角色
|
||||
*/
|
||||
SchisandraSysLog queryByCondition(SchisandraSysLog schisandraSysLog);
|
||||
|
||||
}
|
||||
|
||||
@@ -42,10 +42,6 @@ public interface SchisandraSysOauthService {
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 根据条件查询角色
|
||||
*/
|
||||
SchisandraSysOauth queryByCondition(SchisandraSysOauth schisandraSysOauth);
|
||||
|
||||
SchisandraSysOauth getOauthConfigByType(String type);
|
||||
}
|
||||
|
||||
@@ -1,19 +1,16 @@
|
||||
package com.schisandra.system.infra.basic.service.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.entity.SchisandraSysConfig;
|
||||
import com.schisandra.system.infra.basic.entity.table.SchisandraSysConfigTableDef;
|
||||
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
|
||||
@@ -32,7 +29,7 @@ public class SchisandraSysConfigServiceImpl implements SchisandraSysConfigServic
|
||||
*/
|
||||
@Override
|
||||
public SchisandraSysConfig queryById(Long id) {
|
||||
return this.schisandraSysConfigDao.selectById(id);
|
||||
return this.schisandraSysConfigDao.selectOneById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -54,7 +51,7 @@ public class SchisandraSysConfigServiceImpl implements SchisandraSysConfigServic
|
||||
*/
|
||||
@Override
|
||||
public int update(SchisandraSysConfig schisandraSysConfig) {
|
||||
return this.schisandraSysConfigDao.updateById(schisandraSysConfig);
|
||||
return this.schisandraSysConfigDao.update(schisandraSysConfig, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,35 +66,14 @@ public class SchisandraSysConfigServiceImpl implements SchisandraSysConfigServic
|
||||
}
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
* 通过关键字查找配置
|
||||
*
|
||||
* @param schisandraSysConfig 条件
|
||||
* @return 实例对象
|
||||
* @param key key
|
||||
* @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);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public SchisandraSysConfig getConfigByKey(String key) {
|
||||
return schisandraSysConfigDao.selectOne(new QueryWrapper<SchisandraSysConfig>().eq("config_key", key)
|
||||
.eq("is_deleted", 0));
|
||||
return schisandraSysConfigDao.selectOneByCondition(SchisandraSysConfigTableDef.SCHISANDRA_SYS_CONFIG.CONFIG_KEY.eq(key));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
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.dao.SchisandraSysLogDao;
|
||||
import com.schisandra.system.infra.basic.entity.SchisandraSysLog;
|
||||
import com.schisandra.system.infra.basic.service.SchisandraSysLogService;
|
||||
@@ -31,7 +29,7 @@ public class SchisandraSysLogServiceImpl implements SchisandraSysLogService {
|
||||
*/
|
||||
@Override
|
||||
public SchisandraSysLog queryById(Long id) {
|
||||
return this.schisandraSysLogDao.selectById(id);
|
||||
return this.schisandraSysLogDao.selectOneById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -53,7 +51,7 @@ public class SchisandraSysLogServiceImpl implements SchisandraSysLogService {
|
||||
*/
|
||||
@Override
|
||||
public int update(SchisandraSysLog schisandraSysLog) {
|
||||
return this.schisandraSysLogDao.updateById(schisandraSysLog);
|
||||
return this.schisandraSysLogDao.update(schisandraSysLog,true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,39 +65,5 @@ public class SchisandraSysLogServiceImpl implements SchisandraSysLogService {
|
||||
return this.schisandraSysLogDao.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
* @param schisandraSysLog 条件
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public SchisandraSysLog queryByCondition(SchisandraSysLog schisandraSysLog) {
|
||||
|
||||
LambdaQueryWrapper<SchisandraSysLog> queryWrapper = Wrappers.<SchisandraSysLog>lambdaQuery()
|
||||
.eq(Objects.nonNull(schisandraSysLog.getId()), SchisandraSysLog::getId, schisandraSysLog.getId())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getLogType()), SchisandraSysLog::getLogType, schisandraSysLog.getLogType())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getLogTitle()), SchisandraSysLog::getLogTitle, schisandraSysLog.getLogTitle())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getCreateBy()), SchisandraSysLog::getCreateBy, schisandraSysLog.getCreateBy())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getCreateByName()), SchisandraSysLog::getCreateByName, schisandraSysLog.getCreateByName())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getCreateDate()), SchisandraSysLog::getCreateDate, schisandraSysLog.getCreateDate())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getRequestUri()), SchisandraSysLog::getRequestUri, schisandraSysLog.getRequestUri())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getRequestMethod()), SchisandraSysLog::getRequestMethod, schisandraSysLog.getRequestMethod())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getRequestParams()), SchisandraSysLog::getRequestParams, schisandraSysLog.getRequestParams())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getDiffModifyData()), SchisandraSysLog::getDiffModifyData, schisandraSysLog.getDiffModifyData())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getBizKey()), SchisandraSysLog::getBizKey, schisandraSysLog.getBizKey())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getBizType()), SchisandraSysLog::getBizType, schisandraSysLog.getBizType())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getRemoteAddr()), SchisandraSysLog::getRemoteAddr, schisandraSysLog.getRemoteAddr())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getServerAddr()), SchisandraSysLog::getServerAddr, schisandraSysLog.getServerAddr())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getIsException()), SchisandraSysLog::getIsException, schisandraSysLog.getIsException())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getExceptionInfo()), SchisandraSysLog::getExceptionInfo, schisandraSysLog.getExceptionInfo())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getUserAgent()), SchisandraSysLog::getUserAgent, schisandraSysLog.getUserAgent())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getDeviceName()), SchisandraSysLog::getDeviceName, schisandraSysLog.getDeviceName())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getBrowserName()), SchisandraSysLog::getBrowserName, schisandraSysLog.getBrowserName())
|
||||
.eq(Objects.nonNull(schisandraSysLog.getExecuteTime()), SchisandraSysLog::getExecuteTime, schisandraSysLog.getExecuteTime())
|
||||
;
|
||||
return schisandraSysLogDao.selectOne(queryWrapper);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.schisandra.system.infra.basic.service.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.schisandra.system.infra.basic.dao.SchisandraSysOauthDao;
|
||||
import com.schisandra.system.infra.basic.entity.SchisandraSysOauth;
|
||||
import com.schisandra.system.infra.basic.entity.table.SchisandraSysOauthTableDef;
|
||||
import com.schisandra.system.infra.basic.service.SchisandraSysOauthService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -32,7 +29,7 @@ public class SchisandraSysOauthServiceImpl implements SchisandraSysOauthService
|
||||
*/
|
||||
@Override
|
||||
public SchisandraSysOauth queryById(Long id) {
|
||||
return this.schisandraSysOauthDao.selectById(id);
|
||||
return this.schisandraSysOauthDao.selectOneById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -54,7 +51,7 @@ public class SchisandraSysOauthServiceImpl implements SchisandraSysOauthService
|
||||
*/
|
||||
@Override
|
||||
public int update(SchisandraSysOauth schisandraSysOauth) {
|
||||
return this.schisandraSysOauthDao.updateById(schisandraSysOauth);
|
||||
return this.schisandraSysOauthDao.update(schisandraSysOauth,true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,41 +66,14 @@ public class SchisandraSysOauthServiceImpl implements SchisandraSysOauthService
|
||||
}
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param schisandraSysOauth 条件
|
||||
* @return 实例对象
|
||||
* @param type 客户端类型
|
||||
* @return 实体
|
||||
*/
|
||||
@Override
|
||||
public SchisandraSysOauth queryByCondition(SchisandraSysOauth schisandraSysOauth) {
|
||||
|
||||
LambdaQueryWrapper<SchisandraSysOauth> queryWrapper = Wrappers.<SchisandraSysOauth>lambdaQuery()
|
||||
.eq(Objects.nonNull(schisandraSysOauth.getId()), SchisandraSysOauth::getId, schisandraSysOauth.getId())
|
||||
.eq(Objects.nonNull(schisandraSysOauth.getClientType()), SchisandraSysOauth::getClientType, schisandraSysOauth.getClientType())
|
||||
.eq(Objects.nonNull(schisandraSysOauth.getClientId()), SchisandraSysOauth::getClientId, schisandraSysOauth.getClientId())
|
||||
.eq(Objects.nonNull(schisandraSysOauth.getClientSecret()), SchisandraSysOauth::getClientSecret, schisandraSysOauth.getClientSecret())
|
||||
.eq(Objects.nonNull(schisandraSysOauth.getRedirectUri()), SchisandraSysOauth::getRedirectUri, schisandraSysOauth.getRedirectUri())
|
||||
.eq(Objects.nonNull(schisandraSysOauth.getStackOverflowKey()), SchisandraSysOauth::getStackOverflowKey, schisandraSysOauth.getStackOverflowKey())
|
||||
.eq(Objects.nonNull(schisandraSysOauth.getDomainPrefix()), SchisandraSysOauth::getDomainPrefix, schisandraSysOauth.getDomainPrefix())
|
||||
.eq(Objects.nonNull(schisandraSysOauth.getTenantId()), SchisandraSysOauth::getTenantId, schisandraSysOauth.getTenantId())
|
||||
.eq(Objects.nonNull(schisandraSysOauth.getAlipayPublicKey()), SchisandraSysOauth::getAlipayPublicKey, schisandraSysOauth.getAlipayPublicKey())
|
||||
.eq(Objects.nonNull(schisandraSysOauth.getAgentId()), SchisandraSysOauth::getAgentId, schisandraSysOauth.getAgentId())
|
||||
.eq(Objects.nonNull(schisandraSysOauth.getCreatedBy()), SchisandraSysOauth::getCreatedBy, schisandraSysOauth.getCreatedBy())
|
||||
.eq(Objects.nonNull(schisandraSysOauth.getCreatedTime()), SchisandraSysOauth::getCreatedTime, schisandraSysOauth.getCreatedTime())
|
||||
.eq(Objects.nonNull(schisandraSysOauth.getUpdateTime()), SchisandraSysOauth::getUpdateTime, schisandraSysOauth.getUpdateTime())
|
||||
.eq(Objects.nonNull(schisandraSysOauth.getUpdateBy()), SchisandraSysOauth::getUpdateBy, schisandraSysOauth.getUpdateBy())
|
||||
.eq(Objects.nonNull(schisandraSysOauth.getIsDeleted()), SchisandraSysOauth::getIsDeleted, schisandraSysOauth.getIsDeleted())
|
||||
.eq(Objects.nonNull(schisandraSysOauth.getStatus()), SchisandraSysOauth::getStatus, schisandraSysOauth.getStatus())
|
||||
;
|
||||
return schisandraSysOauthDao.selectOne(queryWrapper);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public SchisandraSysOauth getOauthConfigByType(String type) {
|
||||
return schisandraSysOauthDao.selectOne(new QueryWrapper<SchisandraSysOauth>()
|
||||
.eq("client_type",type)
|
||||
.eq("is_deleted",0));
|
||||
return schisandraSysOauthDao.selectOneByCondition(SchisandraSysOauthTableDef.SCHISANDRA_SYS_OAUTH.CLIENT_TYPE.eq(type));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.schisandra.system.infra.config;
|
||||
|
||||
import com.mybatisflex.core.audit.AuditManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @Classname MyBatisFlexConfiguration
|
||||
* @BelongsProject: schisandra-cloud-storage
|
||||
* @BelongsPackage: com.schisandra.oss.infra.config
|
||||
* @Author: landaiqing
|
||||
* @CreateTime: 2024-05-31 16:14
|
||||
* @Description: Mybatis flex 配置类
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Configuration
|
||||
public class MyBatisFlexConfiguration {
|
||||
private static final Logger logger = LoggerFactory
|
||||
.getLogger("mybatis-flex-sql");
|
||||
|
||||
|
||||
public MyBatisFlexConfiguration() {
|
||||
//开启审计功能
|
||||
AuditManager.setAuditEnable(true);
|
||||
|
||||
//设置 SQL 审计收集器
|
||||
AuditManager.setMessageCollector(auditMessage ->
|
||||
logger.info("{},{}ms", auditMessage.getFullSql()
|
||||
, auditMessage.getElapsedTime())
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -137,6 +137,11 @@
|
||||
<artifactId>lombok-mapstruct-binding</artifactId>
|
||||
<version>0.2.0</version>
|
||||
</path>
|
||||
<path>
|
||||
<groupId>com.mybatis-flex</groupId>
|
||||
<artifactId>mybatis-flex-processor</artifactId>
|
||||
<version>1.9.0</version>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
@@ -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;
|
||||
@@ -13,7 +14,7 @@ import org.springframework.context.annotation.ComponentScan;
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@ComponentScan("com.schisandra")
|
||||
@MapperScan("com.schisandra.**.dao")
|
||||
@MapperScan("com.schisandra.system.**.dao")
|
||||
public class SystemApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SystemApplication.class);
|
||||
|
||||
@@ -52,10 +52,6 @@ spring:
|
||||
publicKey: MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANUVxjcrVoirBZaNmDrUqatHEW4FOHbO5ynW6zvhIbRMo6hEFGgglbURkjuHOlgEduxJVz6Xa+sG+FMrxTguOJECAwEAAQ==
|
||||
logging:
|
||||
config: classpath:log4j2-spring.xml
|
||||
# mybatis-plus日志
|
||||
mybatis-plus:
|
||||
global-config:
|
||||
banner: false
|
||||
############## Sa-Token 配置 (文档: https://sa-token.cc) ##############
|
||||
sa-token:
|
||||
# token 名称(同时也是 cookie 名称)
|
||||
@@ -75,15 +71,17 @@ sa-token:
|
||||
token-prefix: schisandra
|
||||
is-print: false
|
||||
|
||||
feign:
|
||||
client:
|
||||
config:
|
||||
default:
|
||||
connectTimeout: 60000
|
||||
readTimeout: 60000
|
||||
|
||||
ribbon:
|
||||
ConnectTimeout: 60000
|
||||
ReadTimeout: 60000
|
||||
mybatis-flex:
|
||||
global-config:
|
||||
print-banner: false
|
||||
key-config:
|
||||
key-type: auto
|
||||
normal-value-of-logic-delete: 0
|
||||
deleted-value-of-logic-delete: 1
|
||||
logic-delete-column: is_deleted
|
||||
mapper-locations:
|
||||
- "classpath*:/mapper/**/*.xml"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user