开发闹钟相关代码
This commit is contained in:
parent
1a34082077
commit
2bf59f6942
@ -1,16 +1,15 @@
|
||||
package com.qiuguo.iot.data.entity.device;
|
||||
import lombok.Data;
|
||||
import org.hswebframework.ezorm.rdb.mapping.annotation.Comment;
|
||||
import org.hswebframework.web.crud.annotation.EnableEntityEvent;
|
||||
import org.hswebframework.web.api.crud.entity.GenericEntity;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Table;import lombok.Data;
|
||||
import java.util.Date;
|
||||
/**
|
||||
* <p>
|
||||
* </p>*闹钟记录表
|
||||
* @author wulin
|
||||
* @since 2023-09-05
|
||||
* @since 2023-11-13
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ -42,17 +41,17 @@ public class DeviceAlarmClockRecordEntity extends GenericEntity<Long> {
|
||||
@Column(name = "user_id", nullable = false)
|
||||
private Long userId;
|
||||
|
||||
@Comment("第一次响铃时间,如果有重复,那么每天这个时间响铃")
|
||||
@Column(name = "time", nullable = false)
|
||||
@Comment("第一次响铃的时间,循环响铃的时间(只取时间)")
|
||||
@Column(name = "time")
|
||||
private Date time;
|
||||
|
||||
@Comment("重复次数:0:响铃一次(time指定的时间) 1:每天 2:指定星期")
|
||||
@Comment("重复次数:0:响铃一次(time指定的时间) 1:每天 2:指定星期 3 跳过节假日")
|
||||
@Column(name = "repeat", nullable = false)
|
||||
private Integer repeat;
|
||||
|
||||
@Comment("当repeat=2时具体的星期 1,2,3,4,5,6,7")
|
||||
@Column(name = "repeat_day", length = 100)
|
||||
private String repeatDay;
|
||||
@Comment("当repeat=2时具体的星期 按位取,从低到高 1,2,3,4,5,6,7")
|
||||
@Column(name = "repeat_day")
|
||||
private Integer repeatDay;
|
||||
|
||||
@Comment("闹铃标题")
|
||||
@Column(name = "title", length = 255, nullable = false)
|
||||
|
||||
@ -5,7 +5,7 @@ import java.util.Date;
|
||||
* <p>
|
||||
*闹钟记录请求类
|
||||
* @author wulin
|
||||
* @since 2023-08-07
|
||||
* @since 2023-11-13
|
||||
*/
|
||||
|
||||
|
||||
@ -16,38 +16,90 @@ public class DeviceAlarmClockRecordRequest implements java.io.Serializable {
|
||||
private int pageSize = 10;
|
||||
private String sort;
|
||||
private String order;
|
||||
//
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
//是否删除:0 否 1 删除
|
||||
/**
|
||||
*是否删除:0 否 1 删除
|
||||
*/
|
||||
private Integer isDelete;
|
||||
//创建时间
|
||||
/**
|
||||
*创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
*创建时间搜索开始
|
||||
*/
|
||||
|
||||
private Date createTimeStart;
|
||||
|
||||
/**
|
||||
*创建时间搜索结束
|
||||
*/
|
||||
private Date createTimeEnd;
|
||||
//修改时间
|
||||
/**
|
||||
*修改时间
|
||||
*/
|
||||
private Date modifyTime;
|
||||
/**
|
||||
*修改时间搜索开始
|
||||
*/
|
||||
|
||||
private Date modifyTimeStart;
|
||||
|
||||
/**
|
||||
*修改时间搜索结束
|
||||
*/
|
||||
private Date modifyTimeEnd;
|
||||
//设备id
|
||||
/**
|
||||
*设备id
|
||||
*/
|
||||
private Long deviceId;
|
||||
//用户id
|
||||
/**
|
||||
*用户id
|
||||
*/
|
||||
private Long userId;
|
||||
//第一次响铃时间,如果有重复,那么每天这个时间响铃
|
||||
/**
|
||||
*第一次响铃的时间,循环响铃的时间(只取时间)
|
||||
*/
|
||||
private Date time;
|
||||
/**
|
||||
*第一次响铃的时间,循环响铃的时间(只取时间)搜索开始
|
||||
*/
|
||||
|
||||
private Date timeStart;
|
||||
|
||||
/**
|
||||
*第一次响铃的时间,循环响铃的时间(只取时间)搜索结束
|
||||
*/
|
||||
private Date timeEnd;
|
||||
//重复次数:0:响铃一次(time指定的时间) 1:每天 2:指定星期
|
||||
/**
|
||||
*重复次数:0:响铃一次(time指定的时间) 1:每天 2:指定星期 3 跳过节假日
|
||||
*/
|
||||
private Integer repeat;
|
||||
//当repeat=2时具体的星期 1,2,3,4,5,6,7
|
||||
private String repeatDay;
|
||||
//闹铃标题
|
||||
/**
|
||||
*当repeat=2时具体的星期 按位取,从低到高 1,2,3,4,5,6,7
|
||||
*/
|
||||
private Integer repeatDay;
|
||||
/**
|
||||
*闹铃标题
|
||||
*/
|
||||
private String title;
|
||||
//闹铃提示文案(语音播报)
|
||||
/**
|
||||
*闹铃提示文案(语音播报)
|
||||
*/
|
||||
private String readText;
|
||||
//响铃类型 0:系统内置 1:指定声音(音乐)
|
||||
/**
|
||||
*响铃类型 0:系统内置 1:指定声音(音乐)
|
||||
*/
|
||||
private Integer soundType;
|
||||
//响铃地址
|
||||
/**
|
||||
*响铃地址
|
||||
*/
|
||||
private String sound;
|
||||
//响铃名称
|
||||
/**
|
||||
*响铃名称
|
||||
*/
|
||||
private String soundName;
|
||||
}
|
||||
@ -1,35 +1,84 @@
|
||||
package com.qiuguo.iot.data.resp.device;
|
||||
import com.qiuguo.iot.data.entity.device.DeviceAlarmClockRecordEntity;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
/**
|
||||
* <p>
|
||||
* </p>*闹钟记录返回类
|
||||
* @author wulin
|
||||
* @since 2023-08-07
|
||||
* @since 2023-11-13
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class DeviceAlarmClockRecordResp {
|
||||
//
|
||||
public DeviceAlarmClockRecordResp(){
|
||||
}
|
||||
public DeviceAlarmClockRecordResp(DeviceAlarmClockRecordEntity entity){
|
||||
id = entity.getId();
|
||||
createTime = entity.getCreateTime();
|
||||
modifyTime = entity.getModifyTime();
|
||||
deviceId = entity.getDeviceId();
|
||||
userId = entity.getUserId();
|
||||
time = entity.getTime();
|
||||
repeat = entity.getRepeat();
|
||||
repeatDay = entity.getRepeatDay();
|
||||
title = entity.getTitle();
|
||||
readText = entity.getReadText();
|
||||
soundType = entity.getSoundType();
|
||||
sound = entity.getSound();
|
||||
soundName = entity.getSoundName();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
//设备id
|
||||
/**
|
||||
*创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
*修改时间
|
||||
*/
|
||||
private Date modifyTime;
|
||||
/**
|
||||
*设备id
|
||||
*/
|
||||
private Long deviceId;
|
||||
//用户id
|
||||
/**
|
||||
*用户id
|
||||
*/
|
||||
private Long userId;
|
||||
//第一次响铃时间,如果有重复,那么每天这个时间响铃
|
||||
/**
|
||||
*第一次响铃的时间,循环响铃的时间(只取时间)
|
||||
*/
|
||||
private Date time;
|
||||
//重复次数:0:响铃一次(time指定的时间) 1:每天 2:指定星期
|
||||
/**
|
||||
*重复次数:0:响铃一次(time指定的时间) 1:每天 2:指定星期 3 跳过节假日
|
||||
*/
|
||||
private Integer repeat;
|
||||
//当repeat=2时具体的星期 1,2,3,4,5,6,7
|
||||
private String repeatDay;
|
||||
//闹铃标题
|
||||
/**
|
||||
*当repeat=2时具体的星期 按位取,从低到高 1,2,3,4,5,6,7
|
||||
*/
|
||||
private Integer repeatDay;
|
||||
/**
|
||||
*闹铃标题
|
||||
*/
|
||||
private String title;
|
||||
//闹铃提示文案(语音播报)
|
||||
/**
|
||||
*闹铃提示文案(语音播报)
|
||||
*/
|
||||
private String readText;
|
||||
//响铃类型 0:系统内置 1:指定声音(音乐)
|
||||
/**
|
||||
*响铃类型 0:系统内置 1:指定声音(音乐)
|
||||
*/
|
||||
private Integer soundType;
|
||||
//响铃地址
|
||||
/**
|
||||
*响铃地址
|
||||
*/
|
||||
private String sound;
|
||||
//响铃名称
|
||||
/**
|
||||
*响铃名称
|
||||
*/
|
||||
private String soundName;
|
||||
}
|
||||
@ -2,9 +2,10 @@ package com.qiuguo.iot.data.service.device;
|
||||
|
||||
|
||||
|
||||
import java.util.Date;
|
||||
import com.qiuguo.iot.base.utils.StringUtils;
|
||||
import com.qiuguo.iot.data.entity.device.DeviceAlarmClockRecordEntity;
|
||||
import com.qiuguo.iot.data.request.device.DeviceAlarmClockRecordRequest;
|
||||
import com.qiuguo.iot.base.utils.StringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.hswebframework.ezorm.core.param.Sort;
|
||||
import org.hswebframework.ezorm.rdb.mapping.ReactiveQuery;
|
||||
@ -17,19 +18,19 @@ import org.springframework.stereotype.Service;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 闹钟记录服务类
|
||||
* </p>
|
||||
*
|
||||
* @author wulin
|
||||
* @since 2023-08-08
|
||||
* @since 2023-11-13
|
||||
*/
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DeviceAlarmClockRecordService extends GenericReactiveCrudService<DeviceAlarmClockRecordEntity, Long> {
|
||||
public class DeviceAlarmClockRecordService extends GenericReactiveCrudService<DeviceAlarmClockRecordEntity, Long> {
|
||||
|
||||
|
||||
public Mono<DeviceAlarmClockRecordEntity> selectDeviceAlarmClockRecordByRequest(DeviceAlarmClockRecordRequest request){
|
||||
@ -59,7 +60,7 @@ public class DeviceAlarmClockRecordService extends GenericReactiveCrudService<De
|
||||
if(request.getRepeat() != null){
|
||||
reactiveQuery = reactiveQuery.and(DeviceAlarmClockRecordRequest::getRepeat, request.getRepeat());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(request.getRepeatDay())){
|
||||
if(request.getRepeatDay() != null){
|
||||
reactiveQuery = reactiveQuery.and(DeviceAlarmClockRecordRequest::getRepeatDay, request.getRepeatDay());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(request.getTitle())){
|
||||
@ -127,8 +128,8 @@ public class DeviceAlarmClockRecordService extends GenericReactiveCrudService<De
|
||||
if(request.getRepeat() != null){
|
||||
reactiveQuery = reactiveQuery.and(DeviceAlarmClockRecordRequest::getRepeat, request.getRepeat());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(request.getRepeatDay())){
|
||||
reactiveQuery = reactiveQuery.$like$(DeviceAlarmClockRecordRequest::getRepeatDay, request.getRepeatDay());
|
||||
if(request.getRepeatDay() != null){
|
||||
reactiveQuery = reactiveQuery.and(DeviceAlarmClockRecordRequest::getRepeatDay, request.getRepeatDay());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(request.getTitle())){
|
||||
reactiveQuery = reactiveQuery.$like$(DeviceAlarmClockRecordRequest::getTitle, request.getTitle());
|
||||
@ -160,7 +161,6 @@ public class DeviceAlarmClockRecordService extends GenericReactiveCrudService<De
|
||||
param.setPageSize(request.getPageSize());
|
||||
param.setPaging(true);
|
||||
param.setFirstPageIndex(1);
|
||||
|
||||
return queryPager(param);
|
||||
}
|
||||
|
||||
@ -176,6 +176,7 @@ public class DeviceAlarmClockRecordService extends GenericReactiveCrudService<De
|
||||
|
||||
|
||||
public Mono<Integer> insertDeviceAlarmClockRecord(DeviceAlarmClockRecordEntity entity){
|
||||
entity.setId(null);
|
||||
entity.setCreateTime(null);
|
||||
entity.setModifyTime(null);
|
||||
return insert(entity);
|
||||
@ -201,7 +202,7 @@ public class DeviceAlarmClockRecordService extends GenericReactiveCrudService<De
|
||||
if(entity.getRepeat() != null){
|
||||
update = update.set(DeviceAlarmClockRecordEntity::getRepeat, entity.getRepeat());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(entity.getRepeatDay())){
|
||||
if(entity.getRepeatDay() != null){
|
||||
update = update.set(DeviceAlarmClockRecordEntity::getRepeatDay, entity.getRepeatDay());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(entity.getTitle())){
|
||||
|
||||
@ -57,4 +57,8 @@ public class Action {
|
||||
* 对应绑定的设备信息
|
||||
*/
|
||||
private DeviceUserBindEntity deviceUserBindEntity;
|
||||
/**
|
||||
* 语言
|
||||
*/
|
||||
private Integer language;
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.qiuguo.iot.third.service;
|
||||
|
||||
import com.qiuguo.iot.base.enums.KeyTypeEnum;
|
||||
import com.qiuguo.iot.base.enums.LanguageEnum;
|
||||
import com.qiuguo.iot.third.enums.ActionPartSpeechEnum;
|
||||
import com.qiuguo.iot.base.enums.DeviceTypeEnum;
|
||||
import com.qiuguo.iot.base.utils.StringUtils;
|
||||
@ -144,7 +145,7 @@ public class NlpService {
|
||||
Actions actions = new Actions();
|
||||
actions.setActions(new ArrayList<>());
|
||||
Action action = new Action();
|
||||
|
||||
action.setLanguage(isEng ? LanguageEnum.ENGLISH.getCode() : LanguageEnum.CHINESE.getCode());
|
||||
actions.setRecordText(recordText);
|
||||
action.setLbs(new ArrayList<>());
|
||||
action.setAsk(actions.getRecordText());
|
||||
|
||||
@ -0,0 +1,24 @@
|
||||
package com.qiuguo.iot.box.websocket.api.command;
|
||||
|
||||
import com.qiuguo.iot.base.enums.AskTypeEnum;
|
||||
import com.qiuguo.iot.box.websocket.api.domain.BaseSession;
|
||||
import com.qiuguo.iot.third.nlp.action.Action;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class AlarmClockActionCommand extends ActionCommand implements IActionCommand{
|
||||
|
||||
public Mono<Boolean> process(Action action, BaseSession baseSession) {
|
||||
log.info("闹钟 Action:{}", action.getAsk());
|
||||
|
||||
return baseWebSocketService.sendMessage(action,
|
||||
baseSession ,
|
||||
action.getSystemTalkAnswerConfigEntity().getAnswerValue(),
|
||||
AskTypeEnum.EXIT.getCode()).flatMap(m -> {
|
||||
return Mono.empty();
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,10 @@
|
||||
package com.qiuguo.iot.box.websocket.api.command;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.aliyun.alimt20181012.models.TranslateCertificateResponse;
|
||||
import com.aliyun.alimt20181012.models.TranslateGeneralResponse;
|
||||
import com.aliyun.alimt20181012.models.TranslateGeneralResponseBody;
|
||||
import com.qiuguo.iot.base.enums.LanguageEnum;
|
||||
import com.qiuguo.iot.base.utils.StringUtils;
|
||||
import com.qiuguo.iot.box.websocket.api.domain.BaseSession;
|
||||
import com.qiuguo.iot.box.websocket.api.domain.box.BoxSession;
|
||||
@ -13,6 +17,7 @@ import com.qiuguo.iot.third.nlp.action.Action;
|
||||
import com.qiuguo.iot.third.nlp.action.ActionTime;
|
||||
import com.qiuguo.iot.third.service.WeatherService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
@ -23,6 +28,15 @@ import javax.annotation.Resource;
|
||||
public class WeatherActionCommand extends ActionCommand implements IActionCommand{
|
||||
@Resource
|
||||
protected WeatherService weatherService;
|
||||
|
||||
@Value("${Ali.accesskeId}")
|
||||
private String accessKeyId;
|
||||
|
||||
@Value("${Ali.accesskeySecret}")
|
||||
private String accessKeySecret;
|
||||
|
||||
protected static com.aliyun.alimt20181012.Client transClient = null;
|
||||
protected static com.aliyun.teautil.models.RuntimeOptions transRuntime = new com.aliyun.teautil.models.RuntimeOptions();
|
||||
public Mono<Boolean> process(Action action, BaseSession baseSession) {
|
||||
log.info("天气 Action:{}", action.getAsk());
|
||||
ThirdWeatherInfoRequest req = new ThirdWeatherInfoRequest();
|
||||
@ -75,6 +89,28 @@ public class WeatherActionCommand extends ActionCommand implements IActionComma
|
||||
+ ",空气质量" + item.getAir_level()
|
||||
+ ",湿度" + item.getHumidity() + ",最低气温" + item.getTem2() + "°C " + msg;
|
||||
msg = msg.replace(" ", "");
|
||||
if(LanguageEnum.ENGLISH.getCode().equals(action.getLanguage())){
|
||||
try{
|
||||
if(transClient == null){
|
||||
transClient = WeatherActionCommand.createClient(accessKeyId, accessKeySecret);
|
||||
}
|
||||
com.aliyun.alimt20181012.models.TranslateGeneralRequest translateGeneralRequest = new com.aliyun.alimt20181012.models.TranslateGeneralRequest()
|
||||
.setSourceText(msg)
|
||||
.setTargetLanguage(LanguageEnum.ENGLISH.getName())
|
||||
.setSourceLanguage(LanguageEnum.CHINESE.getName())
|
||||
.setFormatType("text")
|
||||
.setScene("general");
|
||||
TranslateGeneralResponse response = transClient.translateGeneralWithOptions(translateGeneralRequest, transRuntime);
|
||||
TranslateGeneralResponseBody body = response.getBody();
|
||||
log.info("获取body:code{}, Message:{}", body.getCode(), body.getMessage());
|
||||
if(body.getCode().intValue() == 200){
|
||||
msg = body.getData().getTranslated();
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
log.info("阿里机器人翻译异常{}", e);
|
||||
}
|
||||
}
|
||||
if(baseSession instanceof BoxSession){
|
||||
WeatherResp weatherResp = new WeatherResp();
|
||||
weatherResp.setWeatherLocal(t.getCity());
|
||||
@ -86,7 +122,6 @@ public class WeatherActionCommand extends ActionCommand implements IActionComma
|
||||
resp.setText(msg);
|
||||
resp.setWeather(weatherResp);
|
||||
return baseWebSocketService.sendMessage(action, baseSession, resp);
|
||||
//return Mono.empty();
|
||||
}
|
||||
}else{
|
||||
msg = action.getSystemTalkAnswerConfigEntity().getAnswerValueFaild();
|
||||
@ -95,5 +130,17 @@ public class WeatherActionCommand extends ActionCommand implements IActionComma
|
||||
}
|
||||
return baseWebSocketService.sendMessage(action, baseSession, msg, action.getSystemTalkAnswerConfigEntity().getAnswerType());
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public static com.aliyun.alimt20181012.Client createClient(String accessKeyId, String accessKeySecret) throws Exception {
|
||||
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
|
||||
// 必填,您的 AccessKey ID
|
||||
.setAccessKeyId(accessKeyId)
|
||||
// 必填,您的 AccessKey Secret
|
||||
.setAccessKeySecret(accessKeySecret);
|
||||
// Endpoint 请参考 https://api.aliyun.com/product/alimt
|
||||
config.endpoint = "mt.cn-hangzhou.aliyuncs.com";
|
||||
return new com.aliyun.alimt20181012.Client(config);
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@ public class MysqlMain {
|
||||
}
|
||||
List<TablesBean> list = new ArrayList<>();
|
||||
|
||||
list.add(new TablesBean("system_talk_bind_user"));
|
||||
list.add(new TablesBean("device_alarm_clock_record"));
|
||||
//list.add(new TablesBean("system_same_talk"));
|
||||
|
||||
List<TablesBean> list2 = new ArrayList<TablesBean>();
|
||||
|
||||
@ -0,0 +1,91 @@
|
||||
package com.admin.service.impl;
|
||||
|
||||
|
||||
|
||||
import java.util.Date;
|
||||
import reactor.core.publisher.Mono;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.hswebframework.web.api.crud.entity.PagerResult;
|
||||
import org.hswebframework.web.exception.BusinessException;
|
||||
/**
|
||||
* <p>
|
||||
* 闹钟记录Controller类
|
||||
* </p>
|
||||
*
|
||||
* @author wulin
|
||||
* @since 2023-11-13
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/DeviceAlarmClockRecord")
|
||||
public class DeviceAlarmClockRecordController{
|
||||
|
||||
|
||||
@Autowired
|
||||
private DeviceAlarmClockRecordService deviceAlarmClockRecordService;
|
||||
@PostMapping("/info")
|
||||
public Mono<DeviceAlarmClockRecordResp> selectDeviceAlarmClockRecordByRequest(@RequestBody DeviceAlarmClockRecordRequest request){
|
||||
return deviceAlarmClockRecordService.selectDeviceAlarmClockRecordByRequest(request).map(d -> {return new DeviceAlarmClockRecordResp(d);});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/list")
|
||||
public Mono<PagerResult<DeviceAlarmClockRecordResp>> selectDeviceAlarmClockRecordsByRequest(@RequestBody DeviceAlarmClockRecordRequest request){
|
||||
return deviceAlarmClockRecordService.selectDeviceAlarmClockRecordsByRequest(request).map(d -> {
|
||||
PagerResult<DeviceAlarmClockRecordResp> result = new PagerResult<>();
|
||||
result.setPageIndex(d.getPageIndex());
|
||||
result.setPageSize(d.getPageSize());
|
||||
result.setTotal(d.getTotal());
|
||||
List<DeviceAlarmClockRecordResp> ds = d.getData().stream().map(new Function<DeviceAlarmClockRecordEntity, DeviceAlarmClockRecordResp>() {
|
||||
@Override
|
||||
public DeviceAlarmClockRecordResp apply(DeviceAlarmClockRecordEntity entity) {
|
||||
return new DeviceAlarmClockRecordResp(entity);
|
||||
}
|
||||
}
|
||||
|
||||
).collect(Collectors.toList());
|
||||
result.setData(ds);
|
||||
return result;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/id")
|
||||
public Mono<DeviceAlarmClockRecordResp> selectDeviceAlarmClockRecordById(@RequestParam Long id){
|
||||
return deviceAlarmClockRecordService.selectDeviceAlarmClockRecordById(id).map(d -> {return new DeviceAlarmClockRecordResp(d);});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/save")
|
||||
public Mono<Integer> insertDeviceAlarmClockRecord(@RequestBody DeviceAlarmClockRecordEntity entity){
|
||||
return deviceAlarmClockRecordService.insertDeviceAlarmClockRecord(entity);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/update")
|
||||
public Mono<Integer> updateDeviceAlarmClockRecordById(@RequestBody DeviceAlarmClockRecordEntity entity){
|
||||
return deviceAlarmClockRecordService.updateDeviceAlarmClockRecordById(entity);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/updateCover")
|
||||
public Mono<Integer> updateCoverDeviceAlarmClockRecordById(@RequestBody DeviceAlarmClockRecordEntity entity){
|
||||
return deviceAlarmClockRecordService.updateCoverDeviceAlarmClockRecordById(entity);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/delete")
|
||||
public Mono<Integer> deleteDeviceAlarmClockRecordById(@RequestParam Long id){
|
||||
return deviceAlarmClockRecordService.deleteDeviceAlarmClockRecordById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user