APP版本配置
parent
c86ddefe89
commit
110ea70971
|
|
@ -11,6 +11,7 @@ import com.ruoyi.common.constant.CacheConstants;
|
|||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.framework.config.properties.AppProperties;
|
||||
import com.ruoyi.framework.config.properties.OSSProperties;
|
||||
import com.ruoyi.framework.ocr.BusinessLicense;
|
||||
import com.ruoyi.framework.ocr.IdCard;
|
||||
|
|
@ -52,9 +53,11 @@ public class CommonController {
|
|||
|
||||
@Value("${oss.fileExpireTime:3600}")
|
||||
private Long fileExpireTime;//指定过期时间,单位为秒。
|
||||
@Value("${oss.callbackUrl:http://121.40.117.244:9310/rest/v1/oss-callback/upload}")
|
||||
@Value("${oss.callbackUrl}")
|
||||
private String callbackUrl;//上传回调URL
|
||||
@Autowired
|
||||
private AppProperties appProperties;
|
||||
@Autowired
|
||||
private OSSClientWrapper ossClient;
|
||||
@Autowired
|
||||
private OSSProperties ossProperties;
|
||||
|
|
@ -65,6 +68,12 @@ public class CommonController {
|
|||
@Autowired
|
||||
private ISysHtmlService htmlService;
|
||||
|
||||
@ApiOperation("APP版本")
|
||||
@GetMapping("/app-version")
|
||||
public R<AppVersionVO> getAppVersion() {
|
||||
return R.ok(BeanUtil.toBean(appProperties, AppVersionVO.class));
|
||||
}
|
||||
|
||||
@ApiOperation("获取OSS临时访问凭证")
|
||||
@GetMapping("/oss/getCredentials")
|
||||
public R<STSCredentialsVO> getCredentials() {
|
||||
|
|
@ -226,8 +235,8 @@ public class CommonController {
|
|||
@PreAuthorize("@ss.hasAnyRoles('admin,general_admin')")
|
||||
@ApiOperation("保存html(需登录管理员用户)")
|
||||
@PostMapping("/html/save")
|
||||
public R saveHtmlContent(@Validated @RequestBody HtmlVO vo){
|
||||
htmlService.saveHtml(vo.getTitle(),vo.getContent());
|
||||
public R saveHtmlContent(@Validated @RequestBody HtmlVO vo) {
|
||||
htmlService.saveHtml(vo.getTitle(), vo.getContent());
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
package com.ruoyi.web.controller.common.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author liangyq
|
||||
* @date 2025-11-03
|
||||
*/
|
||||
@Data
|
||||
public class AppVersionVO {
|
||||
|
||||
@ApiModelProperty("APP最新版本号")
|
||||
private String version;
|
||||
|
||||
@ApiModelProperty("安卓APK下载地址(IOS直接跳转商店更新)")
|
||||
private String downloadUrl;
|
||||
|
||||
@ApiModelProperty("更新说明")
|
||||
private String updateNotes;
|
||||
|
||||
@ApiModelProperty("是否强制更新")
|
||||
private Boolean forcedUpdate;
|
||||
}
|
||||
|
|
@ -24,6 +24,7 @@ oss:
|
|||
expiredDuration: 3600
|
||||
tempDir: /temp/
|
||||
stsCacheDuration: 1800
|
||||
callbackUrl: https://api.cdbuju.cn/rest/v1/oss-callback/upload
|
||||
img-search:
|
||||
endPoint: imagesearch.cn-hangzhou.aliyuncs.com
|
||||
accessKeyId: LTAI5tBFXhTu7Di1ZumRPYZs
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ oss:
|
|||
expiredDuration: 3600
|
||||
tempDir: E:/temp/
|
||||
stsCacheDuration: 1800
|
||||
callbackUrl: https://api.cdbuju.cn/rest/v1/oss-callback/upload
|
||||
img-search:
|
||||
endPoint: imagesearch.cn-hangzhou.aliyuncs.com
|
||||
accessKeyId: LTAI5tBFXhTu7Di1ZumRPYZs
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ oss:
|
|||
expiredDuration: 3600
|
||||
tempDir: /temp/
|
||||
stsCacheDuration: 1800
|
||||
callbackUrl: https://api.cdbuju.cn/rest/v1/oss-callback/upload
|
||||
img-search:
|
||||
endPoint: imagesearch-vpc.cn-hangzhou.aliyuncs.com
|
||||
accessKeyId: LTAI5t9e53VpzuR22AFtppMR
|
||||
|
|
|
|||
|
|
@ -3,3 +3,8 @@ spring:
|
|||
active: local
|
||||
# active: prod
|
||||
# active: @spring.profiles.active@
|
||||
app:
|
||||
version: 1.0.0
|
||||
download-url: https://cdbuju.oss-cn-hangzhou.aliyuncs.com/apk/cdbuju-1.0.0.apk
|
||||
update-notes: 正式上线
|
||||
forced-update: false
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
package com.ruoyi.framework.config.properties;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author liangyq
|
||||
* @date 2025-03-24
|
||||
*/
|
||||
@Data
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "app")
|
||||
public class AppProperties {
|
||||
|
||||
private String version;
|
||||
|
||||
private String downloadUrl;
|
||||
|
||||
private String updateNotes;
|
||||
|
||||
private Boolean forcedUpdate;
|
||||
}
|
||||
Loading…
Reference in New Issue