parent
b24e8f50b8
commit
15687cad80
|
@ -29,7 +29,12 @@
|
|||
<groupId>org.jeecgframework</groupId>
|
||||
<artifactId>weixin4j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 接口 模块 -->
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nursing-unit-api</artifactId>
|
||||
<version>${nursingunit.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -0,0 +1,156 @@
|
|||
package com.nu.modules.appversionconfig.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.modules.appversionconfig.entity.AppVersionConfig;
|
||||
import com.nu.modules.appversionconfig.service.IAppVersionConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @Description: app版本记录
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="app版本记录")
|
||||
@RestController
|
||||
@RequestMapping("/appVersionConfig/appVersionConfig")
|
||||
@Slf4j
|
||||
public class AppVersionConfigController extends JeecgController<AppVersionConfig, IAppVersionConfigService> {
|
||||
@Autowired
|
||||
private IAppVersionConfigService appVersionConfigService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param appVersionConfig
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "app版本记录-分页列表查询")
|
||||
@ApiOperation(value="app版本记录-分页列表查询", notes="app版本记录-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<AppVersionConfig>> queryPageList(AppVersionConfig appVersionConfig,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<AppVersionConfig> queryWrapper = QueryGenerator.initQueryWrapper(appVersionConfig, req.getParameterMap());
|
||||
Page<AppVersionConfig> page = new Page<AppVersionConfig>(pageNo, pageSize);
|
||||
IPage<AppVersionConfig> pageList = appVersionConfigService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param appVersionConfig
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "app版本记录-添加")
|
||||
@ApiOperation(value="app版本记录-添加", notes="app版本记录-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody AppVersionConfig appVersionConfig) {
|
||||
appVersionConfigService.save(appVersionConfig);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param appVersionConfig
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "app版本记录-编辑")
|
||||
@ApiOperation(value="app版本记录-编辑", notes="app版本记录-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody AppVersionConfig appVersionConfig) {
|
||||
appVersionConfigService.updateById(appVersionConfig);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "app版本记录-通过id删除")
|
||||
@ApiOperation(value="app版本记录-通过id删除", notes="app版本记录-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
appVersionConfigService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "app版本记录-批量删除")
|
||||
@ApiOperation(value="app版本记录-批量删除", notes="app版本记录-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.appVersionConfigService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "app版本记录-通过id查询")
|
||||
@ApiOperation(value="app版本记录-通过id查询", notes="app版本记录-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<AppVersionConfig> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
AppVersionConfig appVersionConfig = appVersionConfigService.getById(id);
|
||||
if(appVersionConfig==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(appVersionConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param appVersionConfig
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, AppVersionConfig appVersionConfig) {
|
||||
return super.exportXls(request, appVersionConfig, AppVersionConfig.class, "app版本记录");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, AppVersionConfig.class);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
package com.nu.modules.appversionconfig.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: app版本记录
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_app_version_config")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_app_version_config对象", description="app版本记录")
|
||||
public class AppVersionConfig implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private Integer id;
|
||||
/**版本号*/
|
||||
@Excel(name = "版本号", width = 15)
|
||||
@ApiModelProperty(value = "版本号")
|
||||
private String versionCode;
|
||||
/**下载地址*/
|
||||
@Excel(name = "下载地址", width = 15)
|
||||
@ApiModelProperty(value = "下载地址")
|
||||
private String versionUrl;
|
||||
/**更新说明*/
|
||||
@Excel(name = "更新说明", width = 15)
|
||||
@ApiModelProperty(value = "更新说明")
|
||||
private String updateTrips;
|
||||
/**是否强制更新 0-否 1-是*/
|
||||
@Excel(name = "是否强制更新 0-否 1-是", width = 15)
|
||||
@ApiModelProperty(value = "是否强制更新 0-否 1-是")
|
||||
private Integer isForceUpdate;
|
||||
/**创建者*/
|
||||
@ApiModelProperty(value = "创建者")
|
||||
private String createBy;
|
||||
/**创建时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
/**更新者*/
|
||||
@ApiModelProperty(value = "更新者")
|
||||
private String updateBy;
|
||||
/**更新时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
/**状态 0-不可用 1-可用*/
|
||||
@Excel(name = "状态 0-不可用 1-可用", width = 15)
|
||||
@ApiModelProperty(value = "状态 0-不可用 1-可用")
|
||||
private Integer status;
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.nu.modules.appversionconfig.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nu.modules.appversionconfig.entity.AppVersionConfig;
|
||||
import com.nu.modules.pad.appversionconfig.entity.AppConfig;
|
||||
|
||||
/**
|
||||
* @Description: app版本记录
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface AppVersionConfigMapper extends BaseMapper<AppVersionConfig> {
|
||||
AppVersionConfig findLastVersionInfo();
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
<?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.nu.modules.appversionconfig.mapper.AppVersionConfigMapper">
|
||||
|
||||
<!--查询最新版本-->
|
||||
<select id="findLastVersionInfo" resultType="com.nu.modules.appversionconfig.entity.AppVersionConfig">
|
||||
select * from nu_app_version_config where status = 1 order by create_time desc limit 1
|
||||
</select>
|
||||
</mapper>
|
|
@ -0,0 +1,14 @@
|
|||
package com.nu.modules.appversionconfig.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.appversionconfig.entity.AppVersionConfig;
|
||||
|
||||
/**
|
||||
* @Description: app版本记录
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IAppVersionConfigService extends IService<AppVersionConfig> {
|
||||
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.nu.modules.appversionconfig.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.appversionconfig.entity.AppVersionConfig;
|
||||
import com.nu.modules.appversionconfig.mapper.AppVersionConfigMapper;
|
||||
import com.nu.modules.appversionconfig.service.IAppVersionConfigService;
|
||||
import com.nu.modules.pad.appversionconfig.entity.AppConfig;
|
||||
import com.nu.modules.pad.appversionconfig.service.IAppConfigService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Description: app版本记录
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class AppVersionConfigApiServiceImpl extends ServiceImpl<AppVersionConfigMapper, AppVersionConfig> implements IAppConfigService {
|
||||
|
||||
@Autowired
|
||||
private AppVersionConfigMapper mapper;
|
||||
|
||||
@Override
|
||||
public AppConfig findLastVersionInfo() {
|
||||
AppVersionConfig lastVersionInfo = mapper.findLastVersionInfo();
|
||||
AppConfig appConfig = new AppConfig();
|
||||
BeanUtils.copyProperties(lastVersionInfo,appConfig);
|
||||
return appConfig;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.nu.modules.appversionconfig.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.appversionconfig.entity.AppVersionConfig;
|
||||
import com.nu.modules.appversionconfig.mapper.AppVersionConfigMapper;
|
||||
import com.nu.modules.appversionconfig.service.IAppVersionConfigService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Description: app版本记录
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class AppVersionConfigServiceImpl extends ServiceImpl<AppVersionConfigMapper, AppVersionConfig> implements IAppVersionConfigService {
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nursing-unit-parent</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</parent>
|
||||
<description>接口模块</description>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>nursing-unit-api</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nursing-unit-base-core</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,73 @@
|
|||
package com.nu.modules.pad.appversionconfig.api;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.nu.modules.pad.appversionconfig.entity.AppConfig;
|
||||
import com.nu.modules.pad.appversionconfig.entity.R;
|
||||
import com.nu.modules.pad.appversionconfig.entity.VersionInfo;
|
||||
import com.nu.modules.pad.appversionconfig.service.IAppConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/pad")
|
||||
@CrossOrigin("*")
|
||||
public class VersionUpdateApi {
|
||||
|
||||
@Autowired
|
||||
private IAppConfigService appConfigService;
|
||||
/**
|
||||
* APP版本更新
|
||||
* 请求参数中其实不止传递了一下四个,更多请看插件市场作者的文档,https://ext.dcloud.net.cn/plugin?id=3931
|
||||
* @param platform 平台(android/ios)
|
||||
* @param name 应用名称
|
||||
* @param version 应用版本名称 主版本号.次版本号.修订号
|
||||
* @param code 应用版本号
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/versionUpdate")
|
||||
public R check(String platform,String name,String version,String code) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
VersionInfo info = new VersionInfo();
|
||||
info.setUpdate_flag(0);
|
||||
map.put("code", 100);
|
||||
map.put("data", info);
|
||||
AppConfig appConfig = appConfigService.findLastVersionInfo();
|
||||
if(appConfig ==null) {
|
||||
map.put("msg", "无版本配置信息");
|
||||
return R.ok(map);
|
||||
}
|
||||
if(!StrUtil.isEmptyIfStr(version) && !StrUtil.isEmptyIfStr(platform)) {
|
||||
int[] oldVers = StrUtil.splitToInt(version, ".");
|
||||
int[] newVers = StrUtil.splitToInt(appConfig.getVersionCode(), ".");
|
||||
boolean isUpdateFlag = false;
|
||||
int length = oldVers.length > newVers.length ? newVers.length : oldVers.length;
|
||||
for (int i = 0; i < length; i++) {
|
||||
if(newVers[i] > oldVers[i]) {
|
||||
isUpdateFlag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(isUpdateFlag) {
|
||||
info.setUpdate_flag(1);//0:不需要更新,1:需要更新
|
||||
info.setVersion(appConfig.getVersionCode());
|
||||
info.setUpdate_url(appConfig.getVersionUrl());
|
||||
info.setUpdate_tips(appConfig.getUpdateTrips());
|
||||
info.setForceupdate(appConfig.getIsForceUpdate());
|
||||
map.put("code", 100);
|
||||
map.put("msg", "应用程序需要更新");
|
||||
map.put("data", info);
|
||||
}
|
||||
return R.ok(map);
|
||||
}else {
|
||||
map.put("code", 500);
|
||||
map.put("msg", "请求参数不含版本号、平台");
|
||||
map.put("data", info);
|
||||
return R.ok(map);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.nu.modules.pad.appversionconfig.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class AppConfig {
|
||||
|
||||
private int id;//唯一标识
|
||||
private String versionCode;//版本号
|
||||
private String versionUrl;//下载地址
|
||||
private String updateTrips;//更新说明
|
||||
private int isForceUpdate;//是否强制更新 0:否,1:是
|
||||
private String createBy;//创建者
|
||||
private Date createTime;//创建时间
|
||||
private String updateBy;//更新者
|
||||
private Date updateTime;//更新时间
|
||||
private int status;//状态 0:不可以,1:可用
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package com.nu.modules.pad.appversionconfig.entity;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class R extends HashMap<String, Object> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public R() {
|
||||
put("code", 0);
|
||||
}
|
||||
|
||||
public static R error() {
|
||||
return error(500, "未知异常,请联系管理员");
|
||||
}
|
||||
|
||||
public static R error(String msg) {
|
||||
return error(500, msg);
|
||||
}
|
||||
|
||||
public static R error(int code, String msg) {
|
||||
R r = new R();
|
||||
r.put("code", code);
|
||||
r.put("msg", msg);
|
||||
return r;
|
||||
}
|
||||
|
||||
public static R ok(String msg) {
|
||||
R r = new R();
|
||||
r.put("msg", msg);
|
||||
return r;
|
||||
}
|
||||
|
||||
public static R ok(Map<String, Object> map) {
|
||||
R r = new R();
|
||||
r.putAll(map);
|
||||
return r;
|
||||
}
|
||||
|
||||
public static R ok() {
|
||||
return new R();
|
||||
}
|
||||
|
||||
@Override
|
||||
public R put(String key, Object value) {
|
||||
super.put(key, value);
|
||||
return this;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.nu.modules.pad.appversionconfig.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 该实体是基于uniapp插件市场,APP版本升级插件所要求的响应格式定义的参数
|
||||
* 插件地址:https://ext.dcloud.net.cn/plugin?id=3931
|
||||
*/
|
||||
@Data
|
||||
public class VersionInfo {
|
||||
private int update_flag;// 0 不需要升级,1 需要升级
|
||||
private String update_url;//升级安装包或 appstore 地址,注意是全路径
|
||||
private int forceupdate;//0 不强制,1 强制升级(这个字段以后可能会优化到 update_flag 里)
|
||||
private String update_tips;//升级说明,不用我提醒大家换行应该用\n 了吧?
|
||||
private String version;//当前最新的版本
|
||||
private int size;//备用吧,有些服务器启用了 gzip 或者直接返回流数据,会造成客户端获取不到安装包大小,进度条将会失效。用这个字段来计算进度。单位是字节。
|
||||
private int wgt_flag;//1.0.3后新增参数,1为增量升级,0为非增量升级
|
||||
private String wgt_url;//1.0.3后新增参数,如果wgt_flag=1,则这个参数就是增量包的地址,注意是全路径
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package com.nu.modules.pad.appversionconfig.service;
|
||||
|
||||
import com.nu.modules.pad.appversionconfig.entity.AppConfig;
|
||||
|
||||
public interface IAppConfigService {
|
||||
public AppConfig findLastVersionInfo();
|
||||
}
|
|
@ -108,7 +108,7 @@ public class ShiroConfig {
|
|||
filterChainDefinitionMap.put("/sys/getLoginQrcode/**", "anon"); //登录二维码
|
||||
filterChainDefinitionMap.put("/sys/getQrcodeToken/**", "anon"); //监听扫码
|
||||
filterChainDefinitionMap.put("/sys/checkAuth", "anon"); //授权接口排除
|
||||
filterChainDefinitionMap.put("/dictType/dictType/abc", "anon");//TODO 待删除
|
||||
filterChainDefinitionMap.put("/api/pad/versionUpdate", "anon");//pad端版本检测接口
|
||||
|
||||
//update-begin--Author:scott Date:20221116 for:排除静态资源后缀
|
||||
filterChainDefinitionMap.put("/", "anon");
|
||||
|
|
|
@ -48,7 +48,12 @@
|
|||
<artifactId>nu-service-directive-biz</artifactId>
|
||||
<version>${nursingunit.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 接口 模块 -->
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nursing-unit-api</artifactId>
|
||||
<version>${nursingunit.version}</version>
|
||||
</dependency>
|
||||
<!-- flyway 数据库自动升级 -->
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
|
|
|
@ -45,8 +45,8 @@ spring:
|
|||
clean-disabled: true
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 10MB
|
||||
max-request-size: 10MB
|
||||
max-file-size: 100MB
|
||||
max-request-size: 100MB
|
||||
mail:
|
||||
# 定时任务发送邮件
|
||||
timeJobSend: false
|
||||
|
|
|
@ -0,0 +1,339 @@
|
|||
server:
|
||||
port: 8080
|
||||
tomcat:
|
||||
max-swallow-size: -1
|
||||
error:
|
||||
include-exception: true
|
||||
include-stacktrace: ALWAYS
|
||||
include-message: ALWAYS
|
||||
servlet:
|
||||
context-path: /nursing-unit
|
||||
compression:
|
||||
enabled: true
|
||||
min-response-size: 1024
|
||||
mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: metrics,jeecghttptrace
|
||||
|
||||
spring:
|
||||
# flyway配置
|
||||
flyway:
|
||||
# 是否启用flyway
|
||||
enabled: false
|
||||
# 编码格式,默认UTF-8
|
||||
encoding: UTF-8
|
||||
# 迁移sql脚本文件存放路径,官方默认db/migration
|
||||
locations: classpath:flyway/sql/mysql
|
||||
# 迁移sql脚本文件名称的前缀,默认V
|
||||
sql-migration-prefix: V
|
||||
# 迁移sql脚本文件名称的分隔符,默认2个下划线__
|
||||
sql-migration-separator: __
|
||||
# 避免带${}sql执行失败
|
||||
placeholder-prefix: '#('
|
||||
placeholder-suffix: )
|
||||
# 迁移sql脚本文件名称的后缀
|
||||
sql-migration-suffixes: .sql
|
||||
# 迁移时是否进行校验,默认true
|
||||
validate-on-migrate: true
|
||||
# 当迁移发现数据库非空且存在没有元数据的表时,自动执行基准迁移,新建schema_version表
|
||||
baseline-on-migrate: true
|
||||
# 是否关闭要清除已有库下的表功能,生产环境必须为true,否则会删库,非常重要!!!
|
||||
clean-disabled: true
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 10MB
|
||||
max-request-size: 10MB
|
||||
mail:
|
||||
# 定时任务发送邮件
|
||||
timeJobSend: false
|
||||
host: smtp.163.com
|
||||
username: jeecgos@163.com
|
||||
password: ??
|
||||
properties:
|
||||
mail:
|
||||
smtp:
|
||||
auth: true
|
||||
starttls:
|
||||
enable: true
|
||||
required: true
|
||||
## quartz定时任务,采用数据库方式
|
||||
quartz:
|
||||
job-store-type: jdbc
|
||||
initialize-schema: embedded
|
||||
#定时任务启动开关,true-开 false-关
|
||||
auto-startup: true
|
||||
#延迟1秒启动定时任务
|
||||
startup-delay: 1s
|
||||
#启动时更新己存在的Job
|
||||
overwrite-existing-jobs: true
|
||||
properties:
|
||||
org:
|
||||
quartz:
|
||||
scheduler:
|
||||
instanceName: MyScheduler
|
||||
instanceId: AUTO
|
||||
jobStore:
|
||||
class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
|
||||
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
|
||||
tablePrefix: QRTZ_
|
||||
isClustered: true
|
||||
misfireThreshold: 12000
|
||||
clusterCheckinInterval: 15000
|
||||
threadPool:
|
||||
class: org.quartz.simpl.SimpleThreadPool
|
||||
threadCount: 10
|
||||
threadPriority: 5
|
||||
threadsInheritContextClassLoaderOfInitializingThread: true
|
||||
#json 时间戳统一转换
|
||||
jackson:
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
time-zone: GMT+8
|
||||
jpa:
|
||||
open-in-view: false
|
||||
aop:
|
||||
proxy-target-class: true
|
||||
#配置freemarker
|
||||
freemarker:
|
||||
# 设置模板后缀名
|
||||
suffix: .ftl
|
||||
# 设置文档类型
|
||||
content-type: text/html
|
||||
# 设置页面编码格式
|
||||
charset: UTF-8
|
||||
# 设置页面缓存
|
||||
cache: false
|
||||
prefer-file-system-access: false
|
||||
# 设置ftl文件路径
|
||||
template-loader-path:
|
||||
- classpath:/templates
|
||||
template_update_delay: 0
|
||||
# 设置静态文件路径,js,css等
|
||||
mvc:
|
||||
static-path-pattern: /**
|
||||
#Spring Boot 2.6+后映射匹配的默认策略已从AntPathMatcher更改为PathPatternParser,需要手动指定为ant-path-matcher
|
||||
pathmatch:
|
||||
matching-strategy: ant_path_matcher
|
||||
resource:
|
||||
static-locations: classpath:/static/,classpath:/public/
|
||||
autoconfigure:
|
||||
exclude:
|
||||
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
|
||||
- org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration
|
||||
datasource:
|
||||
druid:
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
loginUsername: admin
|
||||
loginPassword: 123456
|
||||
allow:
|
||||
web-stat-filter:
|
||||
enabled: true
|
||||
dynamic:
|
||||
druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
|
||||
# 连接池的配置信息
|
||||
# 初始化大小,最小,最大
|
||||
initial-size: 5
|
||||
min-idle: 5
|
||||
maxActive: 1000
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 3600000
|
||||
validationQuery: SELECT 1
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
# 打开PSCache,并且指定每个连接上PSCache的大小
|
||||
poolPreparedStatements: true
|
||||
maxPoolPreparedStatementPerConnectionSize: 20
|
||||
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
|
||||
filters: stat,wall,slf4j
|
||||
# 允许SELECT语句的WHERE子句是一个永真条件
|
||||
wall:
|
||||
selectWhereAlwayTrueCheck: false
|
||||
# 打开mergeSql功能;慢SQL记录
|
||||
stat:
|
||||
merge-sql: true
|
||||
slow-sql-millis: 5000
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://localhost:40521/nursing_unit?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
# url: jdbc:mysql://localhost:3306/nursing_unit_001?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: BLXC@123.
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# 多数据源配置
|
||||
#multi-datasource1:
|
||||
#url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
#username: root
|
||||
#password: root
|
||||
#driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
#redis 配置
|
||||
redis:
|
||||
database: 0
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
password:
|
||||
#mybatis plus 设置
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:org/jeecg/**/xml/*Mapper.xml,classpath*:com/nu/**/xml/*Mapper.xml
|
||||
global-config:
|
||||
# 关闭MP3.0自带的banner
|
||||
banner: false
|
||||
db-config:
|
||||
#主键类型 0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
|
||||
id-type: ASSIGN_ID
|
||||
# 默认数据库表下划线命名
|
||||
table-underline: true
|
||||
configuration:
|
||||
# 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
# 返回类型为Map,显示null对应的字段
|
||||
call-setters-on-nulls: true
|
||||
#jeecg专用配置
|
||||
minidao:
|
||||
base-package: org.jeecg.modules.jmreport.*,org.jeecg.modules.drag.*
|
||||
jeecg:
|
||||
# AI集成
|
||||
ai-chat:
|
||||
enabled: true
|
||||
model: deepseek-chat
|
||||
apiKey: ??
|
||||
apiHost: https://api.deepseek.com
|
||||
timeout: 60
|
||||
# 平台上线安全配置
|
||||
firewall:
|
||||
# 数据源安全 (开启后,Online报表和图表的数据源为必填)
|
||||
dataSourceSafe: false
|
||||
# 低代码模式(dev:开发模式,prod:发布模式——关闭所有在线开发配置能力)
|
||||
lowCodeMode: dev
|
||||
# 签名密钥串(前后端要一致,正式发布请自行修改)
|
||||
signatureSecret: dd05f1c54d63749eda95f9fa6d49v442a
|
||||
#签名拦截接口
|
||||
signUrls: /sys/dict/getDictItems/*,/sys/dict/loadDict/*,/sys/dict/loadDictOrderByValue/*,/sys/dict/loadDictItem/*,/sys/dict/loadTreeData,/sys/api/queryTableDictItemsByCode,/sys/api/queryFilterTableDictInfo,/sys/api/queryTableDictByKeys,/sys/api/translateDictFromTable,/sys/api/translateDictFromTableByKeys,/sys/sendChangePwdSms,/sys/user/sendChangePhoneSms,/sys/sms,/desform/api/sendVerifyCode
|
||||
# 本地:local、Minio:minio、阿里云:alioss
|
||||
uploadType: local
|
||||
# 前端访问地址
|
||||
domainUrl:
|
||||
pc: http://localhost:3100
|
||||
app: http://localhost:8051
|
||||
path:
|
||||
#文件上传根目录 设置
|
||||
upload: /opt/upFiles
|
||||
#webapp文件路径
|
||||
webapp: /opt/webapp
|
||||
shiro:
|
||||
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/bigscreen/category/**,/bigscreen/visual/**,/bigscreen/map/**,/jmreport/bigscreen2/**
|
||||
#阿里云oss存储和大鱼短信秘钥配置
|
||||
oss:
|
||||
accessKey: ??
|
||||
secretKey: ??
|
||||
endpoint: oss-cn-beijing.aliyuncs.com
|
||||
bucketName: jeecgdev
|
||||
# 短信模板
|
||||
sms-template:
|
||||
# 签名
|
||||
signature:
|
||||
# 模板code
|
||||
templateCode:
|
||||
# 登录短信、忘记密码模板编码
|
||||
SMS_175435174:
|
||||
# 修改密码短信模板编码
|
||||
SMS_465391221:
|
||||
# 注册账号短信模板编码
|
||||
SMS_175430166:
|
||||
# 在线预览文件服务器地址配置
|
||||
file-view-domain: http://fileview.jeecg.com
|
||||
# minio文件上传
|
||||
minio:
|
||||
minio_url: http://minio.jeecg.com
|
||||
minio_name: ??
|
||||
minio_pass: ??
|
||||
bucketName: otatest
|
||||
#大屏报表参数设置
|
||||
jmreport:
|
||||
#多租户模式,默认值为空(created:按照创建人隔离、tenant:按照租户隔离) (v1.6.2+ 新增)
|
||||
saasMode:
|
||||
# 平台上线安全配置(v1.6.2+ 新增)
|
||||
firewall:
|
||||
# 数据源安全 (开启后,不允许使用平台数据源、SQL解析加签并且不允许查询数据库)
|
||||
dataSourceSafe: false
|
||||
# 低代码开发模式(dev:开发模式,prod:发布模式—关闭在线报表设计功能,分配角色admin、lowdeveloper可以放开限制)
|
||||
lowCodeMode: dev
|
||||
#xxl-job配置
|
||||
xxljob:
|
||||
enabled: false
|
||||
adminAddresses: http://127.0.0.1:9080/xxl-job-admin
|
||||
appname: ${spring.application.name}
|
||||
accessToken: ''
|
||||
address: 127.0.0.1:30007
|
||||
ip: 127.0.0.1
|
||||
port: 30007
|
||||
logPath: logs/jeecg/job/jobhandler/
|
||||
logRetentionDays: 30
|
||||
#分布式锁配置
|
||||
redisson:
|
||||
address: 127.0.0.1:6379
|
||||
password:
|
||||
type: STANDALONE
|
||||
enabled: true
|
||||
# 百度开放API配置
|
||||
baidu-api:
|
||||
app-id: ??
|
||||
api-key: ??
|
||||
secret-key: ??
|
||||
# ElasticSearch 6设置
|
||||
elasticsearch:
|
||||
cluster-name: jeecg-ES
|
||||
cluster-nodes: 127.0.0.1:9200
|
||||
check-enabled: false
|
||||
#cas单点登录
|
||||
cas:
|
||||
prefixUrl: http://cas.example.org:8443/cas
|
||||
#Mybatis输出sql日志
|
||||
logging:
|
||||
level:
|
||||
org.flywaydb: debug
|
||||
org.jeecg.modules.system.mapper: info
|
||||
com.nu.modules.system.mapper: info
|
||||
#swagger
|
||||
knife4j:
|
||||
#开启增强配置
|
||||
enable: true
|
||||
#开启生产环境屏蔽
|
||||
production: false
|
||||
basic:
|
||||
enable: false
|
||||
username: jeecg
|
||||
password: jeecg1314
|
||||
#第三方登录
|
||||
justauth:
|
||||
enabled: true
|
||||
type:
|
||||
GITHUB:
|
||||
client-id: ??
|
||||
client-secret: ??
|
||||
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/github/callback
|
||||
WECHAT_ENTERPRISE:
|
||||
client-id: ??
|
||||
client-secret: ??
|
||||
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/wechat_enterprise/callback
|
||||
agent-id: ??
|
||||
DINGTALK:
|
||||
client-id: ??
|
||||
client-secret: ??
|
||||
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/dingtalk/callback
|
||||
WECHAT_OPEN:
|
||||
client-id: ??
|
||||
client-secret: ??
|
||||
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/wechat_open/callback
|
||||
cache:
|
||||
type: default
|
||||
prefix: 'demo::'
|
||||
timeout: 1h
|
24
pom.xml
24
pom.xml
|
@ -80,6 +80,8 @@
|
|||
<module>nursing-unit-admin</module>
|
||||
<!-- 服务指令模块 -->
|
||||
<module>nursing-unit-service-directive</module>
|
||||
<!-- 接口 模块 -->
|
||||
<module>nursing-unit-api</module>
|
||||
<!-- 系统模块 -->
|
||||
<module>nursing-unit-system</module>
|
||||
</modules>
|
||||
|
@ -510,6 +512,28 @@
|
|||
<config.password></config.password>
|
||||
</properties>
|
||||
</profile>
|
||||
<!-- UAT -->
|
||||
<profile>
|
||||
<id>uat</id>
|
||||
<activation>
|
||||
<!--默认激活配置-->
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<properties>
|
||||
<!--当前环境-->
|
||||
<profile.name>dev</profile.name>
|
||||
<!--Nacos服务地址-->
|
||||
<config.server-addr>jeecg-boot-nacos:8848</config.server-addr>
|
||||
<!--Nacos配置中心命名空间,用于支持多环境.这里必须使用ID,不能使用名称,默认为空-->
|
||||
<config.namespace></config.namespace>
|
||||
<!--Nacos配置分组名称-->
|
||||
<config.group>DEFAULT_GROUP</config.group>
|
||||
<!--Nacos用户名-->
|
||||
<config.username></config.username>
|
||||
<!--Nacos密码-->
|
||||
<config.password></config.password>
|
||||
</properties>
|
||||
</profile>
|
||||
<!-- 生产 -->
|
||||
<profile>
|
||||
<id>prod</id>
|
||||
|
|
Loading…
Reference in New Issue