master
rong.liu 6 months ago
parent 47757ba059
commit e1015c43a1
  1. 4
      src/main/java/com/huoran/iasf/common/utils/R.java
  2. 111
      src/main/java/com/huoran/iasf/controller/CategoryController.java
  3. 110
      src/main/java/com/huoran/iasf/controller/ProductDetailsController.java
  4. 2
      src/main/java/com/huoran/iasf/controller/SysColumnController.java
  5. 2
      src/main/java/com/huoran/iasf/controller/SysContentController.java
  6. 21
      src/main/java/com/huoran/iasf/controller/SysSubjectSpecialtyController.java
  7. 51
      src/main/java/com/huoran/iasf/entity/Category.java
  8. 93
      src/main/java/com/huoran/iasf/entity/ProductDetails.java
  9. 44
      src/main/java/com/huoran/iasf/entity/SysSubjectSpecialty.java
  10. 16
      src/main/java/com/huoran/iasf/mapper/CategoryMapper.java
  11. 16
      src/main/java/com/huoran/iasf/mapper/ProductDetailsMapper.java
  12. 16
      src/main/java/com/huoran/iasf/mapper/SysProductDetailsMapper.java
  13. 16
      src/main/java/com/huoran/iasf/mapper/SysSubjectSpecialtyMapper.java
  14. 5
      src/main/java/com/huoran/iasf/mapper/xml/CategoryMapper.xml
  15. 5
      src/main/java/com/huoran/iasf/mapper/xml/ProductDetailsMapper.xml
  16. 5
      src/main/java/com/huoran/iasf/mapper/xml/SysProductDetailsMapper.xml
  17. 5
      src/main/java/com/huoran/iasf/mapper/xml/SysSubjectSpecialtyMapper.xml
  18. 19
      src/main/java/com/huoran/iasf/service/SysCategoryService.java
  19. 19
      src/main/java/com/huoran/iasf/service/SysProductDetailsService.java
  20. 17
      src/main/java/com/huoran/iasf/service/SysSubjectSpecialtyService.java
  21. 40
      src/main/java/com/huoran/iasf/service/impl/CategoryServiceImpl.java
  22. 37
      src/main/java/com/huoran/iasf/service/impl/SysProductDetailsServiceImpl.java
  23. 27
      src/main/java/com/huoran/iasf/service/impl/SysSubjectSpecialtyServiceImpl.java
  24. 18
      src/main/resources/application-prod.yml
  25. 4
      src/test/java/com/company/project/CodeGenerator.java

@ -128,5 +128,7 @@ public class R {
} }
public static R result(boolean delState, String s) {
return delState ? success(s) : fail(s);
}
} }

@ -0,0 +1,111 @@
package com.huoran.iasf.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huoran.iasf.common.exception.BusinessException;
import com.huoran.iasf.common.exception.code.BaseResponseCode;
import com.huoran.iasf.common.utils.R;
import com.huoran.iasf.entity.Category;
import com.huoran.iasf.service.SysCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 产品与课程分类表控制类
* 提供分类管理相关接口
*
* @author Rong
* @date 2024-06-12
*/
@RestController
@RequestMapping("/categoryService/Category")
@Api(value = "产品与课程分类管理接口", tags = "A-产品与课程分类管理")
public class CategoryController {
@Autowired
private SysCategoryService service;
/**
* 保存或更新分类信息
*
* @param category 分类对象
* @return 操作结果
*/
@PostMapping("/saveOrUpdate")
@ApiOperation("保存或更新分类")
@Transactional(rollbackFor = Exception.class)
public R saveOrUpdate(@RequestBody @Validated Category category) {
try {
// 增加重复检查逻辑
boolean isDuplicate = false;
if (category.getCategoryId() != null) {
// 更新逻辑,排除当前记录自身
isDuplicate = service.existsOtherByName(category.getName(), category.getCategoryId());
} else {
// 新增逻辑,直接检查名称是否存在
isDuplicate = service.existsByName(category.getName());
}
if (isDuplicate) {
return R.fail("分类名称已存在,请检查后重新提交");
}
boolean operationResult = service.saveOrUpdate(category);
return R.result(operationResult, operationResult ? "操作成功" : "操作失败");
} catch (Exception e) {
throw new BusinessException(BaseResponseCode.SYSTEM_BUSY);
}
}
/**
* 获取分类列表支持类型筛选
*
* @param type 类型标识"course""product"
* @return 分类列表
*/
@PostMapping("/list")
@ApiOperation("根据类型获取分类列表")
public R categoryList(@ApiParam(value = "类型标识,区分课程或产品", allowableValues = "0:课程,1:产品") @RequestParam(required = false) Integer type) {
QueryWrapper<Category> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type);
List<Category> categories = service.list(queryWrapper);
return R.success(categories);
}
/**
* 查询分类详情
*
* @param id 分类ID
* @return 分类详情
*/
@PostMapping("/findById")
@ApiOperation("根据ID查询分类详情")
public R findById(@ApiParam(name = "id", value = "分类ID", required = true) @RequestParam Integer id) {
Category category = service.getById(id);
return R.success(category);
}
/**
* 批量删除分类
*
* @param ids 分类ID列表
* @return 操作结果
*/
@PostMapping("/batchDelete")
@ApiOperation("批量删除分类")
public R batchDeletion(@RequestBody List<Integer> ids) {
if (ids == null || ids.isEmpty()) {
return R.fail("请选择要删除的分类");
}
boolean delState = service.removeByIds(ids);
return R.result(delState, delState ? "批量删除成功" : "批量删除失败");
}
}

