获取上传频率数据接口

This commit is contained in:
zhanghan11 2024-04-16 08:49:33 +08:00
parent 01e4e20284
commit 495c864d0b
4 changed files with 34 additions and 1 deletions

View File

@ -48,6 +48,14 @@ public class CaptchaController
return AjaxResult.success(configService.selectSystemName());
}
/**
* 获取上传频率
*/
@GetMapping("/sharedKeys")
public AjaxResult getSharedKeys() {
return AjaxResult.success(configService.selectSharedKeys());
}
/**
* 生成验证码
*/

View File

@ -109,7 +109,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// 过滤请求
.authorizeRequests()
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
.antMatchers("/login", "/register", "/captchaImage","/systemName").anonymous()
.antMatchers("/login", "/register", "/captchaImage","/systemName","/sharedKeys").anonymous()
// 数据接收接口允许匿名访问
.antMatchers("/ipc/dataReceive/plcData","/ipc/dataReceive/sensorData").permitAll()
// 静态资源可匿名访问

View File

@ -1,6 +1,8 @@
package com.inspur.system.service;
import java.util.List;
import java.util.Map;
import com.inspur.system.domain.SysConfig;
/**
@ -40,6 +42,13 @@ public interface ISysConfigService
*/
public String selectSystemName();
/**
* 获取上传频率
*
* @return
*/
public Map<String,Object> selectSharedKeys();
/**
* 查询参数配置列表
*

View File

@ -1,7 +1,9 @@
package com.inspur.system.service.impl;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -107,6 +109,20 @@ public class SysConfigServiceImpl implements ISysConfigService
return selectConfigByKey("sys.name");
}
/**
* 获取上传频率
*
* @return
*/
@Override
public Map<String,Object> selectSharedKeys(){
Map<String,Object> returnMap = new HashMap<>();
Map<String,Integer> map = new HashMap<>();
map.put("time",Integer.parseInt(selectConfigByKey("shared.time")));
returnMap.put("shared",map);
return returnMap;
}
/**
* 查询参数配置列表
*