├── .gitignore ├── README.md ├── dc3-api ├── .gitignore ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── pnoker │ └── api │ └── dbs │ ├── UserFeignApi.java │ └── hystrix │ └── UserFeignApiHystrix.java ├── dc3-common ├── dc3-common-base │ ├── .gitignore │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── pnoker │ │ └── common │ │ └── util │ │ └── base │ │ ├── enums │ │ └── ErrorCodeEnum.java │ │ └── exception │ │ ├── BooleanParseException.java │ │ ├── BusinessException.java │ │ ├── ConfigException.java │ │ ├── ImportException.java │ │ └── ReferenceModelNullException.java ├── dc3-common-core │ ├── .gitignore │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── pnoker │ │ └── common │ │ └── util │ │ └── core │ │ ├── mybatis │ │ └── MyMapper.java │ │ └── support │ │ ├── BaseController.java │ │ ├── BaseService.java │ │ └── IService.java ├── dc3-common-model │ ├── .gitignore │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── pnoker │ │ └── common │ │ └── util │ │ └── model │ │ └── domain │ │ └── User.java ├── dc3-common-util │ ├── .gitignore │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── pnoker │ │ └── common │ │ └── util │ │ └── wrapper │ │ ├── WrapMapper.java │ │ └── Wrapper.java └── pom.xml ├── dc3-service ├── dc3-service-center │ ├── .gitignore │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── pnoker │ │ │ └── ServiceCenterApplication.java │ │ └── resources │ │ ├── application-dev.yml │ │ ├── application-product1.yml │ │ ├── application-product2.yml │ │ ├── application.yml │ │ ├── banner.txt │ │ └── static │ │ └── favicon.ico ├── dc3-service-dbs │ ├── .gitignore │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── pnoker │ │ │ └── service │ │ │ ├── DbsApplication.java │ │ │ └── dbs │ │ │ ├── controller │ │ │ └── UserFeignClient.java │ │ │ ├── dao │ │ │ └── UserMapper.java │ │ │ └── service │ │ │ ├── UserService.java │ │ │ └── impl │ │ │ └── UserServiceImpl.java │ │ └── resources │ │ ├── application-dev.yml │ │ ├── application-product.yml │ │ ├── application.yml │ │ ├── banner.txt │ │ ├── config.properties │ │ ├── generator │ │ ├── generatorConfig-A.xml │ │ └── generatorConfig-B.xml │ │ ├── mapper │ │ └── UserMapper.xml │ │ └── static │ │ └── favicon.ico └── pom.xml ├── dc3-webapp ├── .gitignore ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── pnoker │ │ ├── WebappApplication.java │ │ ├── controller │ │ └── IndexController.java │ │ └── service │ │ ├── Test.java │ │ └── impl │ │ └── Test.java │ └── resources │ ├── application-dev.yml │ ├── application-product.yml │ ├── application.yml │ ├── banner.txt │ ├── static │ ├── favicon.ico │ └── iview │ │ ├── fonts │ │ └── ionicons.ttf │ │ ├── iview.css │ │ ├── iview.min.js │ │ └── vue.min.js │ └── templates │ └── index.html ├── dc3 ├── images │ ├── iot-dc3-architecture1.jpg │ └── iot-dc3-architecture2.jpg └── tsung │ └── http_simple.xml └── pom.xml /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | dc3/logs/ 3 | dc3/doc/ 4 | 5 | ### IntelliJ IDEA ### 6 | .idea 7 | *.iws 8 | *.iml 9 | *.ipr -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 开源分布式物联网(IOT)平台 DC3 2 | 3 | DC3 Open-source IoT Platform 4 | 5 | Device management, data collection, processing and visualization for your IoT solution 6 | 7 | ## 什么是DC3 IOT平台? 8 | 9 | DC3是一个开源的、分布式的物联网(IOT)平台,用于快速开发物联网项目和管理拓展。 10 | 11 | DC3致力于: 12 | 13 | > * 多协议、多设备连接与管理; 14 | > * 物联设备数据采集、处理与数据存储; 15 | > * 分析传入的遥测和复杂事件处理触发警报; 16 | > * 控制设备使用远程过程调用(RPC); 17 | > * 构建工作流基于设备生命周期事件,REST API,RPC请求,等等 18 | > * 推动设备数据到其他系统。 19 | > * 更多的…… 20 | 21 | DC3设计为: 22 | 23 | > * 可伸缩:水平可伸缩的平台,构建使用领先的开源技术; 24 | > * 容错:没有单点故障弱,集群中的每个节点是相同的; 25 | > * 健壮和高效:单一服务器节点可以处理甚至数百成千上万的设备根据用例。DC3集群可以处理数以百万计的设备; 26 | > * 可定制:添加新的设备协议,并注册到服务中心; 27 | > * 耐用:永远不要失去你的数据。 28 | > * 更多的…… 29 | 30 | ## DC3 IOT平台架构? 31 | 32 | DC3平台是基于Spring Cloud架构开发的,是一系列松耦合、开源的微服务集合。 33 | 微服务集合由4个微服务层和两个增强的基础系统服务组成,提供从物理域数据采集到信息域数据处理等一系列的服务。 34 | 35 | spring-eurake、spring-zuul、spring-hystrix、spring-ribbon、spring-cloud-config、spring-cloud-bus等微服务模块。 36 | 37 | ### 模块 38 | 39 | > * 设备微服务层:用于提供标准或者私有协议连接物理设备的SDK; 40 | > * 核心微服务层:用于提供微服务注册中心、配置管理中心、设备指令接口、设备注册与关联配对、数据管理中心,是所有微服务交互的核心部分; 41 | > * 支持微服务层:用于提供规则引擎、任务调度、报警与消息通知、日志管理、数据清理; 42 | > * 开放微服务层:用于提供数据开放等服务... 43 | 44 | ### 架构设计 45 | 46 | * 功能架构 47 | 48 | ![iot-dc3-architecture](/dc3/images/iot-dc3-architecture1.jpg) 49 | 50 | * 技术架构 51 | 52 | ![iot-dc3-architecture](/dc3/images/iot-dc3-architecture2.jpg) 53 | 54 | ## 快速部署DC3 IOT平台 55 | 56 | ```bash 57 | 58 | # 初始化 59 | sh init.sh 60 | 61 | # 编译打包 62 | sh build.sh 63 | 64 | # 启动 65 | sh starup.sh 66 | 67 | # 停止 68 | sh shutdown.sh 69 | 70 | ``` 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /dc3-api/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | 3 | ### IntelliJ IDEA ### 4 | .idea 5 | *.iws 6 | *.iml 7 | *.ipr -------------------------------------------------------------------------------- /dc3-api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.pnoker.api 7 | dc3-api 8 | jar 9 | 10 | 11 | com.pnoker 12 | iot-dc3 13 | 3.0 14 | 15 | 16 | 17 | 18 | 19 | 20 | com.pnoker.common 21 | dc3-common-base 22 | 3.0 23 | compile 24 | 25 | 26 | 27 | com.pnoker.common 28 | dc3-common-util 29 | 3.0 30 | compile 31 | 32 | 33 | 34 | com.pnoker.common 35 | dc3-common-model 36 | 3.0 37 | compile 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /dc3-api/src/main/java/com/pnoker/api/dbs/UserFeignApi.java: -------------------------------------------------------------------------------- 1 | package com.pnoker.api.dbs; 2 | 3 | import com.pnoker.api.dbs.hystrix.UserFeignApiHystrix; 4 | import com.pnoker.common.util.wrapper.Wrapper; 5 | import org.springframework.cloud.openfeign.FeignClient; 6 | import org.springframework.web.bind.annotation.PathVariable; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RequestMethod; 9 | 10 | /** 11 | * @author: Pnoker 12 | * @email: pnokers@gmail.com 13 | * @project: iot-dc3 14 | * @copyright: Copyright(c) 2018. Pnoker All Rights Reserved. 15 | *

