Browse Source

# 接站优化

zhongwei
H.X 2 years ago
parent
commit
4b4c69c8fb
  1. 6
      hzims-service-api/hzims-operational-api/pom.xml
  2. 5
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/config/entity/FocusAttributeEntity.java
  3. 13
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEntity.java
  4. 5
      hzims-service/equipment/pom.xml
  5. 3
      hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/controller/EquipmentLedgerController.java
  6. 3
      hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/server/RealTimeDataServer.java
  7. 6
      hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/server/impl/RealTimeDataServerImpl.java
  8. 19
      hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/service/IModelInstanceService.java
  9. 26
      hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/service/impl/ModelInstanceServiceImpl.java
  10. 14
      hzims-service/operational/pom.xml
  11. 38
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationController.java
  12. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationService.java
  13. 78
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java
  14. 2
      hzims-service/pom.xml
  15. 12
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/redisConsume/RedisMessageTopic.java
  16. 27
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/redisConsume/WorkTicketMsgConsume.java
  17. 7
      hzims-service/weather/pom.xml
  18. 25
      hzims-service/weather/src/main/java/com/hnac/hzims/weather/consume/ConsumerMsg.java
  19. 30
      hzims-service/weather/src/main/java/com/hnac/hzims/weather/supplier/RedisMsgSupplyController.java
  20. 2
      pom.xml

6
hzims-service-api/hzims-operational-api/pom.xml

@ -58,8 +58,7 @@
<dependency>
<groupId>com.hnac.hzinfo.data</groupId>
<artifactId>hzinfo-data-sdk</artifactId>
<version>${hzinfo.data.version}</version>
<scope>compile</scope>
<version>4.6.0-SNAPSHOT</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.hnac.hzinfo.data</groupId>-->
@ -70,8 +69,7 @@
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-system-api</artifactId>
<version>4.5.3.RELEASE</version>
<scope>compile</scope>
<version>4.5.8.RELEASE</version>
</dependency>
</dependencies>

5
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/config/entity/FocusAttributeEntity.java