@ -0,0 +1,110 @@
package com.huoran.iasf.controller;
import com.huoran.iasf.common.exception.BusinessException;
import com.huoran.iasf.common.exception.code.BaseResponseCode;
import com.huoran.iasf.common.utils.R;
import com.huoran.iasf.entity.ProductDetails;
import com.huoran.iasf.service.SysProductDetailsService;
import com.huoran.iasf.service.SysSubjectSpecialtyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 综合产品与课程详情信息表控制类
*/
@RestController
@RequestMapping("/productDetails")
@Api(value = "A-综合产品与课程详情", tags = "A-综合产品与课程详情")
@Slf4j
public class ProductDetailsController {
@Autowired
private SysProductDetailsService service;
@Autowired
private SysSubjectSpecialtyService subjectSpecialtyService;
/**
* 保存或更新综合产品与课程详情信息
* 根据实体中的ID判断是保存还是更新
*
* @param productDetails 要保存或更新的实体
* @return 操作结果
*/
@PostMapping("/saveOrUpdate")
@ApiOperation("保存或更新综合产品与课程详情信息")
@Transactional(rollbackFor = Exception.class)
public R saveOrUpdate(@RequestBody @Validated ProductDetails productDetails) {
try {
// 增加重复检查逻辑
boolean isDuplicate = false;
if (productDetails.getId() != null) {
// 更新逻辑,排除当前记录自身
isDuplicate = service.existsOtherByProductName(productDetails.getName(), productDetails.getId());
} else {
// 新增逻辑,直接检查名称是否存在
isDuplicate = service.existsByProductName(productDetails.getName());
}
if (isDuplicate) {
return R.fail("名称已存在,请检查后重新提交");
}
boolean addState = service.saveOrUpdate(productDetails);
if (addState && productDetails.getSubjectSpecialtyList() != null && !productDetails.getSubjectSpecialtyList().isEmpty()) {
// 确保每个subjectSpecialty都关联到正确的templateDetailsId
productDetails.getSubjectSpecialtyList().forEach(subjectSpecialty -> subjectSpecialty.setTemplateDetailsId(productDetails.getId()));
subjectSpecialtyService.removeByTemplateDetailsId(productDetails.getId());
subjectSpecialtyService.saveBatch(productDetails.getSubjectSpecialtyList());
}
return R.result(addState, addState ? "操作成功" : "操作失败");
} catch (Exception e) {
log.error("保存或更新产品详情时发生错误", e);
throw new BusinessException(BaseResponseCode.SYSTEM_BUSY);
}
}
/**
* 根据ID查询详情
*
* @param id 主键ID
* @return 查询结果
*/
@PostMapping("/findById")
@ApiOperation("根据ID查询详情")
public R findById(@RequestParam("id") Integer id) {
ProductDetails productDetails = service.getById(id);
return R.success(productDetails);
}
/**
* 批量删除记录
*
* @param ids 主键ID列表
* @return 操作结果
*/
@PostMapping("/batchDelete")
@ApiOperation("批量删除记录")
public R batchDelete(@RequestBody List<Integer> ids) {
if (ids == null || ids.isEmpty()) {
return R.fail("请选择要删除的记录");
}
boolean delState = service.removeByIds(ids);
return R.result(delState, delState ? "批量删除成功" : "批量删除失败");
}
}

