Merge branch 'pr_15' into dev-V0.4.5

V0.5.x
xiwa 2023-07-07 23:29:18 +08:00
commit cab2c85d81
82 changed files with 186 additions and 309 deletions

View File

@ -1,5 +1,6 @@
package cc.iotkit.common.enums; package cc.iotkit.common.enums;
import cc.iotkit.common.exception.BizException;
import cc.iotkit.common.utils.StringUtils; import cc.iotkit.common.utils.StringUtils;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
@ -32,6 +33,6 @@ public enum UserType {
return value; return value;
} }
} }
throw new RuntimeException("'UserType' not found By " + str); throw new BizException("'UserType' not found By " + str);
} }
} }

View File

@ -10,7 +10,6 @@
package cc.iotkit.common.exception.user; package cc.iotkit.common.exception.user;
import cc.iotkit.common.enums.ErrCode; import cc.iotkit.common.enums.ErrCode;
import cc.iotkit.common.exception.BaseException;
import cc.iotkit.common.exception.BizException; import cc.iotkit.common.exception.BizException;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;

View File

@ -16,6 +16,7 @@ import org.apache.commons.lang3.StringUtils;
import javax.crypto.Cipher; import javax.crypto.Cipher;
import javax.crypto.KeyGenerator; import javax.crypto.KeyGenerator;
import javax.crypto.spec.SecretKeySpec; import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.StandardCharsets;
public class CodecUtil { public class CodecUtil {
@ -38,7 +39,7 @@ public class CodecUtil {
* @return byte[] * @return byte[]
* @throws Exception * @throws Exception
*/ */
private static byte[] base64Decode(String base64Code) throws Exception { private static byte[] base64Decode(String base64Code) {
return StringUtils.isEmpty(base64Code) ? null : new Base64().decode(base64Code); return StringUtils.isEmpty(base64Code) ? null : new Base64().decode(base64Code);
} }
@ -56,7 +57,7 @@ public class CodecUtil {
Cipher cipher = Cipher.getInstance(ALGORITHMSTR); Cipher cipher = Cipher.getInstance(ALGORITHMSTR);
cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(encryptKey.getBytes(), "AES")); cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(encryptKey.getBytes(), "AES"));
return cipher.doFinal(content.getBytes("utf-8")); return cipher.doFinal(content.getBytes(StandardCharsets.UTF_8));
} }

View File

