feat: 代码生成
This commit is contained in:
@@ -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