@ -154,7 +154,7 @@ public class SysColumnController {
// 检查缓存数据是否存在。 // 检查缓存数据是否存在。
if (cachedFieldsObj == null) { if (cachedFieldsObj == null) {
return null; return R.success();
} }
// 检查缓存数据类型是否为String。 // 检查缓存数据类型是否为String。

@ -277,7 +277,7 @@ public class SysContentController {
Object cachedFieldsObj = redisTemplate.opsForValue().get(key); Object cachedFieldsObj = redisTemplate.opsForValue().get(key);
if (cachedFieldsObj == null) { if (cachedFieldsObj == null) {
return null; return R.success();
} }
if (!(cachedFieldsObj instanceof String)) { if (!(cachedFieldsObj instanceof String)) {

@ -0,0 +1,21 @@
package com.huoran.iasf.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 适用学科专业配置 前端控制器
* </p>
*
* @author cheney
* @since 2024-06-13
*/
@RestController
@RequestMapping("//sys-subject-specialty")
public class SysSubjectSpecialtyController {
}

@ -0,0 +1,51 @@
package com.huoran.iasf.entity;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
* 产品与课程分类表
* </p>
*
* @author cheney
* @since 2024-06-12
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("sys_category")
@ApiModel(value = "Category对象", description = "产品与课程分类表")
public class Category implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "分类ID")
@TableId(value = "category_id", type = IdType.AUTO)
private Integer categoryId;
@ApiModelProperty(value = "分类名称")
private String name;
@ApiModelProperty(value = "类型标识,区分是课程还是产品)0:课程,1:产品(0:课程,1:产品)")
private Integer type;
@ApiModelProperty(value = "分类描述")
private String description;
@ApiModelProperty(value = "创建时间")
@TableField(fill = FieldFill.INSERT)
private Date createTime;
@ApiModelProperty(value = "更新时间")
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
}

@ -0,0 +1,93 @@
package com.huoran.iasf.entity;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @描述综合产品与课程详情信息表
* @作者: Rong
* @日期: 2024-06-13
*/
@Data
@ApiModel(value = "综合产品与课程详情信息表")
@TableName("sys_product_details")
public class ProductDetails implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "主键ID")
private Integer id;
@ApiModelProperty(value = "模板ID")
private Integer templateId;
@ApiModelProperty(value = "名称,课程或产品的名称,根据类型区分")
private String name;
@ApiModelProperty(value = "类型标识,区分是课程还是产品")
private String type;
@ApiModelProperty(value = "课程分类id或产品分类id,根据类型使用")
private String categoryId;
@ApiModelProperty(value = "产品分类标签id,根据类型区分使用")
private String classificationTagId;
@ApiModelProperty(value = "封面图片URL,课程封面或产品封面")
private String coverImageUrl;
@ApiModelProperty(value = "来源信息,仅课程详情使用,可为空")
private String source;
@ApiModelProperty(value = "按钮跳转名称")
private String jumpButtonName;
@ApiModelProperty(value = "按钮跳转链接")
private String jumpLinkUrl;
@ApiModelProperty(value = "简介,课程介绍或产品简介,根据类型区分使用")
private String introduction;
@ApiModelProperty(value = "详细描述,课程或产品的详细说明")
private String detailedDescription;
@ApiModelProperty(value = "发布状态,0草稿,1已发布")
private Boolean publishStatus;
@ApiModelProperty(value = "创建时间")
@TableField(fill = FieldFill.INSERT)
private Date createTime;
@ApiModelProperty(value = "更新时间")
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
@ApiModelProperty(value = "是否删除(1未删除;0已删除)")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "课程类型,仅课程使用,可为空")
private String courseType;
@ApiModelProperty(value = "匹配课程,仅产品使用,可存储课程ID列表")
private String matchedCourses;
@ApiModelProperty(value = "预计课时,仅产品使用,可为空")
private Integer estimatedHours;
@ApiModelProperty(value = "适用场景,仅产品使用,可为空")
private String applicableScenarios;
@ApiModelProperty(value = "学科专业类")
@TableField(exist = false)
private List<SysSubjectSpecialty> subjectSpecialtyList;
}