@ -128,9 +128,9 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
* *
*/ */
public static String getDatePoor(Date endDate, Date nowDate) { public static String getDatePoor(Date endDate, Date nowDate) {
long nd = 1000 * 24 * 60 * 60; long nd = 1000 * 24 * 60 * 60L;
long nh = 1000 * 60 * 60; long nh = 1000 * 60 * 60L;
long nm = 1000 * 60; long nm = 1000 * 60L;
// long ns = 1000; // long ns = 1000;
// 获得两个时间的毫秒时间差异 // 获得两个时间的毫秒时间差异
long diff = endDate.getTime() - nowDate.getTime(); long diff = endDate.getTime() - nowDate.getTime();

View File

@ -12,6 +12,7 @@ import lombok.NoArgsConstructor;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
@ -98,7 +99,7 @@ public class JsonUtils {
public static List<Dict> parseArrayMap(String text) { public static List<Dict> parseArrayMap(String text) {
if (StringUtils.isBlank(text)) { if (StringUtils.isBlank(text)) {
return null; return Collections.emptyList();
} }
try { try {
return OBJECT_MAPPER.readValue(text, OBJECT_MAPPER.getTypeFactory().constructCollectionType(List.class, Dict.class)); return OBJECT_MAPPER.readValue(text, OBJECT_MAPPER.getTypeFactory().constructCollectionType(List.class, Dict.class));

View File

@ -10,6 +10,7 @@ import lombok.NoArgsConstructor;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -65,7 +66,7 @@ public class MapstructUtils {
*/ */
public static <T, V> List<V> convert(List<T> sourceList, Class<V> desc) { public static <T, V> List<V> convert(List<T> sourceList, Class<V> desc) {
if (ObjectUtil.isNull(sourceList)) { if (ObjectUtil.isNull(sourceList)) {
return null; return Collections.emptyList();
} }
if (CollUtil.isEmpty(sourceList)) { if (CollUtil.isEmpty(sourceList)) {
return CollUtil.newArrayList(); return CollUtil.newArrayList();

View File

@ -8,6 +8,7 @@ import cn.hutool.core.lang.tree.parser.NodeParser;
import lombok.AccessLevel; import lombok.AccessLevel;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.util.Collections;
import java.util.List; import java.util.List;
/** /**
@ -25,7 +26,7 @@ public class TreeBuildUtils extends TreeUtil {
public static <T, K> List<Tree<K>> build(List<T> list, NodeParser<T, K> nodeParser) { public static <T, K> List<Tree<K>> build(List<T> list, NodeParser<T, K> nodeParser) {
if (CollUtil.isEmpty(list)) { if (CollUtil.isEmpty(list)) {
return null; return Collections.emptyList();
} }
K k = ReflectUtils.invokeGetter(list.get(0), "parentId"); K k = ReflectUtils.invokeGetter(list.get(0), "parentId");
return TreeUtil.build(list, k, DEFAULT_CONFIG, nodeParser); return TreeUtil.build(list, k, DEFAULT_CONFIG, nodeParser);

View File

@ -3,8 +3,6 @@ package cc.iotkit.data.manager;
import cc.iotkit.data.ICommonData; import cc.iotkit.data.ICommonData;
import cc.iotkit.model.ota.OtaPackage; import cc.iotkit.model.ota.OtaPackage;
import java.util.List;
/** /**
* @Author: * @Author:
* @Date: 2023/5/19 21:46 * @Date: 2023/5/19 21:46

View File

@ -1,7 +1,6 @@
package cc.iotkit.data.system; package cc.iotkit.data.system;
import cc.iotkit.common.api.Paging;
import cc.iotkit.data.ICommonData; import cc.iotkit.data.ICommonData;
import cc.iotkit.model.system.SysDept; import cc.iotkit.model.system.SysDept;

View File

@ -1,9 +1,7 @@
package cc.iotkit.data.system; package cc.iotkit.data.system;
import cc.iotkit.data.ICommonData; import cc.iotkit.data.ICommonData;
import cc.iotkit.common.api.Paging;
import cc.iotkit.model.system.SysDictData; import cc.iotkit.model.system.SysDictData;
import cc.iotkit.model.system.SysDictType;
import java.util.List; import java.util.List;

View File

@ -1,9 +1,8 @@
package cc.iotkit.data.system; package cc.iotkit.data.system;
import cc.iotkit.data.ICommonData;
import cc.iotkit.common.api.Paging; import cc.iotkit.common.api.Paging;
import cc.iotkit.data.ICommonData;
import cc.iotkit.model.system.SysDictType; import cc.iotkit.model.system.SysDictType;
import cc.iotkit.model.system.SysUser;
import java.util.List; import java.util.List;

View File

@ -1,7 +1,6 @@
package cc.iotkit.data.system; package cc.iotkit.data.system;
import cc.iotkit.data.ICommonData; import cc.iotkit.data.ICommonData;
import cc.iotkit.model.system.SysOperLog;
import cc.iotkit.model.system.SysOssConfig; import cc.iotkit.model.system.SysOssConfig;
/** /**

View File

@ -1,10 +1,10 @@
package cc.iotkit.data.service; package cc.iotkit.data.service;
import cc.iotkit.common.api.PageRequest; import cc.iotkit.common.api.PageRequest;
import cc.iotkit.common.constant.Constants;
import cc.iotkit.data.manager.ICategoryData;
import cc.iotkit.data.cache.CategoryCacheEvict;
import cc.iotkit.common.api.Paging; import cc.iotkit.common.api.Paging;
import cc.iotkit.common.constant.Constants;
import cc.iotkit.data.cache.CategoryCacheEvict;
import cc.iotkit.data.manager.ICategoryData;
import cc.iotkit.model.product.Category; import cc.iotkit.model.product.Category;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
@ -12,6 +12,7 @@ import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Collection; import java.util.Collection;
import java.util.Collections;
import java.util.List; import java.util.List;
@Service @Service
@ -31,7 +32,7 @@ public class CategoryDataCache implements ICategoryData {
@Override @Override
public List<Category> findByIds(Collection<String> id) { public List<Category> findByIds(Collection<String> id) {
return null; return Collections.emptyList();
} }
@Override @Override
@ -73,7 +74,7 @@ public class CategoryDataCache implements ICategoryData {
@Override @Override
public List<Category> findAllByCondition(Category data) { public List<Category> findAllByCondition(Category data) {
return null; return Collections.emptyList();
} }
@Override @Override

View File

@ -65,7 +65,7 @@ public class DeviceInfoDataCache implements IDeviceInfoData, SmartInitializingSi
pageRequest.setPageSize(1000); pageRequest.setPageSize(1000);
pageRequest.setPageNum(page); pageRequest.setPageNum(page);
while ((paged = deviceInfoData.findAll(pageRequest)).getRows().size() > 0) { while (!(paged = deviceInfoData.findAll(pageRequest)).getRows().isEmpty()) {
pageRequest.setPageNum(page++); pageRequest.setPageNum(page++);
List<DeviceInfo> devices = paged.getRows(); List<DeviceInfo> devices = paged.getRows();
for (DeviceInfo device : devices) { for (DeviceInfo device : devices) {
@ -282,7 +282,7 @@ public class DeviceInfoDataCache implements IDeviceInfoData, SmartInitializingSi
@Override @Override
public List<DeviceInfo> findAllByCondition(DeviceInfo data) { public List<DeviceInfo> findAllByCondition(DeviceInfo data) {
return null; return Collections.emptyList();
} }
@Override @Override

View File

@ -10,17 +10,18 @@
package cc.iotkit.data.service; package cc.iotkit.data.service;
import cc.iotkit.common.api.PageRequest; import cc.iotkit.common.api.PageRequest;
import cc.iotkit.common.constant.Constants;
import cc.iotkit.data.manager.IOauthClientData;
import cc.iotkit.data.cache.OauthClientCacheEvict;
import cc.iotkit.model.OauthClient;
import cc.iotkit.common.api.Paging; import cc.iotkit.common.api.Paging;
import cc.iotkit.common.constant.Constants;
import cc.iotkit.data.cache.OauthClientCacheEvict;
import cc.iotkit.data.manager.IOauthClientData;
import cc.iotkit.model.OauthClient;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Collection; import java.util.Collection;
import java.util.Collections;
import java.util.List; import java.util.List;
@Service @Service
@ -45,7 +46,7 @@ public class OauthClientDataCache implements IOauthClientData {
@Override @Override
public List<OauthClient> findByIds(Collection<String> id) { public List<OauthClient> findByIds(Collection<String> id) {
return null; return Collections.emptyList();
} }
@Override @Override
@ -88,7 +89,7 @@ public class OauthClientDataCache implements IOauthClientData {
@Override @Override
public List<OauthClient> findAllByCondition(OauthClient data) { public List<OauthClient> findAllByCondition(OauthClient data) {
return null; return Collections.emptyList();
} }
@Override @Override

View File

@ -14,8 +14,6 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
public interface DeviceGroupRepository extends JpaRepository<TbDeviceGroup, String> { public interface DeviceGroupRepository extends JpaRepository<TbDeviceGroup, String> {
Page<TbDeviceGroup> findByNameLike(String name, Pageable pageable); Page<TbDeviceGroup> findByNameLike(String name, Pageable pageable);

View File

@ -1,8 +1,6 @@
package cc.iotkit.data.dao; package cc.iotkit.data.dao;
import cc.iotkit.data.model.TbDeviceInfo; import cc.iotkit.data.model.TbDeviceInfo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.querydsl.QuerydslPredicateExecutor; import org.springframework.data.querydsl.QuerydslPredicateExecutor;

View File

@ -5,11 +5,8 @@ import cc.iotkit.common.api.Paging;
import cc.iotkit.common.utils.MapstructUtils; import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.data.ICommonData; import cc.iotkit.data.ICommonData;
import cc.iotkit.data.util.PageBuilder; import cc.iotkit.data.util.PageBuilder;
import cc.iotkit.data.util.PredicateBuilder;
import cc.iotkit.model.Id; import cc.iotkit.model.Id;
import com.querydsl.core.types.Predicate;
import org.springframework.data.domain.Example; import org.springframework.data.domain.Example;
import org.springframework.data.domain.ExampleMatcher;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
@ -33,6 +30,7 @@ public interface IJPACommData< T extends Id<ID>, ID> extends ICommonData<T , ID
Class getTClass(); Class getTClass();
@Override
default T findById(ID id) { default T findById(ID id) {
return (T) MapstructUtils.convert(getBaseRepository().findById(id).orElse(null), getTClass()); return (T) MapstructUtils.convert(getBaseRepository().findById(id).orElse(null), getTClass());
} }

View File

@ -9,7 +9,6 @@
*/ */
package cc.iotkit.data.dao; package cc.iotkit.data.dao;
import cc.iotkit.data.model.TbSysRole;
import cc.iotkit.data.model.TbSysRoleDept; import cc.iotkit.data.model.TbSysRoleDept;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.querydsl.QuerydslPredicateExecutor; import org.springframework.data.querydsl.QuerydslPredicateExecutor;

View File

@ -9,7 +9,6 @@
*/ */
package cc.iotkit.data.dao; package cc.iotkit.data.dao;
import cc.iotkit.data.model.TbSysRoleDept;
import cc.iotkit.data.model.TbSysRoleMenu; import cc.iotkit.data.model.TbSysRoleMenu;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.querydsl.QuerydslPredicateExecutor; import org.springframework.data.querydsl.QuerydslPredicateExecutor;

View File

@ -1,18 +1,16 @@
package cc.iotkit.data.model; package cc.iotkit.data.model;
import cc.iotkit.model.alert.AlertConfig;
import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import cc.iotkit.model.alert.AlertConfig;
import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;
@Data @Data
@Entity @Entity
//@ApiModel(value = "告警记录") //@ApiModel(value = "告警记录")

View File

@ -1,6 +1,5 @@
package cc.iotkit.data.model; package cc.iotkit.data.model;
import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;

View File

@ -9,7 +9,6 @@
*/ */
package cc.iotkit.data.model; package cc.iotkit.data.model;
import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;

View File

@ -9,7 +9,6 @@
*/ */
package cc.iotkit.data.model; package cc.iotkit.data.model;
import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;

View File

@ -10,7 +10,6 @@
package cc.iotkit.data.model; package cc.iotkit.data.model;
import cc.iotkit.model.rule.RuleInfo; import cc.iotkit.model.rule.RuleInfo;
import cc.iotkit.model.rule.RuleLog;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMapping; import io.github.linpeilie.annotations.AutoMapping;
import io.github.linpeilie.annotations.ReverseAutoMapping; import io.github.linpeilie.annotations.ReverseAutoMapping;

View File

@ -1,18 +1,16 @@
package cc.iotkit.data.model; package cc.iotkit.data.model;
import cc.iotkit.data.model.BaseEntity;
import cc.iotkit.model.system.SysConfig; import cc.iotkit.model.system.SysConfig;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import javax.persistence.GeneratedValue;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
/** /**
* sys_config * sys_config

View File

@ -1,7 +1,5 @@
package cc.iotkit.data.model; package cc.iotkit.data.model;
import cc.iotkit.data.model.BaseEntity;
import cc.iotkit.model.system.SysDictData;
import cc.iotkit.model.system.SysDictType; import cc.iotkit.model.system.SysDictType;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;

View File

@ -1,6 +1,5 @@
package cc.iotkit.data.model; package cc.iotkit.data.model;
import cc.iotkit.data.model.BaseEntity;
import cc.iotkit.model.system.SysOss; import cc.iotkit.model.system.SysOss;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;

View File

@ -1,6 +1,5 @@
package cc.iotkit.data.model; package cc.iotkit.data.model;
import cc.iotkit.data.model.BaseEntity;
import cc.iotkit.model.system.SysOssConfig; import cc.iotkit.model.system.SysOssConfig;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;

View File

@ -1,14 +1,13 @@
package cc.iotkit.data.service; package cc.iotkit.data.service;
import cc.iotkit.common.api.PageRequest; import cc.iotkit.common.api.PageRequest;
import cc.iotkit.common.api.Paging;
import cc.iotkit.common.utils.MapstructUtils; import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.data.dao.AlertConfigRepository;
import cc.iotkit.data.dao.IJPACommData; import cc.iotkit.data.dao.IJPACommData;
import cc.iotkit.data.manager.IAlertConfigData; import cc.iotkit.data.manager.IAlertConfigData;
import cc.iotkit.data.dao.AlertConfigRepository;
import cc.iotkit.data.model.TbAlertConfig; import cc.iotkit.data.model.TbAlertConfig;
import cc.iotkit.common.api.Paging;
import cc.iotkit.model.alert.AlertConfig; import cc.iotkit.model.alert.AlertConfig;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
@ -16,10 +15,6 @@ import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.List;
import java.util.UUID;
@Primary @Primary
@Service @Service
public class AlertConfigDataImpl implements IAlertConfigData, IJPACommData<AlertConfig, Long> { public class AlertConfigDataImpl implements IAlertConfigData, IJPACommData<AlertConfig, Long> {

View File

@ -1,17 +1,13 @@
package cc.iotkit.data.service; package cc.iotkit.data.service;
import cc.iotkit.common.api.PageRequest; import cc.iotkit.common.api.PageRequest;
import cc.iotkit.common.api.Paging;
import cc.iotkit.common.utils.MapstructUtils; import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.data.dao.AlertRecordRepository;
import cc.iotkit.data.dao.IJPACommData; import cc.iotkit.data.dao.IJPACommData;
import cc.iotkit.data.manager.IAlertRecordData; import cc.iotkit.data.manager.IAlertRecordData;
import cc.iotkit.data.dao.AlertRecordRepository;
import cc.iotkit.data.model.TbAlertRecord; import cc.iotkit.data.model.TbAlertRecord;
import cc.iotkit.common.api.Paging;
import cc.iotkit.model.alert.AlertRecord; import cc.iotkit.model.alert.AlertRecord;
import java.util.Collection;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;

View File

@ -9,21 +9,19 @@
*/ */
package cc.iotkit.data.service; package cc.iotkit.data.service;
import cc.iotkit.common.api.PageRequest;
import cc.iotkit.common.utils.MapstructUtils; import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.data.dao.CategoryRepository;
import cc.iotkit.data.dao.IJPACommData; import cc.iotkit.data.dao.IJPACommData;
import cc.iotkit.data.manager.ICategoryData; import cc.iotkit.data.manager.ICategoryData;
import cc.iotkit.data.dao.CategoryRepository;
import cc.iotkit.data.model.TbCategory; import cc.iotkit.data.model.TbCategory;
import cc.iotkit.common.api.Paging;
import cc.iotkit.model.product.Category; import cc.iotkit.model.product.Category;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Collection; import java.util.Collection;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -56,7 +54,7 @@ public class CategoryDataImpl implements ICategoryData, IJPACommData<Category, S
@Override @Override
public List<Category> findByIds(Collection<String> id) { public List<Category> findByIds(Collection<String> id) {
return null; return Collections.emptyList();
} }
@Override @Override

View File

@ -11,6 +11,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -61,7 +62,7 @@ public class ChannelTemplateDataImpl implements IChannelTemplateData, IJPACommDa
@Override @Override
public List<ChannelTemplate> findAllByCondition(ChannelTemplate data) { public List<ChannelTemplate> findAllByCondition(ChannelTemplate data) {
return null; return Collections.emptyList();
} }
@Override @Override

View File

@ -9,25 +9,18 @@
*/ */
package cc.iotkit.data.service; package cc.iotkit.data.service;
import cc.iotkit.common.api.PageRequest;
import cc.iotkit.common.utils.MapstructUtils; import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.data.dao.DeviceConfigRepository;
import cc.iotkit.data.dao.IJPACommData; import cc.iotkit.data.dao.IJPACommData;
import cc.iotkit.data.manager.IDeviceConfigData; import cc.iotkit.data.manager.IDeviceConfigData;
import cc.iotkit.data.dao.DeviceConfigRepository;
import cc.iotkit.data.model.TbDeviceConfig; import cc.iotkit.data.model.TbDeviceConfig;
import cc.iotkit.common.api.Paging;
import cc.iotkit.model.device.DeviceConfig; import cc.iotkit.model.device.DeviceConfig;
import org.apache.commons.collections.IteratorUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.List;
import java.util.UUID; import java.util.UUID;
@Primary @Primary

View File

@ -1,12 +1,11 @@
package cc.iotkit.data.service; package cc.iotkit.data.service;
import cc.iotkit.common.api.PageRequest; import cc.iotkit.common.api.Paging;
import cc.iotkit.common.utils.MapstructUtils; import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.data.dao.DeviceGroupRepository;
import cc.iotkit.data.dao.IJPACommData; import cc.iotkit.data.dao.IJPACommData;
import cc.iotkit.data.manager.IDeviceGroupData; import cc.iotkit.data.manager.IDeviceGroupData;
import cc.iotkit.data.dao.DeviceGroupRepository;
import cc.iotkit.data.model.TbDeviceGroup; import cc.iotkit.data.model.TbDeviceGroup;
import cc.iotkit.common.api.Paging;
import cc.iotkit.model.device.DeviceGroup; import cc.iotkit.model.device.DeviceGroup;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -16,7 +15,6 @@ import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;

View File

@ -298,7 +298,7 @@ public class DeviceInfoDataImpl implements IDeviceInfoData, IJPACommData<DeviceI
String deviceIds = list.stream().map(d -> "'" + d.getDeviceId() + "'").collect(Collectors.joining(",")); String deviceIds = list.stream().map(d -> "'" + d.getDeviceId() + "'").collect(Collectors.joining(","));
//取设备所属分组 //取设备所属分组
List<DeviceIdGroup> groups = list.size() == 0 ? new ArrayList<>() : List<DeviceIdGroup> groups = list.isEmpty() ? new ArrayList<>() :
jdbcTemplate.query("SELECT \n" + jdbcTemplate.query("SELECT \n" +
"a.id,\n" + "a.id,\n" +
"a.name, \n" + "a.name, \n" +
@ -537,7 +537,7 @@ public class DeviceInfoDataImpl implements IDeviceInfoData, IJPACommData<DeviceI
@Override @Override
public List<DeviceInfo> findAllByCondition(DeviceInfo data) { public List<DeviceInfo> findAllByCondition(DeviceInfo data) {
return null; return Collections.emptyList();
} }
@Override @Override

View File

@ -1,12 +1,10 @@
package cc.iotkit.data.service; package cc.iotkit.data.service;
import cc.iotkit.common.api.PageRequest;
import cc.iotkit.common.utils.MapstructUtils; import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.data.dao.HomeRepository;
import cc.iotkit.data.dao.IJPACommData; import cc.iotkit.data.dao.IJPACommData;
import cc.iotkit.data.manager.IHomeData; import cc.iotkit.data.manager.IHomeData;
import cc.iotkit.data.dao.HomeRepository;
import cc.iotkit.data.model.TbHome; import cc.iotkit.data.model.TbHome;
import cc.iotkit.common.api.Paging;
import cc.iotkit.model.space.Home; import cc.iotkit.model.space.Home;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -14,7 +12,6 @@ import org.springframework.context.annotation.Primary;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;

View File

@ -1,25 +1,15 @@
package cc.iotkit.data.service; package cc.iotkit.data.service;
import cc.iotkit.common.api.PageRequest;
import cc.iotkit.common.api.Paging;
import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.data.dao.IJPACommData; import cc.iotkit.data.dao.IJPACommData;
import cc.iotkit.data.dao.IOtaDeviceRepository; import cc.iotkit.data.dao.IOtaDeviceRepository;
import cc.iotkit.data.manager.IOtaDeviceData; import cc.iotkit.data.manager.IOtaDeviceData;
import cc.iotkit.data.model.TbOtaDevice; import cc.iotkit.data.model.TbOtaDevice;
import cc.iotkit.model.ota.OtaDevice; import cc.iotkit.model.ota.OtaDevice;
import cc.iotkit.model.space.Home;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
/** /**
* @Author: * @Author:

View File

@ -6,21 +6,16 @@ import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.data.dao.IJPACommData; import cc.iotkit.data.dao.IJPACommData;
import cc.iotkit.data.dao.IOtaPackageRepository; import cc.iotkit.data.dao.IOtaPackageRepository;
import cc.iotkit.data.manager.IOtaPackageData; import cc.iotkit.data.manager.IOtaPackageData;
import cc.iotkit.data.model.TbOtaDevice;
import cc.iotkit.data.model.TbOtaPackage; import cc.iotkit.data.model.TbOtaPackage;
import cc.iotkit.model.ota.OtaDevice;
import cc.iotkit.model.ota.OtaPackage; import cc.iotkit.model.ota.OtaPackage;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**

View File

@ -9,23 +9,18 @@
*/ */
package cc.iotkit.data.service; package cc.iotkit.data.service;
import cc.iotkit.common.api.PageRequest;
import cc.iotkit.common.utils.MapstructUtils; import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.data.dao.IJPACommData; import cc.iotkit.data.dao.IJPACommData;
import cc.iotkit.data.manager.IOauthClientData;
import cc.iotkit.data.dao.OauthClientRepository; import cc.iotkit.data.dao.OauthClientRepository;
import cc.iotkit.data.manager.IOauthClientData;
import cc.iotkit.data.model.TbOauthClient; import cc.iotkit.data.model.TbOauthClient;
import cc.iotkit.model.OauthClient; import cc.iotkit.model.OauthClient;
import cc.iotkit.common.api.Paging;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.UUID; import java.util.UUID;
@Primary @Primary

View File

@ -1,12 +1,10 @@
package cc.iotkit.data.service; package cc.iotkit.data.service;
import cc.iotkit.common.api.PageRequest;
import cc.iotkit.common.utils.MapstructUtils; import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.data.dao.IJPACommData; import cc.iotkit.data.dao.IJPACommData;
import cc.iotkit.data.manager.IProductModelData;
import cc.iotkit.data.dao.ProductModelRepository; import cc.iotkit.data.dao.ProductModelRepository;
import cc.iotkit.data.manager.IProductModelData;
import cc.iotkit.data.model.TbProductModel; import cc.iotkit.data.model.TbProductModel;
import cc.iotkit.common.api.Paging;
import cc.iotkit.model.product.ProductModel; import cc.iotkit.model.product.ProductModel;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -14,8 +12,8 @@ import org.springframework.context.annotation.Primary;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
@ -59,7 +57,7 @@ public class ProductModelDataImpl implements IProductModelData, IJPACommData<Pro
@Override @Override
public List<ProductModel> findByIds(Collection<String> id) { public List<ProductModel> findByIds(Collection<String> id) {
return null; return Collections.emptyList();
} }
@Override @Override

View File

@ -20,6 +20,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Collection; import java.util.Collection;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
@ -80,7 +81,7 @@ public class ProtocolComponentDataImpl implements IProtocolComponentData, IJPACo
@Override @Override
public List<ProtocolComponent> findByIds(Collection<String> id) { public List<ProtocolComponent> findByIds(Collection<String> id) {
return null; return Collections.emptyList();
} }
@Override @Override
@ -105,7 +106,7 @@ public class ProtocolComponentDataImpl implements IProtocolComponentData, IJPACo
@Override @Override
public Paging<ProtocolComponent> findAll(PageRequest<ProtocolComponent> pageRequest) { public Paging<ProtocolComponent> findAll(PageRequest<ProtocolComponent> pageRequest) {
ProtocolComponent query = pageRequest.getData();
Predicate predicate = PredicateBuilder.instance() Predicate predicate = PredicateBuilder.instance()
.build(); .build();
Page<TbProtocolComponent> all = protocolComponentRepository.findAll(predicate, PageBuilder.toPageable(pageRequest)); Page<TbProtocolComponent> all = protocolComponentRepository.findAll(predicate, PageBuilder.toPageable(pageRequest));

View File

@ -9,13 +9,12 @@
*/ */
package cc.iotkit.data.service; package cc.iotkit.data.service;
import cc.iotkit.common.api.PageRequest; import cc.iotkit.common.api.Paging;
import cc.iotkit.common.utils.MapstructUtils; import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.data.dao.IJPACommData; import cc.iotkit.data.dao.IJPACommData;
import cc.iotkit.data.manager.IProtocolConverterData;
import cc.iotkit.data.dao.ProtocolConverterRepository; import cc.iotkit.data.dao.ProtocolConverterRepository;
import cc.iotkit.data.manager.IProtocolConverterData;
import cc.iotkit.data.model.TbProtocolConverter; import cc.iotkit.data.model.TbProtocolConverter;
import cc.iotkit.common.api.Paging;
import cc.iotkit.model.protocol.ProtocolConverter; import cc.iotkit.model.protocol.ProtocolConverter;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -26,6 +25,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Collection; import java.util.Collection;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
@ -79,7 +79,7 @@ public class ProtocolConverterDataImpl implements IProtocolConverterData, IJPACo
@Override @Override
public List<ProtocolConverter> findByIds(Collection<String> id) { public List<ProtocolConverter> findByIds(Collection<String> id) {
return null; return Collections.emptyList();
} }
@Override @Override

View File

@ -1,12 +1,11 @@
package cc.iotkit.data.service; package cc.iotkit.data.service;
import cc.iotkit.common.api.PageRequest; import cc.iotkit.common.api.Paging;
import cc.iotkit.common.utils.MapstructUtils; import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.data.dao.IJPACommData; import cc.iotkit.data.dao.IJPACommData;
import cc.iotkit.data.manager.ISpaceData;
import cc.iotkit.data.dao.SpaceRepository; import cc.iotkit.data.dao.SpaceRepository;
import cc.iotkit.data.manager.ISpaceData;
import cc.iotkit.data.model.TbSpace; import cc.iotkit.data.model.TbSpace;
import cc.iotkit.common.api.Paging;
import cc.iotkit.model.space.Space; import cc.iotkit.model.space.Space;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -16,7 +15,6 @@ import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;

View File

@ -9,13 +9,12 @@
*/ */
package cc.iotkit.data.service; package cc.iotkit.data.service;
import cc.iotkit.common.api.PageRequest; import cc.iotkit.common.api.Paging;
import cc.iotkit.common.utils.MapstructUtils; import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.data.dao.IJPACommData; import cc.iotkit.data.dao.IJPACommData;
import cc.iotkit.data.manager.ISpaceDeviceData;
import cc.iotkit.data.dao.SpaceDeviceRepository; import cc.iotkit.data.dao.SpaceDeviceRepository;
import cc.iotkit.data.manager.ISpaceDeviceData;
import cc.iotkit.data.model.TbSpaceDevice; import cc.iotkit.data.model.TbSpaceDevice;
import cc.iotkit.common.api.Paging;
import cc.iotkit.model.space.SpaceDevice; import cc.iotkit.model.space.SpaceDevice;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -23,7 +22,6 @@ import org.springframework.context.annotation.Primary;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;

View File

@ -134,7 +134,7 @@ public class SysMenuDataImpl implements ISysMenuData, IJPACommData<SysMenu, Long
@Override @Override
public List<String> selectMenuPermsByUserId(Long userId) { public List<String> selectMenuPermsByUserId(Long userId) {
List<String> menuIds = jpaQueryFactory.select(tbSysMenu.perms) return jpaQueryFactory.select(tbSysMenu.perms)
.from(tbSysMenu) .from(tbSysMenu)
.leftJoin(tbSysRoleMenu).on(tbSysMenu.id.eq(tbSysRoleMenu.menuId)) .leftJoin(tbSysRoleMenu).on(tbSysMenu.id.eq(tbSysRoleMenu.menuId))
.leftJoin(tbSysUserRole).on(tbSysRoleMenu.roleId.eq(tbSysUserRole.roleId)) .leftJoin(tbSysUserRole).on(tbSysRoleMenu.roleId.eq(tbSysUserRole.roleId))
@ -144,7 +144,6 @@ public class SysMenuDataImpl implements ISysMenuData, IJPACommData<SysMenu, Long
.and(tbSysRole.status.eq("0")) .and(tbSysRole.status.eq("0"))
.and(tbSysUserRole.userId.eq(userId)) .and(tbSysUserRole.userId.eq(userId))
.build()).fetch(); .build()).fetch();
return menuIds;
} }
@Override @Override

View File

@ -5,14 +5,11 @@ import cc.iotkit.common.api.Paging;
import cc.iotkit.common.utils.MapstructUtils; import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.common.utils.StringUtils; import cc.iotkit.common.utils.StringUtils;
import cc.iotkit.data.dao.IJPACommData; import cc.iotkit.data.dao.IJPACommData;
import cc.iotkit.data.dao.SysDeptRepository;
import cc.iotkit.data.dao.SysNoticRepository; import cc.iotkit.data.dao.SysNoticRepository;
import cc.iotkit.data.model.TbSysNotice; import cc.iotkit.data.model.TbSysNotice;
import cc.iotkit.data.system.ISysNoticeData; import cc.iotkit.data.system.ISysNoticeData;
import cc.iotkit.data.util.PageBuilder;
import cc.iotkit.data.util.PredicateBuilder; import cc.iotkit.data.util.PredicateBuilder;
import cc.iotkit.model.system.SysNotice; import cc.iotkit.model.system.SysNotice;
import cc.iotkit.model.system.SysUser;
import com.querydsl.core.QueryResults; import com.querydsl.core.QueryResults;
import com.querydsl.core.types.Predicate; import com.querydsl.core.types.Predicate;
import com.querydsl.jpa.impl.JPAQueryFactory; import com.querydsl.jpa.impl.JPAQueryFactory;
@ -22,8 +19,6 @@ import org.springframework.context.annotation.Primary;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
import static cc.iotkit.data.model.QTbSysNotice.tbSysNotice; import static cc.iotkit.data.model.QTbSysNotice.tbSysNotice;
/** /**

View File

@ -1,29 +1,16 @@
package cc.iotkit.data.service; package cc.iotkit.data.service;
import cc.iotkit.common.api.PageRequest;
import cc.iotkit.common.api.Paging;
import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.common.utils.StringUtils;
import cc.iotkit.data.dao.IJPACommData; import cc.iotkit.data.dao.IJPACommData;
import cc.iotkit.data.dao.SysOssConfigRepository; import cc.iotkit.data.dao.SysOssConfigRepository;
import cc.iotkit.data.model.TbSysOssConfig; import cc.iotkit.data.model.TbSysOssConfig;
import cc.iotkit.data.system.ISysOssConfigData; import cc.iotkit.data.system.ISysOssConfigData;
import cc.iotkit.data.util.PageBuilder;
import cc.iotkit.data.util.PredicateBuilder;
import cc.iotkit.model.system.SysOssConfig; import cc.iotkit.model.system.SysOssConfig;
import cn.hutool.core.util.ArrayUtil;
import com.querydsl.core.types.Predicate;
import com.querydsl.jpa.impl.JPAQueryFactory; import com.querydsl.jpa.impl.JPAQueryFactory;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
import static cc.iotkit.data.model.QTbSysOssConfig.tbSysOssConfig;
/** /**
* @Authortfd * @Authortfd
* @Date2023/5/31 15:24 * @Date2023/5/31 15:24

View File

@ -1,8 +1,6 @@
package cc.iotkit.data.service; package cc.iotkit.data.service;
import cc.iotkit.common.api.Paging;
import cc.iotkit.data.dao.IJPACommData; import cc.iotkit.data.dao.IJPACommData;
import cc.iotkit.data.dao.SysDeptRepository;
import cc.iotkit.data.dao.SysOssRepository; import cc.iotkit.data.dao.SysOssRepository;
import cc.iotkit.data.model.TbSysOss; import cc.iotkit.data.model.TbSysOss;
import cc.iotkit.data.system.ISysOssData; import cc.iotkit.data.system.ISysOssData;

View File

@ -12,7 +12,6 @@ import cc.iotkit.data.util.PageBuilder;
import cc.iotkit.data.util.PredicateBuilder; import cc.iotkit.data.util.PredicateBuilder;
import cc.iotkit.model.system.SysPost; import cc.iotkit.model.system.SysPost;
import com.querydsl.core.types.Predicate; import com.querydsl.core.types.Predicate;
import com.querydsl.core.types.Projections;
import com.querydsl.jpa.impl.JPAQueryFactory; import com.querydsl.jpa.impl.JPAQueryFactory;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;

View File

@ -3,7 +3,6 @@ package cc.iotkit.data.service;
import cc.iotkit.common.utils.MapstructUtils; import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.data.dao.IJPACommData; import cc.iotkit.data.dao.IJPACommData;
import cc.iotkit.data.dao.SysRoleDeptRepository; import cc.iotkit.data.dao.SysRoleDeptRepository;
import cc.iotkit.data.model.TbSysDept;
import cc.iotkit.data.model.TbSysRoleDept; import cc.iotkit.data.model.TbSysRoleDept;
import cc.iotkit.data.system.ISysRoleDeptData; import cc.iotkit.data.system.ISysRoleDeptData;
import cc.iotkit.data.util.PredicateBuilder; import cc.iotkit.data.util.PredicateBuilder;
@ -16,7 +15,6 @@ import org.springframework.stereotype.Service;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map;
import static cc.iotkit.data.model.QTbSysRoleDept.tbSysRoleDept; import static cc.iotkit.data.model.QTbSysRoleDept.tbSysRoleDept;

View File

@ -14,7 +14,6 @@ import org.springframework.context.annotation.Primary;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.List; import java.util.List;
import static cc.iotkit.data.model.QTbSysTenant.tbSysTenant; import static cc.iotkit.data.model.QTbSysTenant.tbSysTenant;

View File

@ -1,7 +1,6 @@
package cc.iotkit.data.service; package cc.iotkit.data.service;
import cc.iotkit.data.dao.IJPACommData; import cc.iotkit.data.dao.IJPACommData;
import cc.iotkit.data.dao.SysDeptRepository;
import cc.iotkit.data.dao.SysOssRepository; import cc.iotkit.data.dao.SysOssRepository;
import cc.iotkit.data.model.TbSysTenantPackage; import cc.iotkit.data.model.TbSysTenantPackage;
import cc.iotkit.data.system.ISysTenantPackageData; import cc.iotkit.data.system.ISysTenantPackageData;

View File

@ -7,7 +7,6 @@ import cc.iotkit.data.model.TbSysUserPost;
import cc.iotkit.data.system.ISysUserPostData; import cc.iotkit.data.system.ISysUserPostData;
import cc.iotkit.model.system.SysUserPost; import cc.iotkit.model.system.SysUserPost;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;

View File

@ -11,8 +11,8 @@ package cc.iotkit.data.service;
import cc.iotkit.common.utils.MapstructUtils; import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.data.dao.IJPACommData; import cc.iotkit.data.dao.IJPACommData;
import cc.iotkit.data.manager.IUserInfoData;
import cc.iotkit.data.dao.UserInfoRepository; import cc.iotkit.data.dao.UserInfoRepository;
import cc.iotkit.data.manager.IUserInfoData;
import cc.iotkit.data.model.TbUserInfo; import cc.iotkit.data.model.TbUserInfo;
import cc.iotkit.model.UserInfo; import cc.iotkit.model.UserInfo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -24,7 +24,6 @@ import org.springframework.stereotype.Service;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.UUID; import java.util.UUID;
@Primary @Primary

View File

@ -4,25 +4,18 @@ import cc.iotkit.common.api.PageRequest;
import cc.iotkit.common.api.PageRequestEmpty; import cc.iotkit.common.api.PageRequestEmpty;
import cc.iotkit.common.api.Paging; import cc.iotkit.common.api.Paging;
import cc.iotkit.common.utils.MapstructUtils; import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.data.model.TbSysConfig;
import cc.iotkit.model.product.Product;
import cc.iotkit.model.system.SysConfig;
import cc.iotkit.model.system.SysNotice;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.querydsl.core.QueryResults; import com.querydsl.core.QueryResults;
import com.querydsl.core.types.OrderSpecifier;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.data.domain.Sort.Order;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.data.domain.Sort.Order;
/** /**
* @author: Longjun.Tu * @author: Longjun.Tu
* @description: * @description:

View File

@ -11,7 +11,6 @@ package cc.iotkit.temporal.es.document;
import cc.iotkit.model.rule.TaskLog; import cc.iotkit.model.rule.TaskLog;
import io.github.linpeilie.annotations.AutoMapper; import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMapping;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;

View File

@ -37,9 +37,7 @@ public class RuleLogDataImpl implements IRuleLogData {
public Paging<RuleLog> findByRuleId(String ruleId, int page, int size) { public Paging<RuleLog> findByRuleId(String ruleId, int page, int size) {
Page<DocRuleLog> paged = ruleLogRepository.findByRuleId(ruleId, Pageable.ofSize(size).withPage(page - 1)); Page<DocRuleLog> paged = ruleLogRepository.findByRuleId(ruleId, Pageable.ofSize(size).withPage(page - 1));
return new Paging<>(paged.getTotalElements(), return new Paging<>(paged.getTotalElements(),
paged.getContent().stream().map(o->{ paged.getContent().stream().map(o -> MapstructUtils.convert(o, RuleLog.class))
return MapstructUtils.convert(o, RuleLog.class);
})
.collect(Collectors.toList())); .collect(Collectors.toList()));
} }

View File

@ -37,7 +37,7 @@ public class TaskLogDataImpl implements ITaskLogData {
public Paging<TaskLog> findByTaskId(String taskId, int page, int size) { public Paging<TaskLog> findByTaskId(String taskId, int page, int size) {
Page<DocTaskLog> paged = taskLogRepository.findByTaskId(taskId, Pageable.ofSize(size).withPage(page - 1)); Page<DocTaskLog> paged = taskLogRepository.findByTaskId(taskId, Pageable.ofSize(size).withPage(page - 1));
return new Paging<>(paged.getTotalElements(), return new Paging<>(paged.getTotalElements(),
paged.getContent().stream().map(o->{return MapstructUtils.convert(o, TaskLog.class);}) paged.getContent().stream().map(o -> MapstructUtils.convert(o, TaskLog.class))
.collect(Collectors.toList())); .collect(Collectors.toList()));
} }

View File

@ -20,7 +20,6 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service

View File

@ -31,8 +31,6 @@ import java.util.stream.Collectors;
import static org.jooq.impl.DSL.field; import static org.jooq.impl.DSL.field;
import static org.jooq.impl.DSL.table; import static org.jooq.impl.DSL.table;
//import cc.iotkit.temporal.ts.dm.TableManager;
@Service @Service
public class TaskLogDataImpl implements ITaskLogData { public class TaskLogDataImpl implements ITaskLogData {

View File

@ -47,7 +47,7 @@ public class TableManager {
* sql * sql
*/ */
public static String getCreateSTableSql(String tbName, List<TdField> fields, TdField... tags) { public static String getCreateSTableSql(String tbName, List<TdField> fields, TdField... tags) {
if (fields.size() == 0) { if (fields.isEmpty()) {
return null; return null;
} }

View File

@ -78,7 +78,7 @@ public class DbStructureDataImpl implements IDbStructureData {
List<TdField> addFields = newFields.stream().filter((f) -> oldFields.stream() List<TdField> addFields = newFields.stream().filter((f) -> oldFields.stream()
.noneMatch(old -> old.getName().equals(f.getName()))) .noneMatch(old -> old.getName().equals(f.getName())))
.collect(Collectors.toList()); .collect(Collectors.toList());
if (addFields.size() > 0) { if (!addFields.isEmpty()) {
sql = TableManager.getAddSTableColumnSql(tbName, addFields); sql = TableManager.getAddSTableColumnSql(tbName, addFields);
response = tdRestApi.execSql(sql); response = tdRestApi.execSql(sql);
if (response.getCode() != TdResponse.CODE_SUCCESS) { if (response.getCode() != TdResponse.CODE_SUCCESS) {
@ -95,7 +95,7 @@ public class DbStructureDataImpl implements IDbStructureData {
)) ))
.collect(Collectors.toList()); .collect(Collectors.toList());
if (modifyFields.size() > 0) { if (!modifyFields.isEmpty()) {
sql = TableManager.getModifySTableColumnSql(tbName, modifyFields); sql = TableManager.getModifySTableColumnSql(tbName, modifyFields);
response = tdRestApi.execSql(sql); response = tdRestApi.execSql(sql);
if (response.getCode() != TdResponse.CODE_SUCCESS) { if (response.getCode() != TdResponse.CODE_SUCCESS) {
@ -110,7 +110,7 @@ public class DbStructureDataImpl implements IDbStructureData {
//字段名不是time且没有相同字段名的 //字段名不是time且没有相同字段名的
.noneMatch(n -> n.getName().equals(f.getName()))) .noneMatch(n -> n.getName().equals(f.getName())))
.collect(Collectors.toList()); .collect(Collectors.toList());
if (dropFields.size() > 0) { if (!dropFields.isEmpty()) {
sql = TableManager.getDropSTableColumnSql(tbName, dropFields); sql = TableManager.getDropSTableColumnSql(tbName, dropFields);
response = tdRestApi.execSql(sql); response = tdRestApi.execSql(sql);
if (response.getCode() != TdResponse.CODE_SUCCESS) { if (response.getCode() != TdResponse.CODE_SUCCESS) {

View File

@ -43,7 +43,7 @@ public class RuleLogDataImpl implements IRuleLogData {
sql = "select count(*) from rule_log where rule_id=?"; sql = "select count(*) from rule_log where rule_id=?";
List<Long> counts = tdTemplate.queryForList(sql, Long.class, ruleId); List<Long> counts = tdTemplate.queryForList(sql, Long.class, ruleId);
return new Paging<>(counts.size() > 0 ? counts.get(0) : 0, ruleLogs.stream().map(r -> return new Paging<>(!counts.isEmpty() ? counts.get(0) : 0, ruleLogs.stream().map(r ->
new RuleLog(r.getTime().toString(), ruleId, r.getState1(), new RuleLog(r.getTime().toString(), ruleId, r.getState1(),
r.getContent(), r.getSuccess(), r.getTime())) r.getContent(), r.getSuccess(), r.getTime()))
.collect(Collectors.toList())); .collect(Collectors.toList()));

View File

@ -42,7 +42,7 @@ public class TaskLogDataImpl implements ITaskLogData {
sql = "select count(*) from task_log where task_id=?"; sql = "select count(*) from task_log where task_id=?";
List<Long> counts = tdTemplate.queryForList(sql, Long.class, taskId); List<Long> counts = tdTemplate.queryForList(sql, Long.class, taskId);
return new Paging<>(counts.size() > 0 ? counts.get(0) : 0, taskLogs.stream().map(r -> return new Paging<>(!counts.isEmpty() ? counts.get(0) : 0, taskLogs.stream().map(r ->
new TaskLog(r.getTime().toString(), taskId, new TaskLog(r.getTime().toString(), taskId,
r.getContent(), r.getSuccess(), r.getTime())) r.getContent(), r.getSuccess(), r.getTime()))
.collect(Collectors.toList())); .collect(Collectors.toList()));

View File

@ -9,8 +9,8 @@
*/ */
package cc.iotkit.temporal.td.service; package cc.iotkit.temporal.td.service;
import cc.iotkit.common.utils.JsonUtils;
import cc.iotkit.common.api.Paging; import cc.iotkit.common.api.Paging;
import cc.iotkit.common.utils.JsonUtils;
import cc.iotkit.model.device.message.ThingModelMessage; import cc.iotkit.model.device.message.ThingModelMessage;
import cc.iotkit.model.stats.TimeData; import cc.iotkit.model.stats.TimeData;
import cc.iotkit.temporal.IThingModelMessageData; import cc.iotkit.temporal.IThingModelMessageData;
@ -61,7 +61,7 @@ public class ThingModelMessageDataImpl implements IThingModelMessageData {
sql = String.format("select count(*) from thing_model_message where device_id=? %s", sql = String.format("select count(*) from thing_model_message where device_id=? %s",
sbCond.toString()); sbCond.toString());
List<Long> counts = tdTemplate.queryForList(sql, Long.class, args.toArray()); List<Long> counts = tdTemplate.queryForList(sql, Long.class, args.toArray());
long count = counts.size() > 0 ? counts.get(0) : 0; long count = !counts.isEmpty() ? counts.get(0) : 0;
return new Paging<>(count, ruleLogs.stream().map(r -> return new Paging<>(count, ruleLogs.stream().map(r ->
new ThingModelMessage(r.getTime().toString(), r.getMid(), new ThingModelMessage(r.getTime().toString(), r.getMid(),
@ -110,6 +110,6 @@ public class ThingModelMessageDataImpl implements IThingModelMessageData {
@Override @Override
public long count() { public long count() {
List<Long> counts = tdTemplate.queryForList("select count(*) from thing_model_message", Long.class); List<Long> counts = tdTemplate.queryForList("select count(*) from thing_model_message", Long.class);
return counts.size() > 0 ? counts.get(0) : 0; return !counts.isEmpty() ? counts.get(0) : 0;
} }
} }

View File

@ -1,8 +1,5 @@
package cc.iotkit.swagger.config; package cc.iotkit.swagger.config;
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeansException; import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -10,18 +7,17 @@ import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.ReflectionUtils; import org.springframework.util.ReflectionUtils;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping; import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping;
import springfox.documentation.builders.*; import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.service.*; import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType; import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider; import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider;
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**

View File

@ -1,6 +1,8 @@
package cc.iotkit.common.excel.annotation; package cc.iotkit.common.excel.annotation;
import cc.iotkit.common.excel.core.CellMergeStrategy;
import java.lang.annotation.*; import java.lang.annotation.*;
/** /**

View File

@ -42,16 +42,13 @@ public class CellMergeStrategy extends AbstractMergeStrategy {
@Override @Override
protected void merge(Sheet sheet, Cell cell, Head head, Integer relativeRowIndex) { protected void merge(Sheet sheet, Cell cell, Head head, Integer relativeRowIndex) {
List<CellRangeAddress> cellList = handle(list, hasTitle); List<CellRangeAddress> cellList = handle(list, hasTitle);
// judge the list is not null
if (CollUtil.isNotEmpty(cellList)) {
// the judge is necessary // the judge is necessary
if (cell.getRowIndex() == rowIndex && cell.getColumnIndex() == 0) { if (CollUtil.isNotEmpty(cellList) && cell.getRowIndex() == rowIndex && cell.getColumnIndex() == 0) {
for (CellRangeAddress item : cellList) { for (CellRangeAddress item : cellList) {
sheet.addMergedRegion(item); sheet.addMergedRegion(item);
} }
} }
} }
}
@SneakyThrows @SneakyThrows
private List<CellRangeAddress> handle(List<?> list, boolean hasTitle) { private List<CellRangeAddress> handle(List<?> list, boolean hasTitle) {
@ -99,10 +96,9 @@ public class CellMergeStrategy extends AbstractMergeStrategy {
cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex - 1, colNum, colNum)); cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex - 1, colNum, colNum));
} }
map.put(field, new RepeatCell(val, i)); map.put(field, new RepeatCell(val, i));
} else if (i == list.size() - 1) { } else if ((i == list.size() - 1) && (i > repeatCell.getCurrent())) {
if (i > repeatCell.getCurrent()) {
cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex, colNum, colNum)); cellList.add(new CellRangeAddress(repeatCell.getCurrent() + rowIndex, i + rowIndex, colNum, colNum));
}
} }
} }
} }

View File

@ -4,7 +4,6 @@ import cc.iotkit.common.utils.JsonUtils;
import cc.iotkit.common.utils.StreamUtils; import cc.iotkit.common.utils.StreamUtils;
import cc.iotkit.common.utils.ValidatorUtils; import cc.iotkit.common.utils.ValidatorUtils;
import cn.hutool.core.text.CharSequenceUtil; import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener; import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.excel.exception.ExcelAnalysisException; import com.alibaba.excel.exception.ExcelAnalysisException;
@ -88,7 +87,7 @@ public class DefaultExcelListener<T> extends AnalysisEventListener<T> implements
@Override @Override
public void invoke(T data, AnalysisContext context) { public void invoke(T data, AnalysisContext context) {
if (isValidate) { if (Boolean.TRUE.equals(isValidate)) {
ValidatorUtils.validate(data); ValidatorUtils.validate(data);
} }
excelResult.getList().add(data); excelResult.getList().add(data);

View File

@ -1,7 +1,6 @@
package cc.iotkit.common.excel.core; package cc.iotkit.common.excel.core;
import cn.hutool.core.text.CharSequenceUtil; import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Setter; import lombok.Setter;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -152,7 +152,7 @@ public class LogAspect {
* @param operLog * @param operLog
* @throws Exception * @throws Exception
*/ */
private void setRequestValue(JoinPoint joinPoint, OperLogEvent operLog, String[] excludeParamNames) throws Exception { private void setRequestValue(JoinPoint joinPoint, OperLogEvent operLog, String[] excludeParamNames) {
Map<String, String> paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest()); Map<String, String> paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest());
String requestMethod = operLog.getRequestMethod(); String requestMethod = operLog.getRequestMethod();
if (MapUtil.isEmpty(paramsMap) if (MapUtil.isEmpty(paramsMap)

View File

@ -1,6 +1,9 @@
package cc.iotkit.common.oss.core; package cc.iotkit.common.oss.core;
import cc.iotkit.common.oss.constant.OssConstant; import cc.iotkit.common.oss.constant.OssConstant;
import cc.iotkit.common.oss.entity.UploadResult;
import cc.iotkit.common.oss.enumd.AccessPolicyType;
import cc.iotkit.common.oss.enumd.PolicyType;
import cc.iotkit.common.oss.exception.OssException; import cc.iotkit.common.oss.exception.OssException;
import cc.iotkit.common.oss.properties.OssProperties; import cc.iotkit.common.oss.properties.OssProperties;
import cc.iotkit.common.utils.DateUtils; import cc.iotkit.common.utils.DateUtils;
@ -19,9 +22,6 @@ import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3Client; import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.AmazonS3ClientBuilder; import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import com.amazonaws.services.s3.model.*; import com.amazonaws.services.s3.model.*;
import cc.iotkit.common.oss.entity.UploadResult;
import cc.iotkit.common.oss.enumd.AccessPolicyType;
import cc.iotkit.common.oss.enumd.PolicyType;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.InputStream; import java.io.InputStream;

View File

@ -1,5 +1,6 @@
package cc.iotkit.common.oss.enumd; package cc.iotkit.common.oss.enumd;
import cc.iotkit.common.exception.BizException;
import com.amazonaws.services.s3.model.CannedAccessControlList; import com.amazonaws.services.s3.model.CannedAccessControlList;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
@ -49,7 +50,7 @@ public enum AccessPolicyType {
return value; return value;
} }
} }
throw new RuntimeException("'type' not found By " + type); throw new BizException("'type' not found By " + type);
} }
} }

View File

@ -1,8 +1,8 @@
package cc.iotkit.common.satoken.core.service; package cc.iotkit.common.satoken.core.service;
import cc.iotkit.common.undefined.LoginUser;
import cc.iotkit.common.enums.UserType; import cc.iotkit.common.enums.UserType;
import cc.iotkit.common.satoken.utils.LoginHelper; import cc.iotkit.common.satoken.utils.LoginHelper;
import cc.iotkit.common.undefined.LoginUser;
import cn.dev33.satoken.stp.StpInterface; import cn.dev33.satoken.stp.StpInterface;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -2,14 +2,13 @@ package cc.iotkit.common.satoken.utils;
import cc.iotkit.common.constant.TenantConstants; import cc.iotkit.common.constant.TenantConstants;
import cc.iotkit.common.constant.UserConstants; import cc.iotkit.common.constant.UserConstants;
import cc.iotkit.common.undefined.LoginUser;
import cc.iotkit.common.enums.DeviceType; import cc.iotkit.common.enums.DeviceType;
import cc.iotkit.common.enums.UserType; import cc.iotkit.common.enums.UserType;
import cc.iotkit.common.undefined.LoginUser;
import cn.dev33.satoken.context.SaHolder; import cn.dev33.satoken.context.SaHolder;
import cn.dev33.satoken.context.model.SaStorage; import cn.dev33.satoken.context.model.SaStorage;
import cn.dev33.satoken.stp.SaLoginModel; import cn.dev33.satoken.stp.SaLoginModel;
import cn.dev33.satoken.stp.StpUtil; import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import lombok.AccessLevel; import lombok.AccessLevel;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;

View File

@ -13,8 +13,6 @@ import lombok.AccessLevel;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import java.util.function.Supplier;
/** /**
* *
* *

View File

@ -10,7 +10,6 @@
package cc.iotkit.common.web.handler; package cc.iotkit.common.web.handler;
import cc.iotkit.common.api.Response; import cc.iotkit.common.api.Response;
import cc.iotkit.common.utils.JsonUtils;
import cn.dev33.satoken.util.SaResult; import cn.dev33.satoken.util.SaResult;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import org.springframework.core.MethodParameter; import org.springframework.core.MethodParameter;

View File

@ -30,7 +30,7 @@ import java.util.Map;
@Slf4j @Slf4j
public class PlusWebInvokeTimeInterceptor implements HandlerInterceptor { public class PlusWebInvokeTimeInterceptor implements HandlerInterceptor {
private final String prodProfile = "prod"; private final static String prodProfile = "prod";
private final TransmittableThreadLocal<StopWatch> invokeTimeTL = new TransmittableThreadLocal<>(); private final TransmittableThreadLocal<StopWatch> invokeTimeTL = new TransmittableThreadLocal<>();

View File

@ -2,8 +2,6 @@ package cc.iotkit.vertx;
import cc.iotkit.mq.MqProducer; import cc.iotkit.mq.MqProducer;
import io.vertx.core.AbstractVerticle; import io.vertx.core.AbstractVerticle;
import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;
import io.vertx.core.eventbus.DeliveryOptions; import io.vertx.core.eventbus.DeliveryOptions;
import io.vertx.core.eventbus.EventBus; import io.vertx.core.eventbus.EventBus;
import lombok.SneakyThrows; import lombok.SneakyThrows;

View File

@ -8,7 +8,6 @@ import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
import org.apache.rocketmq.common.message.MessageExt; import org.apache.rocketmq.common.message.MessageExt;
import org.springframework.beans.factory.annotation.Value;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;