diff --git a/iot-modules/iot-customer-http-api/src/test/tmp/DeviceUserBindController.java b/iot-modules/iot-customer-http-api/src/test/tmp/DeviceUserBindController.java
deleted file mode 100644
index 641c28f..0000000
--- a/iot-modules/iot-customer-http-api/src/test/tmp/DeviceUserBindController.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package com.admin.service.impl;
-
-
-
-import org.apache.commons.lang3.StringUtils;
-import java.util.Date;
-/**
-*
-* 设备与用户绑定Controller类
-*
-*
-* @author wulin
-* @since 2023-10-07
-*/
-
-@RestController
-@Slf4j
-@RequestMapping("/DeviceUserBind")
-public class DeviceUserBindController{
-
-
- @Autowired
- private DeviceUserBindService deviceUserBindService;
- @PostMapping("/info")
- public Mono selectDeviceUserBindByRequest(@RequestBody DeviceUserBindRequest request){
- return deviceUserBindService.selectDeviceUserBindByRequest(request).map(d -> {return new DeviceUserBindResp(d);});
- }
-
-
-
- @PostMapping("/list")
- public Mono> selectDeviceUserBindsByRequest(@RequestBody DeviceUserBindRequest request){
- return deviceUserBindService.selectDeviceInfosByRequest(request).map(d -> {
- PagerResult result = new PagerResult<>();
- result.setPageIndex(d.getPageIndex());
- result.setPageSize(d.getPageSize());
- result.setTotal(d.getTotal());
- List ds = d.getData().stream().map(new Function() {
- @Override
- public DeviceInfoResp apply(DeviceUserBindEntity entity) {
- return new DeviceUserBindResp(entity);
- }
- }
-
- ).collect(Collectors.toList());
- result.setData(ds);
- return result;
- });
- }
-
-
-
- @GetMapping("/id")
- public Mono selectDeviceUserBindById(@RequestParam Long id){
- return deviceUserBindService.selectDeviceUserBindById(id).map(d -> {return new DeviceUserBindResp(d);});
- }
-
-
-
- @PostMapping("/save")
- public Mono insertDeviceUserBind(@RequestBody DeviceUserBindEntity entity){
- return deviceUserBindService.insertDeviceUserBind(entity);
- }
-
-
-
- @PostMapping("/update")
- public Mono updateDeviceUserBindById(@RequestBody DeviceUserBindEntity entity){
- return deviceUserBindService.updateDeviceUserBindById(entity);
- }
-
-
-
- @PostMapping("/updateCover")
- public Mono updateCoverDeviceUserBindById(@RequestBody DeviceUserBindEntity entity){
- return deviceUserBindService.updateCoverDeviceUserBindById(entity);
- }
-
-
-
- @PostMapping("/delete")
- public Mono deleteDeviceUserBindById(@RequestParam Long id){
- return deviceUserBindService.deleteDeviceUserBindById(id);
- }
-
-
-
-}
diff --git a/iot-modules/iot-customer-http-api/src/test/tmp/DeviceUserBindEntity.java b/iot-modules/iot-customer-http-api/src/test/tmp/DeviceUserBindEntity.java
deleted file mode 100644
index 0699160..0000000
--- a/iot-modules/iot-customer-http-api/src/test/tmp/DeviceUserBindEntity.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package com.qiuguo.iot.data.entity;
-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 lombok.Data;
-import java.util.Date;
-/**
-*
-*
*设备与用户绑定表
-* @author wulin
-* @since 2023-10-07
-*/
-
-@Data
-@Comment("设备与用户绑定表")
-@Table(name = "device_user_bind")
-@EnableEntityEvent
-public class DeviceUserBindEntity extends GenericEntity {
- @Comment("id")
- @Column(name = "id", length = 11, nullable = false, unique = true)
- private Long id;
-
- @Comment("是否删除:0 否 1 删除")
- @Column(name = "is_delete", nullable = false)
- private Integer isDelete;
-
- @Comment("创建时间")
- @Column(name = "create_time")
- private Date createTime;
-
- @Comment("修改时间")
- @Column(name = "modify_time")
- private Date modifyTime;
-
- @Comment("用户Id")
- @Column(name = "user_id", nullable = false)
- private Long userId;
-
- @Comment("设备类型:0 果Box 1 涂鸦设备 2智能大灯 3智能窗帘驱动 4智能窗户关闭 5智能台灯 6智能桌子 7智能椅子 8智能风扇 9智能空调(遥控器) 10智能冰箱 11智能洗碗机 12智能电热水器 13温度传感器 14空气质量传感器 15光线传感器 16雨量传感器 17闭门器")
- @Column(name = "device_type", nullable = false)
- private Integer deviceType;
-
- @Comment("设备id")
- @Column(name = "device_id", nullable = false)
- private Long deviceId;
-
- @Comment("三方设备id")
- @Column(name = "other_device_id", length = 100)
- private Long otherDeviceId;
-
- @Comment("涂鸦空间id")
- @Column(name = "space_id")
- private Long spaceId;
-
- @Comment("是否为主设备 1:是 0:不是")
- @Column(name = "is_main", nullable = false)
- private Integer isMain;
-
- @Comment("绑定设备名称(用户命名)")
- @Column(name = "bind_name", length = 100)
- private String bindName;
-
- @Comment("国家")
- @Column(name = "country", length = 100)
- private String country;
-
- @Comment("省")
- @Column(name = "province", length = 100)
- private String province;
-
- @Comment("市")
- @Column(name = "city", length = 100)
- private String city;
-
- @Comment("县、区")
- @Column(name = "county", length = 100)
- private String county;
-
- @Comment("乡镇")
- @Column(name = "village", length = 100)
- private String village;
-
- @Comment("乡镇以下地址")
- @Column(name = "address", length = 200)
- private String address;
-
- @Comment("第三方分类名称")
- @Column(name = "category_code", length = 100)
- private String categoryCode;
-
-}
\ No newline at end of file
diff --git a/iot-modules/iot-customer-http-api/src/test/tmp/DeviceUserBindRequest.java b/iot-modules/iot-customer-http-api/src/test/tmp/DeviceUserBindRequest.java
deleted file mode 100644
index 1950caf..0000000
--- a/iot-modules/iot-customer-http-api/src/test/tmp/DeviceUserBindRequest.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package com.qiuguo.iot.data.entity;
-import lombok.Data;
-import java.util.Date;
-/**
-*
-*设备与用户绑定请求类
-* @author wulin
-* @since 2023-10-07
-*/
-
-
-@Data
-public class DeviceUserBindRequest implements java.io.Serializable {
-
- private int currPage = 1;
- private int pageSize = 10;
- private String sort;
- private String order;
- //
- private Long id;
- //是否删除:0 否 1 删除
- private Integer isDelete;
- //创建时间
- private Date createTime;
- //创建时间搜索开始
-
- private Date createTimeStart;
-
- //创建时间搜索结束
- private Date createTimeEnd;
- //修改时间
- private Date modifyTime;
- //修改时间搜索开始
-
- private Date modifyTimeStart;
-
- //修改时间搜索结束
- private Date modifyTimeEnd;
- //用户Id
- private Long userId;
- //设备类型:0 果Box 1 涂鸦设备 2智能大灯 3智能窗帘驱动 4智能窗户关闭 5智能台灯 6智能桌子 7智能椅子 8智能风扇 9智能空调(遥控器) 10智能冰箱 11智能洗碗机 12智能电热水器 13温度传感器 14空气质量传感器 15光线传感器 16雨量传感器 17闭门器
- private Integer deviceType;
- //设备id
- private Long deviceId;
- //三方设备id
- private Long otherDeviceId;
- //涂鸦空间id
- private Long spaceId;
- //是否为主设备 1:是 0:不是
- private Integer isMain;
- //绑定设备名称(用户命名)
- private String bindName;
- //国家
- private String country;
- //省
- private String province;
- //市
- private String city;
- //县、区
- private String county;
- //乡镇
- private String village;
- //乡镇以下地址
- private String address;
- //第三方分类名称
- private String categoryCode;
-}
\ No newline at end of file
diff --git a/iot-modules/iot-customer-http-api/src/test/tmp/DeviceUserBindResp.java b/iot-modules/iot-customer-http-api/src/test/tmp/DeviceUserBindResp.java
deleted file mode 100644
index 2658144..0000000
--- a/iot-modules/iot-customer-http-api/src/test/tmp/DeviceUserBindResp.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package com.qiuguo.iot.data.entity;
-import lombok.Data;
-import java.util.Date;
-/**
-*
-*
*设备与用户绑定返回类
-* @author wulin
-* @since 2023-10-07
-*/
-
-@Data
-public class DeviceUserBindResp {
- public DeviceUserBindResp(){
- }
- public DeviceUserBindResp(DeviceUserBindEntity entity){
- id = entity.getId();
- createTime = entity.getCreateTime();
- modifyTime = entity.getModifyTime();
- userId = entity.getUserId();
- deviceType = entity.getDeviceType();
- deviceId = entity.getDeviceId();
- otherDeviceId = entity.getOtherDeviceId();
- spaceId = entity.getSpaceId();
- isMain = entity.getIsMain();
- bindName = entity.getBindName();
- country = entity.getCountry();
- province = entity.getProvince();
- city = entity.getCity();
- county = entity.getCounty();
- village = entity.getVillage();
- address = entity.getAddress();
- categoryCode = entity.getCategoryCode();
- }
-
- //
- private Long id;
- //创建时间
- private Date createTime;
- //修改时间
- private Date modifyTime;
- //用户Id
- private Long userId;
- //设备类型:0 果Box 1 涂鸦设备 2智能大灯 3智能窗帘驱动 4智能窗户关闭 5智能台灯 6智能桌子 7智能椅子 8智能风扇 9智能空调(遥控器) 10智能冰箱 11智能洗碗机 12智能电热水器 13温度传感器 14空气质量传感器 15光线传感器 16雨量传感器 17闭门器
- private Integer deviceType;
- //设备id
- private Long deviceId;
- //三方设备id
- private Long otherDeviceId;
- //涂鸦空间id
- private Long spaceId;
- //是否为主设备 1:是 0:不是
- private Integer isMain;
- //绑定设备名称(用户命名)
- private String bindName;
- //国家
- private String country;
- //省
- private String province;
- //市
- private String city;
- //县、区
- private String county;
- //乡镇
- private String village;
- //乡镇以下地址
- private String address;
- //第三方分类名称
- private String categoryCode;
-}
\ No newline at end of file
diff --git a/iot-modules/iot-customer-http-api/src/test/tmp/DeviceUserBindService.java b/iot-modules/iot-customer-http-api/src/test/tmp/DeviceUserBindService.java
deleted file mode 100644
index f533b37..0000000
--- a/iot-modules/iot-customer-http-api/src/test/tmp/DeviceUserBindService.java
+++ /dev/null
@@ -1,279 +0,0 @@
-package com.admin.service.impl;
-
-
-
-import org.apache.commons.lang3.StringUtils;
-import java.util.Date;
-/**
-*
-* 设备与用户绑定服务类
-*
-*
-* @author wulin
-* @since 2023-10-07
-*/
-
-@Service
-@Slf4j
-public class DeviceUserBindService extends GenericReactiveCrudService {
-
-
- public Mono selectDeviceUserBindByRequest(DeviceUserBindRequest request){
- ReactiveQuery reactiveQuery = createQuery();
- reactiveQuery = reactiveQuery.and("is_delete", 0);
- if(request.getId() != null){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getId, request.getId());
- }
- if(request.getIsDelete() != null){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getIsDelete, request.getIsDelete());
- }
- if(request.getCreateTime() != null){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getCreateTime, request.getCreateTime());
- }
- if(request.getModifyTime() != null){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getModifyTime, request.getModifyTime());
- }
- if(request.getUserId() != null){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getUserId, request.getUserId());
- }
- if(request.getDeviceType() != null){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getDeviceType, request.getDeviceType());
- }
- if(request.getDeviceId() != null){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getDeviceId, request.getDeviceId());
- }
- if(request.getOtherDeviceId() != null){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getOtherDeviceId, request.getOtherDeviceId());
- }
- if(request.getSpaceId() != null){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getSpaceId, request.getSpaceId());
- }
- if(request.getIsMain() != null){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getIsMain, request.getIsMain());
- }
- if(StringUtils.isNotEmpty(request.getBindName())){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getBindName, request.getBindName());
- }
- if(StringUtils.isNotEmpty(request.getCountry())){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getCountry, request.getCountry());
- }
- if(StringUtils.isNotEmpty(request.getProvince())){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getProvince, request.getProvince());
- }
- if(StringUtils.isNotEmpty(request.getCity())){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getCity, request.getCity());
- }
- if(StringUtils.isNotEmpty(request.getCounty())){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getCounty, request.getCounty());
- }
- if(StringUtils.isNotEmpty(request.getVillage())){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getVillage, request.getVillage());
- }
- if(StringUtils.isNotEmpty(request.getAddress())){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getAddress, request.getAddress());
- }
- if(StringUtils.isNotEmpty(request.getCategoryCode())){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getCategoryCode, request.getCategoryCode());
- }
- SortOrder sortOrder = null;
- if(StringUtils.isNotEmpty(request.getOrder())){
- if(StringUtils.isNotEmpty(request.getSort()) && request.getSort().compareTo("0") == 0){
- sortOrder = SortOrder.desc(request.getOrder());
- }else{
- sortOrder = SortOrder.asc(request.getOrder());
- }
- reactiveQuery = reactiveQuery.orderBy(sortOrder);
- }
- return reactiveQuery.fetchOne();
- }
-
-
-
- public Mono> selectDeviceUserBindsByRequest(DeviceUserBindRequest request){
- ReactiveQuery reactiveQuery = createQuery();
- reactiveQuery = reactiveQuery.and("is_delete", 0);
- if(request.getId() != null){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getId, request.getId());
- }
- if(request.getIsDelete() != null){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getIsDelete, request.getIsDelete());
- }
- if(request.getCreateTimeStart() != null){
- reactiveQuery = reactiveQuery.gte(DeviceUserBindRequest::getCreateTime, request.getCreateTimeStart());
- }
- if(request.getCreateTimeEnd() != null){
- reactiveQuery = reactiveQuery.lte(DeviceUserBindRequest::getCreateTime, request.getCreateTimeEnd());
- }
- if(request.getModifyTimeStart() != null){
- reactiveQuery = reactiveQuery.gte(DeviceUserBindRequest::getModifyTime, request.getModifyTimeStart());
- }
- if(request.getModifyTimeEnd() != null){
- reactiveQuery = reactiveQuery.lte(DeviceUserBindRequest::getModifyTime, request.getModifyTimeEnd());
- }
- if(request.getUserId() != null){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getUserId, request.getUserId());
- }
- if(request.getDeviceType() != null){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getDeviceType, request.getDeviceType());
- }
- if(request.getDeviceId() != null){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getDeviceId, request.getDeviceId());
- }
- if(request.getOtherDeviceId() != null){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getOtherDeviceId, request.getOtherDeviceId());
- }
- if(request.getSpaceId() != null){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getSpaceId, request.getSpaceId());
- }
- if(request.getIsMain() != null){
- reactiveQuery = reactiveQuery.and(DeviceUserBindRequest::getIsMain, request.getIsMain());
- }
- if(StringUtils.isNotEmpty(request.getBindName())){
- reactiveQuery = reactiveQuery.$like$(DeviceUserBindRequest::getBindName, request.getBindName());
- }
- if(StringUtils.isNotEmpty(request.getCountry())){
- reactiveQuery = reactiveQuery.$like$(DeviceUserBindRequest::getCountry, request.getCountry());
- }
- if(StringUtils.isNotEmpty(request.getProvince())){
- reactiveQuery = reactiveQuery.$like$(DeviceUserBindRequest::getProvince, request.getProvince());
- }
- if(StringUtils.isNotEmpty(request.getCity())){
- reactiveQuery = reactiveQuery.$like$(DeviceUserBindRequest::getCity, request.getCity());
- }
- if(StringUtils.isNotEmpty(request.getCounty())){
- reactiveQuery = reactiveQuery.$like$(DeviceUserBindRequest::getCounty, request.getCounty());
- }
- if(StringUtils.isNotEmpty(request.getVillage())){
- reactiveQuery = reactiveQuery.$like$(DeviceUserBindRequest::getVillage, request.getVillage());
- }
- if(StringUtils.isNotEmpty(request.getAddress())){
- reactiveQuery = reactiveQuery.$like$(DeviceUserBindRequest::getAddress, request.getAddress());
- }
- if(StringUtils.isNotEmpty(request.getCategoryCode())){
- reactiveQuery = reactiveQuery.$like$(DeviceUserBindRequest::getCategoryCode, request.getCategoryCode());
- }
- QueryParamEntity param = QueryParamEntity.of(reactiveQuery.getParam());
- if(StringUtils.isNotEmpty(request.getOrder())){
- Sort sort = new Sort();
- sort.setName(request.getOrder());
- if(StringUtils.isNotEmpty(request.getSort()) && request.getSort().compareTo("0") == 0){
- sort.desc();
- }else{
- sort.asc();
- }
- param.setSorts(Arrays.asList(sort));
- }
- param.setPageIndex(request.getCurrPage());
- param.setPageSize(request.getPageSize());
- param.setPaging(true);
- param.setFirstPageIndex(1);
- return queryPager(param);
- }
-
-
-
- public Mono selectDeviceUserBindById(Long id){
- return createQuery()
- .and("is_delete", 0)
- .and("id", id)
- .fetchOne();
- }
-
-
-
- public Mono insertDeviceUserBind(DeviceUserBindEntity entity){
- entity.setId(null);
- entity.setCreateTime(null);
- entity.setModifyTime(null);
- return insert(entity);
- }
-
-
-
- public Mono updateDeviceUserBindById(DeviceUserBindEntity entity){
- ReactiveUpdate update = createUpdate()
- .set(DeviceUserBindEntity::getModifyTime, new Date());
- if(entity.getIsDelete() != null){
- update = update.set(DeviceUserBindEntity::getIsDelete, entity.getIsDelete());
- }
- if(entity.getUserId() != null){
- update = update.set(DeviceUserBindEntity::getUserId, entity.getUserId());
- }
- if(entity.getDeviceType() != null){
- update = update.set(DeviceUserBindEntity::getDeviceType, entity.getDeviceType());
- }
- if(entity.getDeviceId() != null){
- update = update.set(DeviceUserBindEntity::getDeviceId, entity.getDeviceId());
- }
- if(entity.getOtherDeviceId() != null){
- update = update.set(DeviceUserBindEntity::getOtherDeviceId, entity.getOtherDeviceId());
- }
- if(entity.getSpaceId() != null){
- update = update.set(DeviceUserBindEntity::getSpaceId, entity.getSpaceId());
- }
- if(entity.getIsMain() != null){
- update = update.set(DeviceUserBindEntity::getIsMain, entity.getIsMain());
- }
- if(StringUtils.isNotEmpty(entity.getBindName())){
- update = update.set(DeviceUserBindEntity::getBindName, entity.getBindName());
- }
- if(StringUtils.isNotEmpty(entity.getCountry())){
- update = update.set(DeviceUserBindEntity::getCountry, entity.getCountry());
- }
- if(StringUtils.isNotEmpty(entity.getProvince())){
- update = update.set(DeviceUserBindEntity::getProvince, entity.getProvince());
- }
- if(StringUtils.isNotEmpty(entity.getCity())){
- update = update.set(DeviceUserBindEntity::getCity, entity.getCity());
- }
- if(StringUtils.isNotEmpty(entity.getCounty())){
- update = update.set(DeviceUserBindEntity::getCounty, entity.getCounty());
- }
- if(StringUtils.isNotEmpty(entity.getVillage())){
- update = update.set(DeviceUserBindEntity::getVillage, entity.getVillage());
- }
- if(StringUtils.isNotEmpty(entity.getAddress())){
- update = update.set(DeviceUserBindEntity::getAddress, entity.getAddress());
- }
- if(StringUtils.isNotEmpty(entity.getCategoryCode())){
- update = update.set(DeviceUserBindEntity::getCategoryCode, entity.getCategoryCode());
- }
- return update.where(DeviceUserBindEntity::getId, entity.getId()).and("is_delete", 0).execute();
- }
-
-
-
- public Mono updateCoverDeviceUserBindById(DeviceUserBindEntity entity){
- ReactiveUpdate update = createUpdate()
- .set(DeviceUserBindEntity::getModifyTime, new Date());
- update = update.set(DeviceUserBindEntity::getIsDelete, entity.getIsDelete());
- update = update.set(DeviceUserBindEntity::getUserId, entity.getUserId());
- update = update.set(DeviceUserBindEntity::getDeviceType, entity.getDeviceType());
- update = update.set(DeviceUserBindEntity::getDeviceId, entity.getDeviceId());
- update = update.set(DeviceUserBindEntity::getOtherDeviceId, entity.getOtherDeviceId());
- update = update.set(DeviceUserBindEntity::getSpaceId, entity.getSpaceId());
- update = update.set(DeviceUserBindEntity::getIsMain, entity.getIsMain());
- update = update.set(DeviceUserBindEntity::getBindName, entity.getBindName());
- update = update.set(DeviceUserBindEntity::getCountry, entity.getCountry());
- update = update.set(DeviceUserBindEntity::getProvince, entity.getProvince());
- update = update.set(DeviceUserBindEntity::getCity, entity.getCity());
- update = update.set(DeviceUserBindEntity::getCounty, entity.getCounty());
- update = update.set(DeviceUserBindEntity::getVillage, entity.getVillage());
- update = update.set(DeviceUserBindEntity::getAddress, entity.getAddress());
- update = update.set(DeviceUserBindEntity::getCategoryCode, entity.getCategoryCode());
- return update.where(DeviceUserBindEntity::getId, entity.getId()).and("is_delete", 0).execute();
- }
-
-
-
- public Mono deleteDeviceUserBindById(Long id){
- return createUpdate()
- .set("is_delete", 1)
- .set("modify_time", new Date())
- .where("id", id)
- .execute();
- }
-
-
-
-}