16 | */ 17 | @FeignClient(name = "DC3-SERVICE-DBS", fallback = UserFeignApiHystrix.class) 18 | public interface UserFeignApi { 19 | @RequestMapping(value = "/api/user/getById/{userId}", method = RequestMethod.GET) 20 | Wrapper getById(@PathVariable("userId") Long userId); 21 | } 22 | -------------------------------------------------------------------------------- /dc3-api/src/main/java/com/pnoker/api/dbs/hystrix/UserFeignApiHystrix.java: -------------------------------------------------------------------------------- 1 | package com.pnoker.api.dbs.hystrix; 2 | 3 | import com.pnoker.api.dbs.UserFeignApi; 4 | import com.pnoker.common.util.wrapper.WrapMapper; 5 | import com.pnoker.common.util.wrapper.Wrapper; 6 | import org.springframework.stereotype.Component; 7 | 8 | /** 9 | * @author: Pnoker 10 | * @email: pnokers@gmail.com 11 | * @project: iot-dc3 12 | * @copyright: Copyright(c) 2018. Pnoker All Rights Reserved. 13 | *

14 | */ 15 | @Component 16 | public class UserFeignApiHystrix implements UserFeignApi { 17 | @Override 18 | public Wrapper getById(Long userId) { 19 | return WrapMapper.wrap(Wrapper.ERROR_CODE,Wrapper.ERROR_MESSAGE); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /dc3-common/dc3-common-base/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | 3 | ### IntelliJ IDEA ### 4 | .idea 5 | *.iws 6 | *.iml 7 | *.ipr -------------------------------------------------------------------------------- /dc3-common/dc3-common-base/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.pnoker.common 8 | dc3-common-base 9 | 10 | 11 | com.pnoker.common 12 | dc3-common 13 | 3.0 14 | 15 | 16 | 17 | 18 | 2.9.2 19 | 20 | 21 | 22 | 23 | io.springfox 24 | springfox-swagger2 25 | ${swagger.version} 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /dc3-common/dc3-common-base/src/main/java/com/pnoker/common/util/base/enums/ErrorCodeEnum.java: -------------------------------------------------------------------------------- 1 | package com.pnoker.common.util.base.enums; 2 | 3 | import lombok.Getter; 4 | 5 | /** 6 | * @author: Pnoker 7 | * @email: pnokers@gmail.com 8 | * @project: iot-dc3 9 | * @copyright: Copyright(c) 2018. Pnoker All Rights Reserved. 10 | *

11 | * The class Error code enum. 12 | */ 13 | @Getter 14 | public enum ErrorCodeEnum { 15 | 16 | /** 17 | * 全局 100 参数异常 18 | */ 19 | Global100(100, "参数异常"), 20 | /** 21 | * 全局 101 注解使用错误 22 | */ 23 | Global101(101, "注解使用错误"), 24 | /** 25 | * 全局 102 微服务不在线,或者网络超时 26 | */ 27 | Global102(102, "微服务不在线,或者网络超时"), 28 | /** 29 | * 全局 401 无访问权限 30 | */ 31 | Global401(401, "无访问权限"), 32 | /** 33 | * 全局 500 未知异常 34 | */ 35 | Global500(500, "未知异常"), 36 | /** 37 | * 全局 403 无权访问 38 | */ 39 | Global403(403, "无权访问"), 40 | /** 41 | * 全局 404 找不到指定资源 42 | */ 43 | Global404(404, "找不到指定资源"); 44 | private int code; 45 | private String msg; 46 | 47 | 48 | ErrorCodeEnum(int code, String msg) { 49 | this.code = code; 50 | this.msg = msg; 51 | } 52 | 53 | /** 54 | * Gets enum. 55 | * 56 | * @param code the code 57 | * @return the enum 58 | */ 59 | public static ErrorCodeEnum getEnum(int code) { 60 | for (ErrorCodeEnum errorCodeEnum : ErrorCodeEnum.values()) { 61 | if (errorCodeEnum.getCode() == code) { 62 | return errorCodeEnum; 63 | } 64 | } 65 | return null; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /dc3-common/dc3-common-base/src/main/java/com/pnoker/common/util/base/exception/BooleanParseException.java: -------------------------------------------------------------------------------- 1 | package com.pnoker.common.util.base.exception; 2 | 3 | /** 4 | * @author: Pnoker 5 | * @email: pnokers@gmail.com 6 | * @project: iot-dc3 7 | * @copyright: Copyright(c) 2018. Pnoker All Rights Reserved. 8 | *

9 | * The class Boolean parse exception. 10 | */ 11 | public class BooleanParseException extends RuntimeException { 12 | /** 13 | * Instantiates a new Boolean parse exception. 14 | */ 15 | public BooleanParseException() { 16 | super(); 17 | } 18 | 19 | /** 20 | * Instantiates a new Boolean parse exception. 21 | * 22 | * @param message the message 23 | */ 24 | public BooleanParseException(String message) { 25 | super(message); 26 | } 27 | 28 | /** 29 | * Instantiates a new Boolean parse exception. 30 | * 31 | * @param message the message 32 | * @param cause the cause 33 | */ 34 | public BooleanParseException(String message, Throwable cause) { 35 | super(message, cause); 36 | } 37 | 38 | /** 39 | * Instantiates a new Boolean parse exception. 40 | * 41 | * @param cause the cause 42 | */ 43 | public BooleanParseException(Throwable cause) { 44 | super(cause); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /dc3-common/dc3-common-base/src/main/java/com/pnoker/common/util/base/exception/BusinessException.java: -------------------------------------------------------------------------------- 1 | package com.pnoker.common.util.base.exception; 2 | 3 | 4 | import com.pnoker.common.util.base.enums.ErrorCodeEnum; 5 | import lombok.extern.slf4j.Slf4j; 6 | 7 | /** 8 | * @author: Pnoker 9 | * @email: pnokers@gmail.com 10 | * @project: iot-dc3 11 | * @copyright: Copyright(c) 2018. Pnoker All Rights Reserved. 12 | *

13 | * The class Business exception. 14 | */ 15 | @Slf4j 16 | public class BusinessException extends RuntimeException { 17 | 18 | /** 19 | * 异常码 20 | */ 21 | protected int code; 22 | 23 | private static final long serialVersionUID = 3160241586346324994L; 24 | 25 | public BusinessException() { 26 | } 27 | 28 | public BusinessException(Throwable cause) { 29 | super(cause); 30 | } 31 | 32 | public BusinessException(String message) { 33 | super(message); 34 | } 35 | 36 | public BusinessException(String message, Throwable cause) { 37 | super(message, cause); 38 | } 39 | 40 | public BusinessException(int code, String message) { 41 | super(message); 42 | this.code = code; 43 | } 44 | 45 | public BusinessException(int code, String msgFormat, Object... args) { 46 | super(String.format(msgFormat, args)); 47 | this.code = code; 48 | } 49 | 50 | public BusinessException(ErrorCodeEnum codeEnum, Object... args) { 51 | super(String.format(codeEnum.getMsg(), args)); 52 | this.code = codeEnum.getCode(); 53 | } 54 | 55 | public int getCode() { 56 | return code; 57 | } 58 | 59 | public void setCode(int code) { 60 | this.code = code; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /dc3-common/dc3-common-base/src/main/java/com/pnoker/common/util/base/exception/ConfigException.java: -------------------------------------------------------------------------------- 1 | package com.pnoker.common.util.base.exception; 2 | 3 | /** 4 | * @author: Pnoker 5 | * @email: pnokers@gmail.com 6 | * @project: iot-dc3 7 | * @copyright: Copyright(c) 2018. Pnoker All Rights Reserved. 8 | *

9 | * The class Config exception. 10 | */ 11 | public class ConfigException extends RuntimeException { 12 | 13 | private static final long serialVersionUID = 6480772904575978373L; 14 | 15 | /** 16 | * Instantiates a new Config exception. 17 | * 18 | * @param message the message 19 | */ 20 | public ConfigException(String message) { 21 | super(message); 22 | } 23 | 24 | /** 25 | * Instantiates a new Config exception. 26 | */ 27 | public ConfigException() { 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /dc3-common/dc3-common-base/src/main/java/com/pnoker/common/util/base/exception/ImportException.java: -------------------------------------------------------------------------------- 1 | package com.pnoker.common.util.base.exception; 2 | 3 | /** 4 | * @author: Pnoker 5 | * @email: pnokers@gmail.com 6 | * @project: iot-dc3 7 | * @copyright: Copyright(c) 2018. Pnoker All Rights Reserved. 8 | *

9 | * The class Import exception. 10 | */ 11 | public class ImportException extends RuntimeException { 12 | 13 | private static final long serialVersionUID = -4740091660440744697L; 14 | 15 | /** 16 | * Instantiates a new Import exception. 17 | * 18 | * @param message the message 19 | */ 20 | public ImportException(String message) { 21 | super(message); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /dc3-common/dc3-common-base/src/main/java/com/pnoker/common/util/base/exception/ReferenceModelNullException.java: -------------------------------------------------------------------------------- 1 | package com.pnoker.common.util.base.exception; 2 | 3 | /** 4 | * @author: Pnoker 5 | * @email: pnokers@gmail.com 6 | * @project: iot-dc3 7 | * @copyright: Copyright(c) 2018. Pnoker All Rights Reserved. 8 | *

9 | * The class Reference model null exception. 10 | */ 11 | public class ReferenceModelNullException extends RuntimeException { 12 | private static final long serialVersionUID = -318154770875589045L; 13 | 14 | /** 15 | * Instantiates a new Reference model null exception. 16 | * 17 | * @param message the message 18 | */ 19 | public ReferenceModelNullException(String message) { 20 | super(message); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /dc3-common/dc3-common-core/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | 3 | ### IntelliJ IDEA ### 4 | .idea 5 | *.iws 6 | *.iml 7 | *.ipr -------------------------------------------------------------------------------- /dc3-common/dc3-common-core/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.pnoker.common 8 | dc3-common-core 9 | 10 | 11 | com.pnoker.common 12 | dc3-common 13 | 3.0 14 | 15 | 16 | 17 | 18 | 3.4.2 19 | 4.0.4 20 | 21 | 22 | 23 | 24 | 25 | com.pnoker.common 26 | dc3-common-base 27 | 3.0 28 | compile 29 | 30 | 31 | 32 | 33 | org.mybatis 34 | mybatis 35 | ${mybatis.version} 36 | 37 | 38 | 39 | 40 | tk.mybatis 41 | mapper 42 | ${mapper.version} 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /dc3-common/dc3-common-core/src/main/java/com/pnoker/common/util/core/mybatis/MyMapper.java: -------------------------------------------------------------------------------- 1 | package com.pnoker.common.util.core.mybatis; 2 | 3 | import tk.mybatis.mapper.common.Mapper; 4 | import tk.mybatis.mapper.common.MySqlMapper; 5 | 6 | /** 7 | * @author: Pnoker 8 | * @email: pnokers@gmail.com 9 | * @project: iot-dc3 10 | * @copyright: Copyright(c) 2018. Pnoker All Rights Reserved. 11 | *

12 | * The interface My mapper. 13 | */ 14 | public interface MyMapper extends Mapper, MySqlMapper { 15 | } 16 | -------------------------------------------------------------------------------- /dc3-common/dc3-common-core/src/main/java/com/pnoker/common/util/core/support/BaseController.java: -------------------------------------------------------------------------------- 1 | package com.pnoker.common.util.core.support; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | /** 7 | * @author: Pnoker 8 | * @email: pnokers@gmail.com 9 | * @project: iot-dc3 10 | * @copyright: Copyright(c) 2018. Pnoker All Rights Reserved. 11 | *

12 | * The class Base controller. 13 | */ 14 | public class BaseController { 15 | protected final Logger logger = LoggerFactory.getLogger(this.getClass()); 16 | } 17 | -------------------------------------------------------------------------------- /dc3-common/dc3-common-core/src/main/java/com/pnoker/common/util/core/support/BaseService.java: -------------------------------------------------------------------------------- 1 | 2 | package com.pnoker.common.util.core.support; 3 | 4 | import com.pnoker.common.util.base.exception.BusinessException; 5 | import org.apache.ibatis.session.RowBounds; 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import tk.mybatis.mapper.common.Mapper; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * @author: Pnoker 15 | * @email: pnokers@gmail.com 16 | * @project: iot-dc3 17 | * @copyright: Copyright(c) 2018. Pnoker All Rights Reserved. 18 | *

19 | * The class Base service. 20 | */ 21 | public abstract class BaseService implements IService { 22 | 23 | /** 24 | * The Logger. 25 | */ 26 | protected final Logger logger = LoggerFactory.getLogger(this.getClass()); 27 | 28 | /** 29 | * The Mapper. 30 | */ 31 | @Autowired 32 | protected Mapper mapper; 33 | 34 | /** 35 | * Gets mapper. 36 | * 37 | * @return the mapper 38 | */ 39 | public Mapper getMapper() { 40 | return mapper; 41 | } 42 | 43 | /** 44 | * Select list. 45 | * 46 | * @param record the record 47 | * @return the list 48 | */ 49 | @Override 50 | public List select(T record) { 51 | return mapper.select(record); 52 | } 53 | 54 | /** 55 | * Select by key t. 56 | * 57 | * @param key the key 58 | * @return the t 59 | */ 60 | @Override 61 | public T selectByKey(Object key) { 62 | return mapper.selectByPrimaryKey(key); 63 | } 64 | 65 | /** 66 | * Select all list. 67 | * 68 | * @return the list 69 | */ 70 | @Override 71 | public List selectAll() { 72 | return mapper.selectAll(); 73 | } 74 | 75 | /** 76 | * Select one t. 77 | * 78 | * @param record the record 79 | * @return the t 80 | */ 81 | @Override 82 | public T selectOne(T record) { 83 | return mapper.selectOne(record); 84 | } 85 | 86 | /** 87 | * Select count int. 88 | * 89 | * @param record the record 90 | * @return the int 91 | */ 92 | @Override 93 | public int selectCount(T record) { 94 | return mapper.selectCount(record); 95 | } 96 | 97 | /** 98 | * Select by example list. 99 | * 100 | * @param example the example 101 | * @return the list 102 | */ 103 | @Override 104 | public List selectByExample(Object example) { 105 | return mapper.selectByExample(example); 106 | } 107 | 108 | /** 109 | * Save int. 110 | * 111 | * @param record the record 112 | * @return the int 113 | */ 114 | @Override 115 | public int save(T record) { 116 | return mapper.insertSelective(record); 117 | } 118 | 119 | /** 120 | * Batch save int. 121 | * 122 | * @param list the list 123 | * @return the int 124 | */ 125 | @Override 126 | public int batchSave(List list) { 127 | int result = 0; 128 | for (T record : list) { 129 | int count = mapper.insertSelective(record); 130 | result += count; 131 | } 132 | return result; 133 | } 134 | 135 | /** 136 | * Update int. 137 | * 138 | * @param entity the entity 139 | * @return the int 140 | */ 141 | @Override 142 | public int update(T entity) { 143 | return mapper.updateByPrimaryKeySelective(entity); 144 | } 145 | 146 | /** 147 | * Delete int. 148 | * 149 | * @param record the record 150 | * @return the int 151 | */ 152 | @Override 153 | public int delete(T record) { 154 | return mapper.delete(record); 155 | } 156 | 157 | /** 158 | * Delete by key int. 159 | * 160 | * @param key the key 161 | * @return the int 162 | */ 163 | @Override 164 | public int deleteByKey(Object key) { 165 | return mapper.deleteByPrimaryKey(key); 166 | } 167 | 168 | /** 169 | * Batch delete int. 170 | * 171 | * @param list the list 172 | * @return the int 173 | */ 174 | @Override 175 | public int batchDelete(List list) { 176 | int result = 0; 177 | for (T record : list) { 178 | int count = mapper.delete(record); 179 | if (count < 1) { 180 | logger.error("删除数据失败"); 181 | throw new BusinessException("删除数据失败!"); 182 | } 183 | result += count; 184 | } 185 | return result; 186 | } 187 | 188 | /** 189 | * Select count by example int. 190 | * 191 | * @param example the example 192 | * @return the int 193 | */ 194 | @Override 195 | public int selectCountByExample(Object example) { 196 | return mapper.selectCountByExample(example); 197 | } 198 | 199 | /** 200 | * Update by example int. 201 | * 202 | * @param record the record 203 | * @param example the example 204 | * @return the int 205 | */ 206 | @Override 207 | public int updateByExample(T record, Object example) { 208 | return mapper.updateByExampleSelective(record, example); 209 | } 210 | 211 | /** 212 | * Delete by example int. 213 | * 214 | * @param example the example 215 | * @return the int 216 | */ 217 | @Override 218 | public int deleteByExample(Object example) { 219 | return mapper.deleteByPrimaryKey(example); 220 | } 221 | 222 | /** 223 | * Select by row bounds list. 224 | * 225 | * @param record the record 226 | * @param rowBounds the row bounds 227 | * @return the list 228 | */ 229 | @Override 230 | public List selectByRowBounds(T record, RowBounds rowBounds) { 231 | return mapper.selectByRowBounds(record, rowBounds); 232 | } 233 | 234 | /** 235 | * Select by example and row bounds list. 236 | * 237 | * @param example the example 238 | * @param rowBounds the row bounds 239 | * @return the list 240 | */ 241 | @Override 242 | public List selectByExampleAndRowBounds(Object example, RowBounds rowBounds) { 243 | return mapper.selectByExampleAndRowBounds(example, rowBounds); 244 | } 245 | } 246 | -------------------------------------------------------------------------------- /dc3-common/dc3-common-core/src/main/java/com/pnoker/common/util/core/support/IService.java: -------------------------------------------------------------------------------- 1 | 2 | package com.pnoker.common.util.core.support; 3 | 4 | import org.apache.ibatis.annotations.Param; 5 | import org.apache.ibatis.session.RowBounds; 6 | import org.springframework.transaction.annotation.Transactional; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * @author: Pnoker 12 | * @email: pnokers@gmail.com 13 | * @project: iot-dc3 14 | * @copyright: Copyright(c) 2018. Pnoker All Rights Reserved. 15 | *

16 | * 通用服务接口 17 | */ 18 | public interface IService { 19 | /** 20 | * 根据实体中的属性值进行查询, 查询条件使用等号 21 | * 22 | * @param record the record 23 | * @return the list 24 | */ 25 | List select(T record); 26 | 27 | /** 28 | * 根据主键字段进行查询, 方法参数必须包含完整的主键属性, 查询条件使用等号 29 | * 30 | * @param key the key 31 | * @return the t 32 | */ 33 | T selectByKey(Object key); 34 | 35 | /** 36 | * 查询全部结果, select(null)方法能达到同样的效果 37 | * 38 | * @return the list 39 | */ 40 | List selectAll(); 41 | 42 | /** 43 | * 根据实体中的属性进行查询, 只能有一个返回值, 有多个结果是抛出异常, 查询条件使用等号 44 | * 45 | * @param record the record 46 | * @return the t 47 | */ 48 | T selectOne(T record); 49 | 50 | /** 51 | * 根据实体中的属性查询总数, 查询条件使用等号 52 | * 53 | * @param record the record 54 | * @return the int 55 | */ 56 | int selectCount(T record); 57 | 58 | /** 59 | * 保存一个实体, null的属性不会保存, 会使用数据库默认值 60 | * 61 | * @param record the record 62 | * @return the int 63 | */ 64 | int save(T record); 65 | 66 | /** 67 | * 批量保存 68 | * 69 | * @param list the list 70 | * @return the int 71 | */ 72 | @Transactional(rollbackFor = Exception.class) 73 | int batchSave(List list); 74 | 75 | /** 76 | * 根据主键更新属性不为null的值 77 | * 78 | * @param entity the entity 79 | * @return the int 80 | */ 81 | int update(T entity); 82 | 83 | /** 84 | * 根据实体属性作为条件进行删除, 查询条件使用等号 85 | * 86 | * @param record the record 87 | * @return the int 88 | */ 89 | int delete(T record); 90 | 91 | /** 92 | * 批量删除 93 | * 94 | * @param list the list 95 | * @return the int 96 | */ 97 | @Transactional(rollbackFor = Exception.class) 98 | int batchDelete(List list); 99 | 100 | /** 101 | * 根据主键字段进行删除, 方法参数必须包含完整的主键属性 102 | * 103 | * @param key the key 104 | * @return the int 105 | */ 106 | int deleteByKey(Object key); 107 | 108 | /** 109 | * 这个查询支持通过Example类指定查询列, 通过selectProperties方法指定查询列 110 | * 111 | * @param example the example 112 | * @return the list 113 | */ 114 | List selectByExample(Object example); 115 | 116 | /** 117 | * 根据Example条件进行查询总数 118 | * 119 | * @param example the example 120 | * @return the int 121 | */ 122 | int selectCountByExample(Object example); 123 | 124 | /** 125 | * 根据Example条件更新实体record包含的不是null的属性值 126 | * 127 | * @param record the record 128 | * @param example the example 129 | * @return the int 130 | */ 131 | int updateByExample(@Param("record") T record, @Param("example") Object example); 132 | 133 | /** 134 | * 根据Example条件删除数据 135 | * 136 | * @param example the example 137 | * @return the int 138 | */ 139 | int deleteByExample(Object example); 140 | 141 | /** 142 | * 根据实体属性和RowBounds进行分页查询 143 | * 144 | * @param record the record 145 | * @param rowBounds the row bounds 146 | * @return the list 147 | */ 148 | List selectByRowBounds(T record, RowBounds rowBounds); 149 | 150 | /** 151 | * 根据example条件和RowBounds进行分页查询 152 | * 153 | * @param example the example 154 | * @param rowBounds the row bounds 155 | * @return the list 156 | */ 157 | List selectByExampleAndRowBounds(Object example, RowBounds rowBounds); 158 | 159 | } 160 | -------------------------------------------------------------------------------- /dc3-common/dc3-common-model/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | 3 | ### IntelliJ IDEA ### 4 | .idea 5 | *.iws 6 | *.iml 7 | *.ipr -------------------------------------------------------------------------------- /dc3-common/dc3-common-model/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.pnoker.common 8 | dc3-common-model 9 | 10 | 11 | com.pnoker.common 12 | dc3-common 13 | 3.0 14 | 15 | 16 | 17 | 18 | 4.0.4 19 | 20 | 21 | 22 | 23 | 24 | tk.mybatis 25 | mapper 26 | ${mapper.version} 27 | 28 | 29 | -------------------------------------------------------------------------------- /dc3-common/dc3-common-model/src/main/java/com/pnoker/common/util/model/domain/User.java: -------------------------------------------------------------------------------- 1 | package com.pnoker.common.util.model.domain; 2 | 3 | import javax.persistence.GeneratedValue; 4 | import javax.persistence.GenerationType; 5 | import javax.persistence.Id; 6 | 7 | public class User { 8 | /** 9 | * id唯一标识 10 | */ 11 | @Id 12 | @GeneratedValue(strategy = GenerationType.IDENTITY) 13 | private Long id; 14 | 15 | /** 16 | * 用户名 17 | */ 18 | private String name; 19 | 20 | /** 21 | * 密码 22 | */ 23 | private String pass; 24 | 25 | /** 26 | * 获取id唯一标识 27 | * 28 | * @return id - id唯一标识 29 | */ 30 | public Long getId() { 31 | return id; 32 | } 33 | 34 | /** 35 | * 设置id唯一标识 36 | * 37 | * @param id id唯一标识 38 | */ 39 | public void setId(Long id) { 40 | this.id = id; 41 | } 42 | 43 | /** 44 | * 获取用户名 45 | * 46 | * @return name - 用户名 47 | */ 48 | public String getName() { 49 | return name; 50 | } 51 | 52 | /** 53 | * 设置用户名 54 | * 55 | * @param name 用户名 56 | */ 57 | public void setName(String name) { 58 | this.name = name; 59 | } 60 | 61 | /** 62 | * 获取密码 63 | * 64 | * @return pass - 密码 65 | */ 66 | public String getPass() { 67 | return pass; 68 | } 69 | 70 | /** 71 | * 设置密码 72 | * 73 | * @param pass 密码 74 | */ 75 | public void setPass(String pass) { 76 | this.pass = pass; 77 | } 78 | } -------------------------------------------------------------------------------- /dc3-common/dc3-common-util/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | 3 | ### IntelliJ IDEA ### 4 | .idea 5 | *.iws 6 | *.iml 7 | *.ipr -------------------------------------------------------------------------------- /dc3-common/dc3-common-util/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.pnoker.common 8 | dc3-common-util 9 | 10 | 11 | com.pnoker.common 12 | dc3-common 13 | 3.0 14 | 15 | 16 | 17 | 18 | 2.9.2 19 | 20 | 21 | 22 | 23 | com.fasterxml.jackson.core 24 | jackson-annotations 25 | 2.8.5 26 | 27 | 28 | com.fasterxml.jackson.core 29 | jackson-databind 30 | 2.8.11.1 31 | 32 | 33 | org.codehaus.jackson 34 | jackson-mapper-asl 35 | 1.9.13 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /dc3-common/dc3-common-util/src/main/java/com/pnoker/common/util/wrapper/WrapMapper.java: -------------------------------------------------------------------------------- 1 | 2 | package com.pnoker.common.util.wrapper; 3 | 4 | import org.apache.commons.lang3.StringUtils; 5 | 6 | /** 7 | * @author: Pnoker 8 | * @email: pnokers@gmail.com 9 | * @project: iot-dc3 10 | * @copyright: Copyright(c) 2018. Pnoker All Rights Reserved. 11 | *

12 | * The class Wrap mapper. 13 | */ 14 | public class WrapMapper { 15 | 16 | /** 17 | * Instantiates a new wrap mapper. 18 | */ 19 | private WrapMapper() { 20 | } 21 | 22 | /** 23 | * Wrap. 24 | * 25 | * @param the element type 26 | * @param code the code 27 | * @param message the message 28 | * @param o the o 29 | * @return the wrapper 30 | */ 31 | public static Wrapper wrap(int code, String message, E o) { 32 | return new Wrapper<>(code, message, o); 33 | } 34 | 35 | /** 36 | * Wrap. 37 | * 38 | * @param the element type 39 | * @param code the code 40 | * @param message the message 41 | * @return the wrapper 42 | */ 43 | public static Wrapper wrap(int code, String message) { 44 | return wrap(code, message, null); 45 | } 46 | 47 | /** 48 | * Wrap. 49 | * 50 | * @param the element type 51 | * @param code the code 52 | * @return the wrapper 53 | */ 54 | public static Wrapper wrap(int code) { 55 | return wrap(code, null); 56 | } 57 | 58 | /** 59 | * Wrap. 60 | * 61 | * @param the element type 62 | * @param e the e 63 | * @return the wrapper 64 | */ 65 | public static Wrapper wrap(Exception e) { 66 | return new Wrapper<>(Wrapper.ERROR_CODE, e.getMessage()); 67 | } 68 | 69 | /** 70 | * Un wrapper. 71 | * 72 | * @param the element type 73 | * @param wrapper the wrapper 74 | * @return the e 75 | */ 76 | public static E unWrap(Wrapper wrapper) { 77 | return wrapper.getResult(); 78 | } 79 | 80 | /** 81 | * Wrap ERROR. code=100 82 | * 83 | * @param the element type 84 | * @return the wrapper 85 | */ 86 | public static Wrapper illegalArgument() { 87 | return wrap(Wrapper.ILLEGAL_ARGUMENT_CODE_, Wrapper.ILLEGAL_ARGUMENT_MESSAGE); 88 | } 89 | 90 | /** 91 | * Wrap ERROR. code=500 92 | * 93 | * @param the element type 94 | * @return the wrapper 95 | */ 96 | public static Wrapper error() { 97 | return wrap(Wrapper.ERROR_CODE, Wrapper.ERROR_MESSAGE); 98 | } 99 | 100 | 101 | /** 102 | * Error wrapper. 103 | * 104 | * @param the type parameter 105 | * @param message the message 106 | * @return the wrapper 107 | */ 108 | public static Wrapper error(String message) { 109 | return wrap(Wrapper.ERROR_CODE, StringUtils.isBlank(message) ? Wrapper.ERROR_MESSAGE : message); 110 | } 111 | 112 | /** 113 | * Wrap SUCCESS. code=200 114 | * 115 | * @param the element type 116 | * @return the wrapper 117 | */ 118 | public static Wrapper ok() { 119 | return new Wrapper<>(); 120 | } 121 | 122 | /** 123 | * Ok wrapper. 124 | * 125 | * @param the type parameter 126 | * @param o the o 127 | * @return the wrapper 128 | */ 129 | public static Wrapper ok(E o) { 130 | return new Wrapper<>(Wrapper.SUCCESS_CODE, Wrapper.SUCCESS_MESSAGE, o); 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /dc3-common/dc3-common-util/src/main/java/com/pnoker/common/util/wrapper/Wrapper.java: -------------------------------------------------------------------------------- 1 | 2 | package com.pnoker.common.util.wrapper; 3 | 4 | import com.fasterxml.jackson.annotation.JsonIgnore; 5 | import lombok.Data; 6 | import org.codehaus.jackson.map.annotate.JsonSerialize; 7 | 8 | import java.io.Serializable; 9 | 10 | /** 11 | * @author: Pnoker 12 | * @email: pnokers@gmail.com 13 | * @project: iot-dc3 14 | * @copyright: Copyright(c) 2018. Pnoker All Rights Reserved. 15 | *

16 | * The class Wrapper. 17 | */ 18 | @Data 19 | @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL) 20 | public class Wrapper implements Serializable { 21 | 22 | /** 23 | * 序列化标识 24 | */ 25 | private static final long serialVersionUID = 4893280118017319089L; 26 | 27 | /** 28 | * 成功码. 29 | */ 30 | public static final int SUCCESS_CODE = 200; 31 | 32 | /** 33 | * 成功信息. 34 | */ 35 | public static final String SUCCESS_MESSAGE = "操作成功"; 36 | 37 | /** 38 | * 错误码. 39 | */ 40 | public static final int ERROR_CODE = 500; 41 | 42 | /** 43 | * 错误信息. 44 | */ 45 | public static final String ERROR_MESSAGE = "内部异常"; 46 | 47 | /** 48 | * 错误码:参数非法 49 | */ 50 | public static final int ILLEGAL_ARGUMENT_CODE_ = 100; 51 | 52 | /** 53 | * 错误信息:参数非法 54 | */ 55 | public static final String ILLEGAL_ARGUMENT_MESSAGE = "参数非法"; 56 | 57 | /** 58 | * 编号. 59 | */ 60 | private int code; 61 | 62 | /** 63 | * 信息. 64 | */ 65 | private String message; 66 | 67 | /** 68 | * 结果数据 69 | */ 70 | private T result; 71 | 72 | /** 73 | * Instantiates a new wrapper. default code=200 74 | */ 75 | Wrapper() { 76 | this(SUCCESS_CODE, SUCCESS_MESSAGE); 77 | } 78 | 79 | /** 80 | * Instantiates a new wrapper. 81 | * 82 | * @param code the code 83 | * @param message the message 84 | */ 85 | Wrapper(int code, String message) { 86 | this(code, message, null); 87 | } 88 | 89 | /** 90 | * Instantiates a new wrapper. 91 | * 92 | * @param code the code 93 | * @param message the message 94 | * @param result the result 95 | */ 96 | Wrapper(int code, String message, T result) { 97 | super(); 98 | this.code(code).message(message).result(result); 99 | } 100 | 101 | /** 102 | * Sets the 编号 , 返回自身的引用. 103 | * 104 | * @param code the new 编号 105 | * @return the wrapper 106 | */ 107 | private Wrapper code(int code) { 108 | this.setCode(code); 109 | return this; 110 | } 111 | 112 | /** 113 | * Sets the 信息 , 返回自身的引用. 114 | * 115 | * @param message the new 信息 116 | * @return the wrapper 117 | */ 118 | private Wrapper message(String message) { 119 | this.setMessage(message); 120 | return this; 121 | } 122 | 123 | /** 124 | * Sets the 结果数据 , 返回自身的引用. 125 | * 126 | * @param result the new 结果数据 127 | * @return the wrapper 128 | */ 129 | public Wrapper result(T result) { 130 | this.setResult(result); 131 | return this; 132 | } 133 | 134 | /** 135 | * 判断是否成功: 依据 Wrapper.SUCCESS_CODE == this.code 136 | * 137 | * @return code =200,true;否则 false. 138 | */ 139 | @JsonIgnore 140 | public boolean success() { 141 | return Wrapper.SUCCESS_CODE == this.code; 142 | } 143 | 144 | /** 145 | * 判断是否成功: 依据 Wrapper.SUCCESS_CODE != this.code 146 | * 147 | * @return code !=200,true;否则 false. 148 | */ 149 | @JsonIgnore 150 | public boolean error() { 151 | return !success(); 152 | } 153 | 154 | } 155 | -------------------------------------------------------------------------------- /dc3-common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.pnoker.common 7 | dc3-common 8 | pom 9 | 10 | 11 | com.pnoker 12 | iot-dc3 13 | 3.0 14 | 15 | 16 | 17 | dc3-common-base 18 | dc3-common-core 19 | dc3-common-util 20 | dc3-common-model 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /dc3-service/dc3-service-center/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | 3 | ### IntelliJ IDEA ### 4 | .idea 5 | *.iws 6 | *.iml 7 | *.ipr -------------------------------------------------------------------------------- /dc3-service/dc3-service-center/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.pnoker 7 | dc3-service-center 8 | jar 9 | 10 | 11 | 12 | com.pnoker.service 13 | dc3-service 14 | 3.0 15 | 16 | 17 | 18 | 19 | 20 | org.springframework.cloud 21 | spring-cloud-starter-netflix-eureka-server 22 | 23 | 24 | 25 | 26 | org.springframework.cloud 27 | spring-cloud-starter-netflix-ribbon 28 | 29 | 30 | 31 | 32 | org.springframework.cloud 33 | spring-cloud-starter-openfeign 34 | 35 | 36 | 37 | 38 | org.springframework.boot 39 | spring-boot-starter-web 40 | 41 | 42 | org.springframework.boot 43 | spring-boot-starter-tomcat 44 | 45 | 46 | 47 | 48 | 49 | 50 | org.springframework.boot 51 | spring-boot-starter-undertow 52 | 53 | 54 | 55 | 56 | 57 | ${project.artifactId} 58 | 59 | 60 | org.springframework.boot 61 | spring-boot-maven-plugin 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /dc3-service/dc3-service-center/src/main/java/com/pnoker/ServiceCenterApplication.java: -------------------------------------------------------------------------------- 1 | package com.pnoker; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; 6 | 7 | /** 8 | * @author: Pnoker 9 | * @email : pnokers@gmail.com 10 | */ 11 | @EnableEurekaServer 12 | @SpringBootApplication 13 | public class ServiceCenterApplication { 14 | 15 | public static void main(String[] args) { 16 | SpringApplication.run(ServiceCenterApplication.class, args); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /dc3-service/dc3-service-center/src/main/resources/application-dev.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8800 3 | undertow: 4 | worker-threads: 20 5 | buffer-size: 512 6 | io-threads: 2 7 | 8 | # 日志配置 9 | logging: 10 | file: dc3/logs/service/center/dc3-service-center-dev.log 11 | 12 | # Eureka 服务中心 13 | eureka: 14 | instance: 15 | hostname: localhost 16 | client: 17 | register-with-eureka: false 18 | fetch-registry: false 19 | serviceUrl: 20 | defaultZone: http://localhost:8800/eureka/ -------------------------------------------------------------------------------- /dc3-service/dc3-service-center/src/main/resources/application-product1.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8800 3 | undertow: 4 | worker-threads: 20 5 | buffer-size: 512 6 | io-threads: 2 7 | 8 | # 日志配置 9 | logging: 10 | file: dc3/logs/service/center/dc3-service-center-product-1.log 11 | 12 | # Eureka 服务中心 13 | eureka: 14 | instance: 15 | hostname: service1 16 | client: 17 | serviceUrl: 18 | defaultZone: http://service2:8801/eureka/ -------------------------------------------------------------------------------- /dc3-service/dc3-service-center/src/main/resources/application-product2.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8801 3 | undertow: 4 | worker-threads: 20 5 | buffer-size: 512 6 | io-threads: 2 7 | 8 | # 日志配置 9 | logging: 10 | file: dc3/logs/service/center/dc3-service-center-product-2.log 11 | 12 | # Eureka 服务中心 13 | eureka: 14 | instance: 15 | hostname: service2 16 | client: 17 | serviceUrl: 18 | defaultZone: http://service1:8800/eureka/ -------------------------------------------------------------------------------- /dc3-service/dc3-service-center/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: dc3-service-center 4 | profiles: 5 | active: dev -------------------------------------------------------------------------------- /dc3-service/dc3-service-center/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | 2 | ${AnsiColor.BRIGHT_CYAN}Spring Boot${spring-boot.formatted-version}${AnsiColor.BRIGHT_RED} 3 | .___ ________ .__ __ .__ __ _____ 4 | __| _/____ \_____ \ |__| _____/ |_ ______ | | _____ _/ |__/ ____\___________ _____ 5 | / __ |/ ___\ _(__ < | |/ _ \ __\ \____ \| | \__ \\ __\ __\/ _ \_ __ \/ \ 6 | / /_/ \ \___ / \ | ( <_> ) | | |_> > |__/ __ \| | | | ( <_> ) | \/ Y Y \ 7 | \____ |\___ >______ / |__|\____/|__| | __/|____(____ /__| |__| \____/|__| |__|_| / 8 | \/ \/ \/ |__| \/ \/ 9 | ${AnsiColor.BRIGHT_CYAN}Copyright c 2018-2020 The ${AnsiColor.BRIGHT_YELLOW}Pnoker${AnsiColor.BRIGHT_CYAN} Authors 10 | -------------------------------------------------------------------------------- /dc3-service/dc3-service-center/src/main/resources/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erliuwang/iot-dc3/2203ccff541dc8d89fe98fecaa74473896b1792d/dc3-service/dc3-service-center/src/main/resources/static/favicon.ico -------------------------------------------------------------------------------- /dc3-service/dc3-service-dbs/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | 3 | ### IntelliJ IDEA ### 4 | .idea 5 | *.iws 6 | *.iml 7 | *.ipr -------------------------------------------------------------------------------- /dc3-service/dc3-service-dbs/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.pnoker.service 7 | dc3-service-dbs 8 | jar 9 | 10 | 11 | com.pnoker.service 12 | dc3-service 13 | 3.0 14 | 15 | 16 | 17 | 18 | 4.0.4 19 | 2.3.0 20 | 3.2.0 21 | 1.3.7 22 | 1.3.7 23 | 1.3.2 24 | 2.0.4 25 | 26 | 27 | ${basedir}/src/main/java 28 | com.pnoker.service.dbs.dao 29 | com.pnoker.common.model.domain 30 | 31 | ${basedir}/src/main/resources 32 | mapper 33 | 34 | 35 | 36 | 37 | 38 | org.springframework.cloud 39 | spring-cloud-starter-netflix-eureka-client 40 | 41 | 42 | 43 | 44 | org.springframework.boot 45 | spring-boot-starter-web 46 | 47 | 48 | org.springframework.boot 49 | spring-boot-starter-tomcat 50 | 51 | 52 | 53 | 54 | 55 | 56 | org.springframework.boot 57 | spring-boot-starter-undertow 58 | 59 | 60 | 61 | 62 | tk.mybatis 63 | mapper-spring-boot-starter 64 | ${spring.boot.mapper.version} 65 | 66 | 67 | 68 | 69 | com.pnoker.api 70 | dc3-api 71 | 3.0 72 | compile 73 | 74 | 75 | 76 | 77 | org.mariadb.jdbc 78 | mariadb-java-client 79 | ${mariadb.version} 80 | 81 | 82 | 83 | 84 | org.springframework.boot 85 | spring-boot-starter-data-redis 86 | 87 | 88 | 89 | 90 | org.springframework.boot 91 | spring-boot-starter-jdbc 92 | 93 | 94 | org.apache.tomcat 95 | tomcat-jdbc 96 | 97 | 98 | 99 | 100 | 101 | 102 | com.zaxxer 103 | HikariCP 104 | ${hikaricp.version} 105 | 106 | 107 | 108 | 109 | org.mybatis.spring.boot 110 | mybatis-spring-boot-starter 111 | ${spring.boot.mybatis.version} 112 | 113 | 114 | 115 | 116 | org.mybatis.generator 117 | mybatis-generator-core 118 | ${mybatis.generator.version} 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | org.mybatis.generator 127 | mybatis-generator-maven-plugin 128 | ${mybatis.plugin.version} 129 | 130 | src/main/resources/generator/generatorConfig-A.xml 131 | true 132 | true 133 | 134 | 135 | 136 | org.mariadb.jdbc 137 | mariadb-java-client 138 | ${mariadb.version} 139 | 140 | 141 | tk.mybatis 142 | mapper 143 | ${mapper.version} 144 | 145 | 146 | 147 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /dc3-service/dc3-service-dbs/src/main/java/com/pnoker/service/DbsApplication.java: -------------------------------------------------------------------------------- 1 | package com.pnoker.service; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 6 | import org.springframework.transaction.annotation.EnableTransactionManagement; 7 | 8 | /** 9 | * @author: Pnoker 10 | * @email: pnokers@gmail.com 11 | * @project: iot-dc3 12 | * @copyright: Copyright(c) 2018. Pnoker All Rights Reserved. 13 | *

14 | */ 15 | @EnableEurekaClient 16 | @SpringBootApplication 17 | @EnableTransactionManagement 18 | public class DbsApplication { 19 | public static void main(String[] args) { 20 | SpringApplication.run(DbsApplication.class, args); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /dc3-service/dc3-service-dbs/src/main/java/com/pnoker/service/dbs/controller/UserFeignClient.java: -------------------------------------------------------------------------------- 1 | package com.pnoker.service.dbs.controller; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.pnoker.api.dbs.UserFeignApi; 5 | import com.pnoker.common.util.core.support.BaseController; 6 | import com.pnoker.common.util.model.domain.User; 7 | import com.pnoker.common.util.wrapper.WrapMapper; 8 | import com.pnoker.common.util.wrapper.Wrapper; 9 | import com.pnoker.service.dbs.service.UserService; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.web.bind.annotation.PathVariable; 12 | import org.springframework.web.bind.annotation.RestController; 13 | 14 | /** 15 | * @author: Pnoker 16 | * @email: pnokers@gmail.com 17 | * @project: iot-dc3 18 | * @copyright: Copyright(c) 2018. Pnoker All Rights Reserved. 19 | *

20 | */ 21 | @RestController 22 | public class UserFeignClient extends BaseController implements UserFeignApi { 23 | @Autowired 24 | private UserService userService; 25 | 26 | 27 | @Override 28 | public Wrapper getById(@PathVariable("userId") Long userId) { 29 | logger.info("search userId {}", userId); 30 | User user = userService.selectByKey(userId); 31 | return WrapMapper.wrap(Wrapper.SUCCESS_CODE, Wrapper.SUCCESS_MESSAGE, JSON.toJSONString(user)); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /dc3-service/dc3-service-dbs/src/main/java/com/pnoker/service/dbs/dao/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.pnoker.service.dbs.dao; 2 | 3 | import com.pnoker.common.util.core.mybatis.MyMapper; 4 | import com.pnoker.common.util.model.domain.User; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.springframework.stereotype.Component; 7 | 8 | @Mapper 9 | @Component 10 | public interface UserMapper extends MyMapper { 11 | } -------------------------------------------------------------------------------- /dc3-service/dc3-service-dbs/src/main/java/com/pnoker/service/dbs/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.pnoker.service.dbs.service; 2 | 3 | import com.pnoker.common.util.core.support.IService; 4 | import com.pnoker.common.util.model.domain.User; 5 | 6 | /** 7 | * @author: Pnoker 8 | * @email: pnokers@gmail.com 9 | * @project: iot-dc3 10 | * @copyright: Copyright(c) 2018. Pnoker All Rights Reserved. 11 | *

12 | */ 13 | public interface UserService extends IService { 14 | } 15 | -------------------------------------------------------------------------------- /dc3-service/dc3-service-dbs/src/main/java/com/pnoker/service/dbs/service/impl/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.pnoker.service.dbs.service.impl; 2 | 3 | import com.pnoker.common.util.core.support.BaseService; 4 | import com.pnoker.common.util.model.domain.User; 5 | import com.pnoker.service.dbs.service.UserService; 6 | import org.springframework.stereotype.Service; 7 | 8 | /** 9 | * @author: Pnoker 10 | * @email: pnokers@gmail.com 11 | * @project: iot-dc3 12 | * @copyright: Copyright(c) 2018. Pnoker All Rights Reserved. 13 | *

14 | */ 15 | @Service 16 | public class UserServiceImpl extends BaseService implements UserService { 17 | } 18 | -------------------------------------------------------------------------------- /dc3-service/dc3-service-dbs/src/main/resources/application-dev.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8805 3 | undertow: 4 | worker-threads: 20 5 | buffer-size: 512 6 | io-threads: 2 7 | 8 | spring: 9 | redis: 10 | host: localhost 11 | password: 123456 12 | datasource: 13 | url: jdbc:mysql://localhost:3306/iot-dc3?useUnicode=true&characterEncoding=utf-8 14 | driver-class-name: org.mariadb.jdbc.Driver 15 | username: root 16 | password: 123456 17 | sql-script-encoding: utf-8 18 | hikari: 19 | max-lifetime: 1765000 20 | maximum-pool-size: 10 21 | 22 | logging: 23 | file: dc3/logs/dc3-service-dbs-dev.log 24 | 25 | eureka: 26 | client: 27 | serviceUrl: 28 | defaultZone: http://localhost:8800/eureka/ -------------------------------------------------------------------------------- /dc3-service/dc3-service-dbs/src/main/resources/application-product.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8805 3 | undertow: 4 | worker-threads: 20 5 | buffer-size: 512 6 | io-threads: 2 7 | 8 | spring: 9 | redis: 10 | host: localhost 11 | password: 123456 12 | datasource: 13 | url: jdbc:mysql://localhost:3306/iot-dc3?useUnicode=true&characterEncoding=utf-8 14 | driver-class-name: com.mysql.jdbc.Driver 15 | username: root 16 | password: 123456 17 | sql-script-encoding: utf-8 18 | hikari: 19 | max-lifetime: 1765000 20 | maximum-pool-size: 10 21 | 22 | mybatis: 23 | configuration: 24 | map-underscore-to-camel-case: true 25 | 26 | # 日志配置 27 | logging: 28 | file: dc3/logs/dc3-service-dbs-product.log 29 | 30 | eureka: 31 | client: 32 | serviceUrl: 33 | defaultZone: http://localhost:8800/eureka/,http://localhost:8801/eureka/ -------------------------------------------------------------------------------- /dc3-service/dc3-service-dbs/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: dc3-service-dbs 4 | profiles: 5 | active: dev -------------------------------------------------------------------------------- /dc3-service/dc3-service-dbs/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | 2 | ${AnsiColor.BRIGHT_CYAN}Spring Boot${spring-boot.formatted-version}${AnsiColor.BRIGHT_RED} 3 | .___ ________ .__ __ .__ __ _____ 4 | __| _/____ \_____ \ |__| _____/ |_ ______ | | _____ _/ |__/ ____\___________ _____ 5 | / __ |/ ___\ _(__ < | |/ _ \ __\ \____ \| | \__ \\ __\ __\/ _ \_ __ \/ \ 6 | / /_/ \ \___ / \ | ( <_> ) | | |_> > |__/ __ \| | | | ( <_> ) | \/ Y Y \ 7 | \____ |\___ >______ / |__|\____/|__| | __/|____(____ /__| |__| \____/|__| |__|_| / 8 | \/ \/ \/ |__| \/ \/ 9 | ${AnsiColor.BRIGHT_CYAN}Copyright c 2018-2020 The ${AnsiColor.BRIGHT_YELLOW}Pnoker${AnsiColor.BRIGHT_CYAN} Authors 10 | -------------------------------------------------------------------------------- /dc3-service/dc3-service-dbs/src/main/resources/config.properties: -------------------------------------------------------------------------------- 1 | #数据库 2 | jdbc.driverClass=org.mariadb.jdbc.Driver 3 | jdbc.url=jdbc:mysql://localhost:3306/iot-dc3?useUnicode=true&characterEncoding=UTF-8 4 | jdbc.user=root 5 | jdbc.password=123456 6 | 7 | #MapperPlugin 8 | mapper.plugin=tk.mybatis.mapper.generator.MapperPlugin 9 | mapper.Mapper=tk.mybatis.mapper.common.Mapper -------------------------------------------------------------------------------- /dc3-service/dc3-service-dbs/src/main/resources/generator/generatorConfig-A.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 34 | 35 | 36 | 38 | 39 | 40 | 41 | 43 | 44 | 45 | 46 | 47 |
48 |
49 |
-------------------------------------------------------------------------------- /dc3-service/dc3-service-dbs/src/main/resources/generator/generatorConfig-B.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 28 | 29 | 30 | 31 | 32 | 33 | 35 | 36 | 37 | 38 | 39 | 41 | 42 | 43 | 44 | 47 | 48 | 49 | 50 | 51 | 54 | 55 | -------------------------------------------------------------------------------- /dc3-service/dc3-service-dbs/src/main/resources/mapper/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /dc3-service/dc3-service-dbs/src/main/resources/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erliuwang/iot-dc3/2203ccff541dc8d89fe98fecaa74473896b1792d/dc3-service/dc3-service-dbs/src/main/resources/static/favicon.ico -------------------------------------------------------------------------------- /dc3-service/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.pnoker.service 7 | dc3-service 8 | pom 9 | 10 | 11 | com.pnoker 12 | iot-dc3 13 | 3.0 14 | 15 | 16 | 17 | dc3-service-center 18 | dc3-service-dbs 19 | 20 | 21 | 22 | 23 | 24 | org.springframework.cloud 25 | spring-cloud-starter-netflix-hystrix 26 | 27 | 28 | 29 | 30 | com.pnoker.common 31 | dc3-common-core 32 | 3.0 33 | compile 34 | 35 | 36 | 37 | com.pnoker.common 38 | dc3-common-model 39 | 3.0 40 | compile 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /dc3-webapp/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | 3 | ### IntelliJ IDEA ### 4 | .idea 5 | *.iws 6 | *.iml 7 | *.ipr -------------------------------------------------------------------------------- /dc3-webapp/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.pnoker 7 | dc3-webapp 8 | jar 9 | 10 | iot-dc3 系统 Web 展示页面处理服务器,用于提供网页模板、页面逻辑处理、推送、接口等服务。 11 | 12 | 13 | com.pnoker 14 | iot-dc3 15 | 3.0 16 | 17 | 18 | 19 | 20 | 21 | org.springframework.cloud 22 | spring-cloud-starter-netflix-eureka-client 23 | 24 | 25 | 26 | 27 | com.pnoker.api 28 | dc3-api 29 | 3.0 30 | compile 31 | 32 | 33 | 34 | com.pnoker.common 35 | dc3-common-core 36 | 3.0 37 | compile 38 | 39 | 40 | 41 | com.pnoker.common 42 | dc3-common-model 43 | 3.0 44 | compile 45 | 46 | 47 | 48 | 49 | org.springframework.boot 50 | spring-boot-starter-web 51 | 52 | 53 | org.springframework.boot 54 | spring-boot-starter-tomcat 55 | 56 | 57 | 58 | 59 | 60 | 61 | org.springframework.boot 62 | spring-boot-starter-undertow 63 | 64 | 65 | 66 | 67 | org.springframework.boot 68 | spring-boot-starter-thymeleaf 69 | 70 | 71 | 72 | 73 | 74 | ${project.artifactId} 75 | 76 | 77 | org.springframework.boot 78 | spring-boot-maven-plugin 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /dc3-webapp/src/main/java/com/pnoker/WebappApplication.java: -------------------------------------------------------------------------------- 1 | package com.pnoker; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 6 | import org.springframework.cloud.openfeign.EnableFeignClients; 7 | import org.springframework.scheduling.annotation.EnableAsync; 8 | 9 | /** 10 | * @author: Pnoker 11 | * @email : pnokers@gmail.com 12 | */ 13 | @EnableAsync 14 | @EnableFeignClients 15 | @EnableEurekaClient 16 | @SpringBootApplication 17 | public class WebappApplication { 18 | public static void main(String[] args) { 19 | SpringApplication.run(WebappApplication.class, args); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /dc3-webapp/src/main/java/com/pnoker/controller/IndexController.java: -------------------------------------------------------------------------------- 1 | package com.pnoker.controller; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.pnoker.api.dbs.UserFeignApi; 5 | import com.pnoker.common.util.core.support.BaseController; 6 | import com.pnoker.common.util.wrapper.Wrapper; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RequestMethod; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | /** 13 | * @author: Pnoker 14 | * @email : pnokers@gmail.com 15 | *

16 | * Rest接口控制器 17 | */ 18 | @RestController 19 | public class IndexController extends BaseController { 20 | @Autowired 21 | private UserFeignApi userFeignApi; 22 | 23 | @RequestMapping(value = "/hello", method = RequestMethod.GET) 24 | public String hello() { 25 | logger.info("hello world"); 26 | Wrapper wrapper = userFeignApi.getById(12L); 27 | logger.info(JSON.toJSONString(wrapper)); 28 | return JSON.toJSONString(wrapper); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /dc3-webapp/src/main/java/com/pnoker/service/Test.java: -------------------------------------------------------------------------------- 1 | package com.pnoker.service; 2 | 3 | /** 4 | * @Author : Pnoker 5 | * @E-mail : pnokers@gmail.com 6 | * @Date : 2018年03月06日 13:41 7 | * @Description : 这里添加描述内容... 8 | */ 9 | public class Test { 10 | } 11 | -------------------------------------------------------------------------------- /dc3-webapp/src/main/java/com/pnoker/service/impl/Test.java: -------------------------------------------------------------------------------- 1 | package com.pnoker.service.impl; 2 | 3 | /** 4 | * @Author : Pnoker 5 | * @E-mail : pnokers@gmail.com 6 | * @Date : 2018年03月06日 13:41 7 | * @Description : 这里添加描述内容... 8 | */ 9 | public class Test { 10 | } 11 | -------------------------------------------------------------------------------- /dc3-webapp/src/main/resources/application-dev.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8808 3 | undertow: 4 | worker-threads: 20 5 | buffer-size: 512 6 | io-threads: 2 7 | 8 | feign: 9 | hystrix: 10 | enabled: true 11 | 12 | # 日志配置 13 | logging: 14 | file: dc3/logs/dc3-webapp-dev.log 15 | 16 | eureka: 17 | client: 18 | serviceUrl: 19 | defaultZone: http://localhost:8800/eureka/ -------------------------------------------------------------------------------- /dc3-webapp/src/main/resources/application-product.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8808 3 | undertow: 4 | worker-threads: 20 5 | buffer-size: 512 6 | io-threads: 2 7 | 8 | feign: 9 | hystrix: 10 | enabled: true 11 | 12 | # 日志配置 13 | logging: 14 | file: dc3/logs/dc3-webapp-product.log 15 | 16 | eureka: 17 | client: 18 | serviceUrl: 19 | defaultZone: http://localhost:8800/eureka/,http://localhost:8801/eureka/ -------------------------------------------------------------------------------- /dc3-webapp/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: dc3-webapp 4 | profiles: 5 | active: dev 6 | thymeleaf: 7 | cache: false 8 | enabled: true 9 | check-template: true 10 | mode: HTML5 11 | encoding: UTF-8 12 | prefix: classpath:/templates/ 13 | suffix: .html 14 | servlet: 15 | content-type: text/html -------------------------------------------------------------------------------- /dc3-webapp/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | 2 | ${AnsiColor.BRIGHT_CYAN}Spring Boot${spring-boot.formatted-version}${AnsiColor.BRIGHT_RED} 3 | .___ ________ .__ __ .__ __ _____ 4 | __| _/____ \_____ \ |__| _____/ |_ ______ | | _____ _/ |__/ ____\___________ _____ 5 | / __ |/ ___\ _(__ < | |/ _ \ __\ \____ \| | \__ \\ __\ __\/ _ \_ __ \/ \ 6 | / /_/ \ \___ / \ | ( <_> ) | | |_> > |__/ __ \| | | | ( <_> ) | \/ Y Y \ 7 | \____ |\___ >______ / |__|\____/|__| | __/|____(____ /__| |__| \____/|__| |__|_| / 8 | \/ \/ \/ |__| \/ \/ 9 | ${AnsiColor.BRIGHT_CYAN}Copyright c 2018-2020 The ${AnsiColor.BRIGHT_YELLOW}Pnoker${AnsiColor.BRIGHT_CYAN} Authors 10 | -------------------------------------------------------------------------------- /dc3-webapp/src/main/resources/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erliuwang/iot-dc3/2203ccff541dc8d89fe98fecaa74473896b1792d/dc3-webapp/src/main/resources/static/favicon.ico -------------------------------------------------------------------------------- /dc3-webapp/src/main/resources/static/iview/fonts/ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erliuwang/iot-dc3/2203ccff541dc8d89fe98fecaa74473896b1792d/dc3-webapp/src/main/resources/static/iview/fonts/ionicons.ttf -------------------------------------------------------------------------------- /dc3-webapp/src/main/resources/static/iview/vue.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Vue.js v2.5.17 3 | * (c) 2014-2018 Evan You 4 | * Released under the MIT License. 5 | */ 6 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Vue=t()}(this,function(){"use strict";var y=Object.freeze({});function M(e){return null==e}function D(e){return null!=e}function S(e){return!0===e}function T(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function P(e){return null!==e&&"object"==typeof e}var r=Object.prototype.toString;function l(e){return"[object Object]"===r.call(e)}function i(e){var t=parseFloat(String(e));return 0<=t&&Math.floor(t)===t&&isFinite(e)}function t(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function F(e){var t=parseFloat(e);return isNaN(t)?e:t}function s(e,t){for(var n=Object.create(null),r=e.split(","),i=0;ie.id;)n--;bt.splice(n+1,0,e)}else bt.push(e);Ct||(Ct=!0,Ze(At))}}(this)},St.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||P(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){Fe(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},St.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},St.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},St.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||f(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var Tt={enumerable:!0,configurable:!0,get:$,set:$};function Et(e,t,n){Tt.get=function(){return this[t][n]},Tt.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Tt)}function jt(e){e._watchers=[];var t=e.$options;t.props&&function(n,r){var i=n.$options.propsData||{},o=n._props={},a=n.$options._propKeys=[];n.$parent&&ge(!1);var e=function(e){a.push(e);var t=Ie(e,r,i,n);Ce(o,e,t),e in n||Et(n,"_props",e)};for(var t in r)e(t);ge(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]=null==t[n]?$:v(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;l(t=e._data="function"==typeof t?function(e,t){se();try{return e.call(t,t)}catch(e){return Fe(e,t,"data()"),{}}finally{ce()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&p(r,o)||(void 0,36!==(a=(o+"").charCodeAt(0))&&95!==a&&Et(e,"_data",o))}var a;we(t,!0)}(e):we(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=Y();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;r||(n[i]=new St(e,a||$,$,Nt)),i in e||Lt(e,i,o)}}(e,t.computed),t.watch&&t.watch!==G&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;iparseInt(this.max)&&bn(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};$n=hn,Cn={get:function(){return j}},Object.defineProperty($n,"config",Cn),$n.util={warn:re,extend:m,mergeOptions:Ne,defineReactive:Ce},$n.set=xe,$n.delete=ke,$n.nextTick=Ze,$n.options=Object.create(null),k.forEach(function(e){$n.options[e+"s"]=Object.create(null)}),m(($n.options._base=$n).options.components,kn),$n.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(-1=a&&l()};setTimeout(function(){c\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,oo="[a-zA-Z_][\\w\\-\\.]*",ao="((?:"+oo+"\\:)?"+oo+")",so=new RegExp("^<"+ao),co=/^\s*(\/?)>/,lo=new RegExp("^<\\/"+ao+"[^>]*>"),uo=/^]+>/i,fo=/^",""":'"',"&":"&"," ":"\n"," ":"\t"},go=/&(?:lt|gt|quot|amp);/g,_o=/&(?:lt|gt|quot|amp|#10|#9);/g,bo=s("pre,textarea",!0),$o=function(e,t){return e&&bo(e)&&"\n"===t[0]};var wo,Co,xo,ko,Ao,Oo,So,To,Eo=/^@|^v-on:/,jo=/^v-|^@|^:/,No=/([^]*?)\s+(?:in|of)\s+([^]*)/,Lo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Io=/^\(|\)$/g,Mo=/:(.*)$/,Do=/^:|^v-bind:/,Po=/\.[^.]+/g,Fo=e(eo);function Ro(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:function(e){for(var t={},n=0,r=e.length;n]*>)","i")),n=i.replace(t,function(e,t,n){return r=n.length,ho(o)||"noscript"===o||(t=t.replace(//g,"$1").replace(//g,"$1")),$o(o,t)&&(t=t.slice(1)),d.chars&&d.chars(t),""});a+=i.length-n.length,i=n,A(o,a-r,a)}else{var s=i.indexOf("<");if(0===s){if(fo.test(i)){var c=i.indexOf("--\x3e");if(0<=c){d.shouldKeepComment&&d.comment(i.substring(4,c)),C(c+3);continue}}if(po.test(i)){var l=i.indexOf("]>");if(0<=l){C(l+2);continue}}var u=i.match(uo);if(u){C(u[0].length);continue}var f=i.match(lo);if(f){var p=a;C(f[0].length),A(f[1],p,a);continue}var _=x();if(_){k(_),$o(v,i)&&C(1);continue}}var b=void 0,$=void 0,w=void 0;if(0<=s){for($=i.slice(s);!(lo.test($)||so.test($)||fo.test($)||po.test($)||(w=$.indexOf("<",1))<0);)s+=w,$=i.slice(s);b=i.substring(0,s),C(s)}s<0&&(b=i,i=""),d.chars&&b&&d.chars(b)}if(i===e){d.chars&&d.chars(i);break}}function C(e){a+=e,i=i.substring(e)}function x(){var e=i.match(so);if(e){var t,n,r={tagName:e[1],attrs:[],start:a};for(C(e[0].length);!(t=i.match(co))&&(n=i.match(io));)C(n[0].length),r.attrs.push(n);if(t)return r.unarySlash=t[1],C(t[0].length),r.end=a,r}}function k(e){var t=e.tagName,n=e.unarySlash;m&&("p"===v&&ro(t)&&A(v),g(t)&&v===t&&A(t));for(var r,i,o,a=y(t)||!!n,s=e.attrs.length,c=new Array(s),l=0;l-1"+("true"===d?":("+l+")":":_q("+l+","+d+")")),Ar(c,"change","var $$a="+l+",$$el=$event.target,$$c=$$el.checked?("+d+"):("+v+");if(Array.isArray($$a)){var $$v="+(f?"_n("+p+")":p)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Er(l,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Er(l,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Er(l,"$$c")+"}",null,!0);else if("input"===$&&"radio"===w)r=e,i=_,a=(o=b)&&o.number,s=Or(r,"value")||"null",Cr(r,"checked","_q("+i+","+(s=a?"_n("+s+")":s)+")"),Ar(r,"change",Er(i,s),null,!0);else if("input"===$||"textarea"===$)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,l=o?"change":"range"===r?Pr:"input",u="$event.target.value";s&&(u="$event.target.value.trim()"),a&&(u="_n("+u+")");var f=Er(t,u);c&&(f="if($event.target.composing)return;"+f),Cr(e,"value","("+t+")"),Ar(e,l,f,null,!0),(s||a)&&Ar(e,"blur","$forceUpdate()")}(e,_,b);else if(!j.isReservedTag($))return Tr(e,_,b),!1;return!0},text:function(e,t){t.value&&Cr(e,"textContent","_s("+t.value+")")},html:function(e,t){t.value&&Cr(e,"innerHTML","_s("+t.value+")")}},isPreTag:function(e){return"pre"===e},isUnaryTag:to,mustUseProp:Sn,canBeLeftOpenTag:no,isReservedTag:Un,getTagNamespace:Vn,staticKeys:(Go=Wo,Go.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(","))},Qo=e(function(e){return s("type,tag,attrsList,attrsMap,plain,parent,children,attrs"+(e?","+e:""))});function ea(e,t){e&&(Zo=Qo(t.staticKeys||""),Xo=t.isReservedTag||O,function e(t){t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||c(e.tag)||!Xo(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(Zo)))}(t);if(1===t.type){if(!Xo(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n|^function\s*\(/,na=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,ra={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},ia={esc:"Escape",tab:"Tab",enter:"Enter",space:" ",up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete"]},oa=function(e){return"if("+e+")return null;"},aa={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:oa("$event.target !== $event.currentTarget"),ctrl:oa("!$event.ctrlKey"),shift:oa("!$event.shiftKey"),alt:oa("!$event.altKey"),meta:oa("!$event.metaKey"),left:oa("'button' in $event && $event.button !== 0"),middle:oa("'button' in $event && $event.button !== 1"),right:oa("'button' in $event && $event.button !== 2")};function sa(e,t,n){var r=t?"nativeOn:{":"on:{";for(var i in e)r+='"'+i+'":'+ca(i,e[i])+",";return r.slice(0,-1)+"}"}function ca(t,e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map(function(e){return ca(t,e)}).join(",")+"]";var n=na.test(e.value),r=ta.test(e.value);if(e.modifiers){var i="",o="",a=[];for(var s in e.modifiers)if(aa[s])o+=aa[s],ra[s]&&a.push(s);else if("exact"===s){var c=e.modifiers;o+=oa(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+="if(!('button' in $event)&&"+a.map(la).join("&&")+")return null;"),o&&(i+=o),"function($event){"+i+(n?"return "+e.value+"($event)":r?"return ("+e.value+")($event)":e.value)+"}"}return n||r?e.value:"function($event){"+e.value+"}"}function la(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=ra[e],r=ia[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var ua={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(t,n){t.wrapData=function(e){return"_b("+e+",'"+t.tag+"',"+n.value+","+(n.modifiers&&n.modifiers.prop?"true":"false")+(n.modifiers&&n.modifiers.sync?",true":"")+")"}},cloak:$},fa=function(e){this.options=e,this.warn=e.warn||$r,this.transforms=wr(e.modules,"transformCode"),this.dataGenFns=wr(e.modules,"genData"),this.directives=m(m({},ua),e.directives);var t=e.isReservedTag||O;this.maybeComponent=function(e){return!t(e.tag)},this.onceId=0,this.staticRenderFns=[]};function pa(e,t){var n=new fa(t);return{render:"with(this){return "+(e?da(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function da(e,t){if(e.staticRoot&&!e.staticProcessed)return va(e,t);if(e.once&&!e.onceProcessed)return ha(e,t);if(e.for&&!e.forProcessed)return f=t,v=(u=e).for,h=u.alias,m=u.iterator1?","+u.iterator1:"",y=u.iterator2?","+u.iterator2:"",u.forProcessed=!0,(d||"_l")+"(("+v+"),function("+h+m+y+"){return "+(p||da)(u,f)+"})";if(e.if&&!e.ifProcessed)return ma(e,t);if("template"!==e.tag||e.slotTarget){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=_a(e,t),i="_t("+n+(r?","+r:""),o=e.attrs&&"{"+e.attrs.map(function(e){return g(e.name)+":"+e.value}).join(",")+"}",a=e.attrsMap["v-bind"];!o&&!a||r||(i+=",null");o&&(i+=","+o);a&&(i+=(o?"":",null")+","+a);return i+")"}(e,t);var n;if(e.component)a=e.component,c=t,l=(s=e).inlineTemplate?null:_a(s,c,!0),n="_c("+a+","+ya(s,c)+(l?","+l:"")+")";else{var r=e.plain?void 0:ya(e,t),i=e.inlineTemplate?null:_a(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o':'

',0 2 | 3 | 4 | 5 | iview example 6 | 7 | 8 | 9 | 10 | 11 |
12 | Click me! 13 | Welcome to iView 14 |
15 | 28 | 29 | -------------------------------------------------------------------------------- /dc3/images/iot-dc3-architecture1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erliuwang/iot-dc3/2203ccff541dc8d89fe98fecaa74473896b1792d/dc3/images/iot-dc3-architecture1.jpg -------------------------------------------------------------------------------- /dc3/images/iot-dc3-architecture2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/erliuwang/iot-dc3/2203ccff541dc8d89fe98fecaa74473896b1792d/dc3/images/iot-dc3-architecture2.jpg -------------------------------------------------------------------------------- /dc3/tsung/http_simple.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 39 | 40 | 41 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.pnoker 7 | iot-dc3 8 | 3.0 9 | pom 10 | 11 | iot-dc3 12 | https://github.com/pnoker/iot-dc3 13 | 2018 14 | 开源分布式物联网(IOT)平台 , 基于Spring Cloud框架搭建 15 | 16 | 17 | 18 | org.springframework.boot 19 | spring-boot-starter-parent 20 | 2.0.3.RELEASE 21 | 22 | 23 | 24 | 25 | dc3-common 26 | dc3-service 27 | 28 | dc3-webapp 29 | dc3-api 30 | 31 | 32 | 33 | 34 | 35 | UTF-8 36 | UTF-8 37 | 1.8 38 | 5.0.7.RELEASE 39 | Finchley.RELEASE 40 | 1.18.2 41 | 1.2.49 42 | 1.11.3 43 | 3.7 44 | 45 | 46 | 49 | 50 | 51 | 52 | 53 | org.springframework.cloud 54 | spring-cloud-dependencies 55 | ${spring-cloud.version} 56 | pom 57 | import 58 | 59 | 60 | 61 | 62 | 63 | 65 | 66 | 67 | 68 | org.springframework 69 | spring-tx 70 | ${spring.tx.version} 71 | 72 | 73 | 74 | 75 | org.springframework.cloud 76 | spring-cloud-starter-openfeign 77 | 78 | 79 | 80 | 81 | org.projectlombok 82 | lombok 83 | ${lombok.version} 84 | provided 85 | 86 | 87 | 88 | 89 | com.alibaba 90 | fastjson 91 | ${fastjson.version} 92 | 93 | 94 | 95 | 96 | org.jsoup 97 | jsoup 98 | ${jsoup.version} 99 | 100 | 101 | 102 | 103 | org.apache.commons 104 | commons-lang3 105 | ${commons.version} 106 | 107 | 108 | 109 | commons-cli 110 | commons-cli 111 | 1.4 112 | 113 | 114 | 115 | 116 | 117 | 118 | spring-snapshots 119 | Spring Snapshots 120 | https://repo.spring.io/snapshot 121 | 122 | true 123 | 124 | 125 | 126 | spring-milestones 127 | Spring Milestones 128 | https://repo.spring.io/milestone 129 | 130 | false 131 | 132 | 133 | 134 | 135 | 136 | --------------------------------------------------------------------------------