@ -0,0 +1,44 @@
package com.huoran.iasf.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
* <p>
* 适用学科专业配置
* </p>
*
* @author cheney
* @since 2024-06-13
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "SysSubjectSpecialty对象", description = "适用学科专业配置")
public class SysSubjectSpecialty implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "模板详情id")
private Integer templateDetailsId;
@ApiModelProperty(value = "学科类别id,仅产品使用,可为空")
private Integer subjectCategoryId;
@ApiModelProperty(value = "专业类别id,仅产品使用,可为空")
private Integer professionalCategoryId;
@ApiModelProperty(value = "专业id,仅产品使用,可为空")
private Integer majorId;
}

@ -0,0 +1,16 @@
package com.huoran.iasf.mapper;
import com.huoran.iasf.entity.Category;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 产品与课程分类表 Mapper 接口
* </p>
*
* @author cheney
* @since 2024-06-12
*/
public interface CategoryMapper extends BaseMapper<Category> {
}

@ -0,0 +1,16 @@
package com.huoran.iasf.mapper;
import com.huoran.iasf.entity.ProductDetails;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 综合产品与课程详情信息表 Mapper 接口
* </p>
*
* @author cheney
* @since 2024-06-12
*/
public interface ProductDetailsMapper extends BaseMapper<ProductDetails> {
}

@ -0,0 +1,16 @@
package com.huoran.iasf.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huoran.iasf.entity.ProductDetails;
/**
* <p>
* 综合产品与课程详情信息表 Mapper 接口
* </p>
*
* @author cheney
* @since 2024-06-12
*/
public interface SysProductDetailsMapper extends BaseMapper<ProductDetails> {
}

@ -0,0 +1,16 @@
package com.huoran.iasf.mapper;
import com.huoran.iasf.entity.SysSubjectSpecialty;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 适用学科专业配置 Mapper 接口
* </p>
*
* @author cheney
* @since 2024-06-13
*/
public interface SysSubjectSpecialtyMapper extends BaseMapper<SysSubjectSpecialty> {
}

@ -0,0 +1,5 @@
<?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.huoran.iasf.mapper.CategoryMapper">
</mapper>

@ -0,0 +1,5 @@
<?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.huoran.iasf.mapper.ProductDetailsMapper">
</mapper>

@ -0,0 +1,5 @@
<?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.huoran.iasf.mapper.SysProductDetailsMapper">
</mapper>

@ -0,0 +1,5 @@
<?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.huoran.iasf.mapper.SysSubjectSpecialtyMapper">
</mapper>

@ -0,0 +1,19 @@
package com.huoran.iasf.service;
import com.huoran.iasf.entity.Category;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 产品与课程分类表 服务类
* </p>
*
* @author cheney
* @since 2024-06-12
*/
public interface SysCategoryService extends IService<Category> {
boolean existsOtherByName(String name, Integer categoryId);
boolean existsByName(String name);
}

@ -0,0 +1,19 @@
package com.huoran.iasf.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.huoran.iasf.entity.ProductDetails;
/**
* <p>
* 综合产品与课程详情信息表 服务类
* </p>
*
* @author cheney
* @since 2024-06-12
*/
public interface SysProductDetailsService extends IService<ProductDetails> {
boolean existsByProductName(String name);
boolean existsOtherByProductName(String name, Integer currentId);
}

@ -0,0 +1,17 @@
package com.huoran.iasf.service;
import com.huoran.iasf.entity.SysSubjectSpecialty;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 适用学科专业配置 服务类
* </p>
*
* @author cheney
* @since 2024-06-13
*/
public interface SysSubjectSpecialtyService extends IService<SysSubjectSpecialty> {
void removeByTemplateDetailsId(Integer id);
}

@ -0,0 +1,40 @@
package com.huoran.iasf.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huoran.iasf.entity.Category;
import com.huoran.iasf.mapper.CategoryMapper;
import com.huoran.iasf.service.SysCategoryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 产品与课程分类表 服务实现类
* </p>
*
* @author cheney
* @since 2024-06-12
*/
@Service
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> implements SysCategoryService {
@Override
public boolean existsOtherByName(String name, Integer categoryId) {
QueryWrapper<Category> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("name", name);
if (categoryId != null) {
queryWrapper.ne("category_id", categoryId);
}
return false;
}
@Override
public boolean existsByName(String name) {
QueryWrapper<Category> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("name", name);
if (baseMapper.selectCount(queryWrapper) > 0) {
return true;
}
return false;
}
}