@ -22,7 +22,7 @@ import java.io.Serializable;
@NoArgsConstructor
@Builder
@TableName("hzims_focus_attribute")
public class FocusAttributeEntity extends TenantEntity implements Serializable {
public class FocusAttributeEntity extends TenantEntity implements Serializable {
private static final long serialVersionUID = 4252785650034702695L;
@ApiModelProperty(value = "分组ID",required = true)
@ -67,4 +67,7 @@ public class FocusAttributeEntity extends TenantEntity implements Serializable {
@ApiModelProperty("单位")
private String unit;
@ApiModelProperty("监测点映射标识")
private String signage;
}

13
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/station/entity/StationEntity.java

@ -17,6 +17,7 @@ import org.springblade.core.tenant.mp.TenantEntity;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
@ -28,10 +29,6 @@ import java.time.LocalDateTime;
@NoArgsConstructor
public class StationEntity extends TenantEntity implements Serializable {
private static final long serialVersionUID = -4381363806216436570L;
@ApiModelProperty("主键ID")
private Long id;
@ApiModelProperty("所属领域(来源于字典表如水电)")
@JsonSerialize(nullsUsing = NullSerializer.class)
@QueryField(condition = SqlCondition.EQUAL)
@ -51,6 +48,11 @@ public class StationEntity extends TenantEntity implements Serializable {
@QueryField(condition = SqlCondition.EQUAL)
private String areaCode;
@ApiModelProperty("上属机构")
@QueryField(condition = SqlCondition.EQUAL)
@NotNull
private Long higherDept;
@ApiModelProperty("所属机构")
@QueryField(condition = SqlCondition.EQUAL)
@JsonSerialize(nullsUsing = NullSerializer.class)
@ -58,10 +60,12 @@ public class StationEntity extends TenantEntity implements Serializable {
@ApiModelProperty("编号(原站点ID)")
@QueryField(condition = SqlCondition.LIKE)
@NotNull
private String code;
@ApiModelProperty("名称")
@QueryField(condition = SqlCondition.LIKE)
@NotNull
private String name;
@DateTimeFormat(
@ -79,6 +83,7 @@ public class StationEntity extends TenantEntity implements Serializable {
@ApiModelProperty("类型(1电站2泵站3水厂)")
@QueryField(condition = SqlCondition.EQUAL)
@JsonSerialize(nullsUsing = NullSerializer.class)
@NotNull
private Integer type;
@ApiModelProperty("前池最高水位")

5
hzims-service/equipment/pom.xml

@ -98,6 +98,11 @@
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.hnac.hzinfo</groupId>
<artifactId>hzinfo-data-sdk</artifactId>
<version>4.6.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.hnac.hzims</groupId>

3
hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/controller/EquipmentLedgerController.java

@ -2,10 +2,13 @@ package com.hnac.hzims.monitor.controller;
import com.hnac.hzims.monitor.server.HistoricalDataServer;
import com.hnac.hzims.monitor.server.RealTimeDataServer;
import com.hnac.hzinfo.dataconfig.deviceInstace.DeviceInstance;
import com.hnac.hzinfo.dataconfig.deviceInstace.DeviceInstanceAttr;
import com.hnac.hzinfo.dataconfig.entity.*;
import com.hnac.hzinfo.datasearch.analyse.domain.AnalyzeDataCondition;
import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData;
import com.hnac.hzinfo.datasearch.real.po.RealDataSearchPO;
import com.hnac.hzinfo.sdk.analyse.vo.AnalyzeModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;

3
hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/server/RealTimeDataServer.java

@ -1,9 +1,12 @@
package com.hnac.hzims.monitor.server;
import com.hnac.hzinfo.dataconfig.deviceInstace.DeviceInstance;
import com.hnac.hzinfo.dataconfig.deviceInstace.DeviceInstanceAttr;
import com.hnac.hzinfo.dataconfig.entity.*;
import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData;
import com.hnac.hzinfo.datasearch.real.po.RealDataSearchPO;
import com.hnac.hzinfo.sdk.analyse.vo.AnalyzeModel;
import org.springblade.core.tool.api.R;
import java.util.List;

6
hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/server/impl/RealTimeDataServerImpl.java

@ -4,14 +4,18 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hnac.hzims.equipment.entity.EmInfoEntity;
import com.hnac.hzims.equipment.mapper.EmInfoMapper;
import com.hnac.hzims.monitor.server.RealTimeDataServer;
import com.hnac.hzinfo.dataconfig.device.IDeviceClient;
import com.hnac.hzinfo.dataconfig.deviceInstace.DeviceInstance;
import com.hnac.hzinfo.dataconfig.deviceInstace.DeviceInstanceAttr;
import com.hnac.hzinfo.dataconfig.entity.*;
import com.hnac.hzinfo.datasearch.analyse.IAnalyseDataSearchClient;
import com.hnac.hzinfo.datasearch.analyse.IAnalyseInstanceClient;
import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData;
import com.hnac.hzinfo.datasearch.device.IDeviceClient;
import com.hnac.hzinfo.datasearch.real.IRealDataSearchClient;
import com.hnac.hzinfo.datasearch.real.po.RealDataSearchPO;
import com.hnac.hzinfo.sdk.analyse.vo.AnalyzeModel;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;

19
hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/service/IModelInstanceService.java

@ -0,0 +1,19 @@
package com.hnac.hzims.monitor.service;
import com.hnac.hzinfo.sdk.analyse.dto.AnalyseDataHandlerDTO;
/**
* @author hx
* @version 1.0
* @date 2023/3/12 14:38
*/
public interface IModelInstanceService {
/**
* 新建设备模型实例
* @param analyseDataHandlerDTO 模型实例
* @return
*/
boolean save(AnalyseDataHandlerDTO analyseDataHandlerDTO);
}

26
hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/service/impl/ModelInstanceServiceImpl.java

@ -0,0 +1,26 @@
package com.hnac.hzims.monitor.service.impl;
import com.hnac.hzims.monitor.service.IModelInstanceService;
import com.hnac.hzinfo.sdk.analyse.AnalyseDataHandlerClient;
import com.hnac.hzinfo.sdk.analyse.dto.AnalyseDataHandlerDTO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* @author hx
* @version 1.0
* @date 2023/3/12 14:38
*/
@Service
@AllArgsConstructor
@Slf4j
public class ModelInstanceServiceImpl implements IModelInstanceService {
private final AnalyseDataHandlerClient analyseDataHandlerClient;
@Override
public boolean save(AnalyseDataHandlerDTO analyseDataHandlerDTO) {
//analyseDataHandlerClient.save(analyseDataHandlerDTO);
return true;
}
}

14
hzims-service/operational/pom.xml

@ -259,8 +259,12 @@
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-system-api</artifactId>
<version>4.5.0.RELEASE</version>
<scope>compile</scope>
<version>4.5.8.RELEASE</version>
</dependency>
<dependency>
<groupId>com.hnac.hzinfo</groupId>
<artifactId>hzinfo-data-sdk</artifactId>
<version>4.6.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
@ -276,6 +280,12 @@
<version>4.5.3.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-system-api</artifactId>
<version>4.5.8.RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

38
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationController.java

@ -1,4 +1,4 @@
package com.hnac.hzims.operational.station.controller;
package com.hnac.hzims.operational.station.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -66,17 +66,19 @@ public class StationController extends BladeController {
@ApiOperationSupport(order = 20)
@ApiOperation(value = "新增")
public R save(@Valid @RequestBody StationEntity req) {
List<StationEntity> list = stationService.list(new LambdaQueryWrapper<StationEntity>(){{
eq(StationEntity::getCode,req.getCode()).or().eq(StationEntity::getName,req.getName());
}});
Optional<Integer> sort = Optional.ofNullable(stationService.getStationMaxOrder());
req.setSort(sort.isPresent() ? sort.get()+1 : 1);
// 刷新演示平台站点数量
Executors.newSingleThreadExecutor().submit(() -> {
dataServicel.saveStation();
return "success";
});
return list.size()>0 ? R.fail(400,"该站点名/编码已有对应记录,请找到相应记录做修改处理") : R.status(stationService.save(req));
stationService.buildStation(req);
return R.success("保存成功!");
// List<StationEntity> list = stationService.list(new LambdaQueryWrapper<StationEntity>(){{
// eq(StationEntity::getCode,req.getCode()).or().eq(StationEntity::getName,req.getName());
// }});
// Optional<Integer> sort = Optional.ofNullable(stationService.getStationMaxOrder());
// req.setSort(sort.isPresent() ? sort.get()+1 : 1);
// // 刷新演示平台站点数量
// Executors.newSingleThreadExecutor().submit(() -> {
// dataServicel.saveStation();
// return "success";
// });
// return list.size()>0 ? R.fail(400,"该站点名/编码已有对应记录,请找到相应记录做修改处理") : R.status(stationService.save(req));
}
/**
@ -86,11 +88,13 @@ public class StationController extends BladeController {
@ApiOperationSupport(order = 30)
@ApiOperation(value = "修改", notes = "传入StationEntity")
public R update(@Valid @RequestBody StationEntity req) {
LambdaQueryWrapper<StationEntity> queryWrapper = new LambdaQueryWrapper<StationEntity>();
queryWrapper.ne(StationEntity::getId,req.getId());
queryWrapper.and(wrapper -> wrapper.eq(StationEntity::getCode,req.getCode()).or().eq(StationEntity::getName,req.getName()));
List<StationEntity> list = stationService.list(queryWrapper);
return list.size()>0 ? R.fail(400,"该站点名/编码已有对应记录,请找到相应记录做修改处理") : R.status(stationService.updateById(req));
stationService.buildStation(req);
return R.success("修改成功!");
// LambdaQueryWrapper<StationEntity> queryWrapper = new LambdaQueryWrapper<StationEntity>();
// queryWrapper.ne(StationEntity::getId,req.getId());
// queryWrapper.and(wrapper -> wrapper.eq(StationEntity::getCode,req.getCode()).or().eq(StationEntity::getName,req.getName()));
// List<StationEntity> list = stationService.list(queryWrapper);
// return list.size()>0 ? R.fail(400,"该站点名/编码已有对应记录,请找到相应记录做修改处理") : R.status(stationService.updateById(req));
}
@PostMapping("/updateBatch")

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationService.java

@ -23,6 +23,12 @@ import java.util.Map;
*/
public interface IStationService extends BaseService<StationEntity> {
/**
* 新建站点
* @param req 站点信息
*/
void buildStation(StationEntity req);
IPage<StationVO> list(StationEntity req, Query query);
List<User> getUsersByStationId(String stationId);

78
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java

@ -1,11 +1,14 @@
package com.hnac.hzims.operational.station.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.common.service.UserAuthDataService;
import com.hnac.hzims.operational.OperationalConstants;
import com.hnac.hzims.operational.data.service.HzimsDataService;
import com.hnac.hzims.operational.main.vo.StationCountVo;
import com.hnac.hzims.operational.station.StationConstants;
import com.hnac.hzims.operational.station.entity.ControlUsersEntity;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.mapper.ControlUsersMapper;
@ -15,10 +18,14 @@ import com.hnac.hzims.operational.station.vo.HzimsStationCountVo;
import com.hnac.hzims.operational.station.vo.StationAndDeptVo;
import com.hnac.hzims.operational.station.vo.StationVO;
import com.hnac.hzims.operational.station.wrapper.StationWrapper;
import com.hnac.hzinfo.sdk.core.response.Result;
import com.hnac.hzinfo.sdk.project.ProjectClient;
import com.hnac.hzinfo.sdk.project.dto.ProjectDTO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.log.logger.BladeLogger;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
@ -27,13 +34,16 @@ import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.*;
import org.springblade.system.entity.Dept;
import org.springblade.system.feign.IDeptClient;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import java.util.*;
import java.util.concurrent.Executors;
import java.util.stream.Collectors;
/**
@ -44,8 +54,46 @@ import java.util.stream.Collectors;
@Slf4j
public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEntity> implements IStationService {
private final ISysClient sysClient;
private final IDeptClient deptClient;
private final UserAuthDataService userAuthDataService;
private final IUserClient userClient;
private final ProjectClient projectClient;
private final BladeLogger logger;
@Override
public void buildStation(StationEntity req) {
// 新建站点的所属机构
Assert.isTrue(this.buildDept(req),() -> {
throw new ServiceException("创建/修改机构失败!");
});
LambdaQueryWrapper lwq;
if(Func.isEmpty(req.getId())) {
lwq = Wrappers.<StationEntity>lambdaQuery()
.eq(StationEntity::getCode,req.getCode()).or().eq(StationEntity::getName,req.getName());
}
else {
lwq = Wrappers.<StationEntity>lambdaQuery().ne(StationEntity::getId,req.getId())
.and(wrapper -> wrapper.eq(StationEntity::getCode,req.getCode()).or().eq(StationEntity::getName,req.getName()));
}
List<StationEntity> list = super.list(lwq);
Assert.isTrue(CollectionUtil.isEmpty(list),() -> {
throw new ServiceException("该站点名/编码已有对应记录,请找到相应记录做修改处理");
});
Optional<Integer> sort = Optional.ofNullable(this.getStationMaxOrder());
req.setSort(sort.isPresent() ? sort.get()+1 : 1);
Assert.isTrue(this.saveOrUpdate(req),() -> {
throw new ServiceException("创建/修改站点信息失败!");
});
// 为画面导入创建工程
new Thread(() -> {
ProjectDTO projectDTO = new ProjectDTO();
projectDTO.setName(req.getName());
projectDTO.setSource(1);
Result result = projectClient.saveOrUpdate(projectDTO);
logger.info("operational:station:buildStation:"+req.getCode(), JSON.toJSONString(result));
}).start();
}
@Override
public IPage<StationVO> list(StationEntity req, Query query) {
@ -493,4 +541,34 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn
return this.baseMapper.getStationCount();
}
/**
* 通过站点编辑所属机构
* @param stationEntity 站点信息
* @return
*/
private boolean buildDept(StationEntity stationEntity) {
//若所属机构不为空 则说明机构已建 获取所属机构
Dept request = new Dept();
if(Func.isNotEmpty(stationEntity.getRefDept())) {
R<Dept> deptResult = sysClient.getDept(stationEntity.getRefDept());
if(deptResult.isSuccess() && Func.isNotEmpty(deptResult.getData())) {
request = deptResult.getData();
}
}
request.setStationId(stationEntity.getCode());
request.setTenantId(AuthUtil.getTenantId());
request.setFullName(stationEntity.getName());
request.setDeptName(stationEntity.getName());
request.setParentId(stationEntity.getHigherDept());
request.setDeptCategory(StationConstants.DeptCategoryEnum.STATION.getValue());
request.setSort(1);
R<Boolean> buildResult = deptClient.createOrUpdateDept(request);
if(buildResult.isSuccess()) {
// 所属机构回传
R<Dept> deptByStation = sysClient.getDeptByStation(request.getStationId(), AuthUtil.getTenantId());
stationEntity.setRefDept(Optional.ofNullable(deptByStation).map(R::getData).map(Dept::getId).orElse(null));
}
return buildResult.isSuccess();
}
}

2
hzims-service/pom.xml

@ -24,7 +24,7 @@
<module>equipment</module>
<module>safeproduct</module>
<module>operational</module>
<module>inspect</module>
<!-- <module>inspect</module>-->
<module>message</module>
<module>ticket</module>
<module>weather</module>

12
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/redisConsume/RedisMessageTopic.java

@ -0,0 +1,12 @@
package com.hnac.hzims.ticket.redisConsume;
/**
* @author hx
* @version 1.0
* @date 2023/3/14 15:24
*/
public interface RedisMessageTopic {
String WORK_TICKET_MESSAGE_KEY = "work::ticket::flow";
}

27
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/redisConsume/WorkTicketMsgConsume.java

@ -0,0 +1,27 @@
package com.hnac.hzims.ticket.redisConsume;
import com.hnac.hzims.common.config.RedisMessageListener;
import com.hnac.hzims.ticket.twoTicket.service.IFirstWorkTicketService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @author hx
* @version 1.0
* @date 2023/3/14 15:12
*/
@Component
@AllArgsConstructor
@Slf4j
public class WorkTicketMsgConsume {
private final IFirstWorkTicketService firstWorkTicketService;
@RedisMessageListener(topic = RedisMessageTopic.WORK_TICKET_MESSAGE_KEY)
public void dealWorkTicketFlow(String message){
log.info("接收工作票流程,接收消息为:{}",message);
}
}

7
hzims-service/weather/pom.xml

@ -25,6 +25,13 @@
</properties>
<dependencies>
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>hzims-biz-common</artifactId>
<version>${hzims.project.version}</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-common</artifactId>

25
hzims-service/weather/src/main/java/com/hnac/hzims/weather/consume/ConsumerMsg.java

@ -0,0 +1,25 @@
package com.hnac.hzims.weather.consume;
import com.hnac.hzims.common.config.RedisMessageListener;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
/**
* @author hx
* @version 1.0
* @date 2023/3/12 15:58
*/
@Service
@Slf4j
public class ConsumerMsg {
@RedisMessageListener(topic = "hzims::weather::test1")
public void receiveMessage1(String message){
log.info("receiveMessage1收到一条消息:{}",message);
}
@RedisMessageListener(topic = "hzims::weather::test2")
public void receiveMessage2(String message){
log.info("receiveMessage2收到一条消息:{}",message);
}
}

30
hzims-service/weather/src/main/java/com/hnac/hzims/weather/supplier/RedisMsgSupplyController.java

@ -0,0 +1,30 @@
package com.hnac.hzims.weather.supplier;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author hx
* @version 1.0
* @date 2023/3/12 16:03
*/
@RestController
@RequestMapping("/redis/supply")
@AllArgsConstructor
@Slf4j
public class RedisMsgSupplyController {
private final StringRedisTemplate stringRedisTemplate;
@GetMapping("/test/{channel}/{msg}")
public R test(@PathVariable String channel,@PathVariable String msg) {
stringRedisTemplate.convertAndSend(channel, msg);
return R.success("发送成功");
}
}

2
pom.xml

@ -16,7 +16,7 @@
<maven.plugin.version>3.8.1</maven.plugin.version>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<hzinfo.data.version>4.5.8.RELEASE</hzinfo.data.version>
<hzinfo.data.version>4.6.0-SNAPSHOT</hzinfo.data.version>
<!-- <hzinfo.data.api.version>4.5.3-SNAPSHOT</hzinfo.data.api.version>-->
<!-- <hzinfo.data.sdk.version>4.5.4-RELEASE</hzinfo.data.sdk.version>-->

Loading…
Cancel
Save