@ -0,0 +1,37 @@
package com.huoran.iasf.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huoran.iasf.entity.ProductDetails;
import com.huoran.iasf.mapper.SysProductDetailsMapper;
import com.huoran.iasf.service.SysProductDetailsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 综合产品与课程详情信息表 服务实现类
* </p>
*
* @author cheney
* @since 2024-06-12
*/
@Service
public class SysProductDetailsServiceImpl extends ServiceImpl<SysProductDetailsMapper, ProductDetails> implements SysProductDetailsService {
@Override
public boolean existsByProductName(String name) {
if (this.count(new QueryWrapper<ProductDetails>().eq("product_name", name)) > 0) {
return true;
}
return false;
}
@Override
public boolean existsOtherByProductName(String name, Integer currentId) {
if (this.count(new QueryWrapper<ProductDetails>().eq("product_name", name).ne("id", currentId)) > 0) {
return true;
}
return false;
}
}

@ -0,0 +1,27 @@
package com.huoran.iasf.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huoran.iasf.entity.SysSubjectSpecialty;
import com.huoran.iasf.mapper.SysSubjectSpecialtyMapper;
import com.huoran.iasf.service.SysSubjectSpecialtyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 适用学科专业配置 服务实现类
* </p>
*
* @author cheney
* @since 2024-06-13
*/
@Service
public class SysSubjectSpecialtyServiceImpl extends ServiceImpl<SysSubjectSpecialtyMapper, SysSubjectSpecialty> implements SysSubjectSpecialtyService {
@Override
public void removeByTemplateDetailsId(Integer id) {
QueryWrapper<SysSubjectSpecialty> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("template_details_id", id);
this.remove(queryWrapper);
}
}

@ -1,4 +1,4 @@
# 生产环境配置 # 开发环境配置
spring: spring:
datasource: datasource:
dynamic: dynamic:
@ -8,11 +8,9 @@ spring:
username: root username: root
password: HuoRan@2021 password: HuoRan@2021
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://139.9.47.170:3306/iasf?serverTimezone=GMT%2B8 url: jdbc:mysql://139.9.47.170:3306/iasf?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=GMT%2b8
cache:
type: redis
redis: redis:
host: 127.0.0.1 # Redis服务器地址 host: localhost # Redis服务器地址
database: 0 # Redis数据库索引(默认为0) database: 0 # Redis数据库索引(默认为0)
port: 6379 # Redis服务器连接端口 port: 6379 # Redis服务器连接端口
password: HuoRan@2021 # Redis服务器连接密码(默认为空) password: HuoRan@2021 # Redis服务器连接密码(默认为空)
@ -22,18 +20,10 @@ spring:
max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
max-idle: 8 # 连接池中的最大空闲连接 max-idle: 8 # 连接池中的最大空闲连接
min-idle: 0 # 连接池中的最小空闲连接 min-idle: 0 # 连接池中的最小空闲连接
timeout: 3000ms # 连接超时时间(毫秒) timeout: 3000ms # 连接超时时间(毫秒
singleServerConfig:
address: "redis://127.0.0.1:6379"
password: HuoRan@2021
file: file:
#文件上传目录 绝对路径 末尾请加 / linux #文件上传目录 绝对路径 末尾请加 / linux
path: /usr/local/huoran/huorantech_website/files/ path: /usr/local/huoran/huorantech_website/files/
#文件预览url #文件预览url
url: /iasf/sysFiles/preview/ url: /iasf/sysFiles/preview/
ip: https://huorantech.com ip: https://huorantech.com
knife4j:
production: true #生成环境禁用查看文档

@ -61,9 +61,9 @@ public class CodeGenerator {
// 5、策略配置 // 5、策略配置
StrategyConfig strategy = new StrategyConfig(); StrategyConfig strategy = new StrategyConfig();
strategy.setInclude("sys_footer_setup","sys_footer_setup_scope_of_application"); strategy.setInclude("sys_subject_specialty");
strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略 strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略
// strategy.setTablePrefix("sys_"); //生成实体时去掉表前缀 //strategy.setTablePrefix("sys_"); //生成实体时去掉表前缀
strategy.setColumnNaming(NamingStrategy.underline_to_camel);//数据库表字段映射到实体的命名策略 strategy.setColumnNaming(NamingStrategy.underline_to_camel);//数据库表字段映射到实体的命名策略
strategy.setEntityLombokModel(true); // lombok 模型 @Accessors(chain = true) setter链式操作 strategy.setEntityLombokModel(true); // lombok 模型 @Accessors(chain = true) setter链式操作

Loading…
Cancel
Save