-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c6b8b74
Showing
50 changed files
with
3,658 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
############################## | ||
## Java | ||
############################## | ||
.mtj.tmp/ | ||
*.class | ||
*.jar | ||
*.war | ||
*.ear | ||
*.nar | ||
hs_err_pid* | ||
|
||
############################## | ||
## Node.js | ||
############################## | ||
node_modules | ||
# we use yarn | ||
package-lock.json | ||
yarn-error.log | ||
|
||
############################## | ||
## Maven | ||
############################## | ||
target/ | ||
pom.xml.tag | ||
pom.xml.releaseBackup | ||
pom.xml.versionsBackup | ||
pom.xml.next | ||
pom.xml.bak | ||
release.properties | ||
dependency-reduced-pom.xml | ||
buildNumber.properties | ||
.mvn/timing.properties | ||
.mvn/wrapper/maven-wrapper.jar | ||
.m2/repository | ||
|
||
############################## | ||
## Gradle | ||
############################## | ||
bin/ | ||
build/ | ||
.gradle | ||
.gradletasknamecache | ||
gradle-app.setting | ||
!gradle-wrapper.jar | ||
|
||
############################## | ||
## IntelliJ | ||
############################## | ||
out/ | ||
.idea/* | ||
#!.idea/codeStyles/ | ||
#!.idea/fileTemplates/ | ||
#!.idea/inspectionProfiles/ | ||
#!.idea/codeStyleSettings.xml | ||
#!.idea/sonarSettings.xml | ||
#!.idea/vcs.xml | ||
#!.idea/externalDependencies.xml | ||
#!.idea/encodings.xml | ||
#!.idea/checkstyle-idea.xml | ||
|
||
## User-specific stuff | ||
#.idea/**/workspace.xml | ||
#.idea/**/tasks.xml | ||
#.idea/**/usage.statistics.xml | ||
#.idea/**/dictionaries | ||
#.idea/**/shelf | ||
# | ||
## Generated files | ||
#.idea/**/contentModel.xml | ||
# | ||
## Sensitive or high-churn files | ||
#.idea/**/dataSources/ | ||
#.idea/**/dataSources.ids | ||
#.idea/**/dataSources.local.xml | ||
#.idea/**/sqlDataSources.xml | ||
#.idea/**/dynamic.xml | ||
#.idea/**/uiDesigner.xml | ||
#.idea/**/dbnavigator.xml | ||
# | ||
## Gradle | ||
#.idea/**/gradle.xml | ||
#.idea/**/libraries | ||
|
||
# Gradle and Maven with auto-import | ||
# When using Gradle or Maven with auto-import, you should exclude module files, | ||
# since they will be recreated, and may cause churn. Uncomment if using | ||
# auto-import. | ||
# .idea/modules.xml | ||
# .idea/*.iml | ||
# .idea/modules | ||
.idea_modules/ | ||
*.iml | ||
*.ipr | ||
*.iws | ||
|
||
############################## | ||
## Eclipse | ||
############################## | ||
.settings/ | ||
bin/ | ||
tmp/ | ||
.metadata | ||
.classpath | ||
.project | ||
*.tmp | ||
*.bak | ||
*.swp | ||
*~.nib | ||
local.properties | ||
.loadpath | ||
.factorypath | ||
|
||
############################## | ||
## NetBeans | ||
############################## | ||
nbproject/private/ | ||
build/ | ||
nbbuild/ | ||
dist/ | ||
nbdist/ | ||
nbactions.xml | ||
nb-configuration.xml | ||
|
||
############################## | ||
## Visual Studio Code | ||
############################## | ||
.vscode/ | ||
.code-workspace | ||
|
||
############################## | ||
## OS X | ||
############################## | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
## Beaver IoT Integrations | ||
Integrations are the primary means for Beaver IoT to interact with third-party services, devices, platforms, etc., enabling device connectivity, device control, and feature expansion. | ||
|
||
## Start building your integrations | ||
|
||
The following is the directory structure of this project. | ||
|
||
``` | ||
beaver-iot-integrations/ | ||
├── application-dev/ | ||
│ ├── src/main/java/com/milesight/beaveriot/DevelopApplication.java # Start and debug your integrations from here. | ||
│ ├── integrations/ # integration directory | ||
│ │ └── sample-integrations/ # Sample integrations | ||
│ │ └── ... # All integrations | ||
``` | ||
|
||
If you want to develop your own integration, please create a new integration package under the `beaver-iot-integrations/integrations/` directory. For more information, please refer to [Quick Start](https://www.milesight.com/beaver-iot/docs/dev-guides/backend/build-integration) of Integration Development. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<groupId>com.milesight.beaveriot</groupId> | ||
<artifactId>beaver-iot-integrations</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.milesight.beaveriot</groupId> | ||
<artifactId>application-dev</artifactId> | ||
|
||
<properties> | ||
<maven.compiler.source>17</maven.compiler.source> | ||
<maven.compiler.target>17</maven.compiler.target> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-tomcat</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-undertow</artifactId> | ||
</dependency> | ||
|
||
<!-- lombok --> | ||
<dependency> | ||
<groupId>org.projectlombok</groupId> | ||
<artifactId>lombok</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.milesight.beaveriot</groupId> | ||
<artifactId>data-jpa</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<!--<dependency> | ||
<groupId>org.postgresql</groupId> | ||
<artifactId>postgresql</artifactId> | ||
<scope>runtime</scope> | ||
</dependency>--> | ||
|
||
<dependency> | ||
<groupId>com.h2database</groupId> | ||
<artifactId>h2</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
|
||
<!-- core jar --> | ||
<dependency> | ||
<groupId>com.milesight.beaveriot</groupId> | ||
<artifactId>context</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.milesight.beaveriot</groupId> | ||
<artifactId>rule-engine-component</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.milesight.beaveriot</groupId> | ||
<artifactId>eventbus-component</artifactId> | ||
</dependency> | ||
|
||
<!-- service --> | ||
<dependency> | ||
<groupId>com.milesight.beaveriot</groupId> | ||
<artifactId>device-service</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.milesight.beaveriot</groupId> | ||
<artifactId>integration</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.milesight.beaveriot</groupId> | ||
<artifactId>dashboard-service</artifactId> | ||
</dependency> | ||
<!-- <dependency>--> | ||
<!-- <groupId>com.milesight.beaveriot</groupId>--> | ||
<!-- <artifactId>authentication-service</artifactId>--> | ||
<!-- </dependency>--> | ||
<dependency> | ||
<groupId>com.milesight.beaveriot</groupId> | ||
<artifactId>user-service</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.milesight.beaveriot</groupId> | ||
<artifactId>entity-service</artifactId> | ||
</dependency> | ||
|
||
<!-- test dependencies --> | ||
|
||
<!-- <dependency>--> | ||
<!-- <groupId>com.milesight.beaveriot</groupId>--> | ||
<!-- <artifactId>ping</artifactId>--> | ||
<!-- <version>${project.version}</version>--> | ||
<!-- </dependency>--> | ||
|
||
<!-- | ||
<dependency> | ||
<groupId>com.milesight.beaveriot</groupId> | ||
<artifactId>my-integration</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.milesight.beaveriot</groupId> | ||
<artifactId>msc-integration</artifactId> | ||
<version>${project.version}</version> | ||
</dependency>--> | ||
</dependencies> | ||
|
||
</project> |
39 changes: 39 additions & 0 deletions
39
application-dev/src/main/java/com/milesight/beaveriot/DevelopApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.milesight.beaveriot; | ||
|
||
import com.milesight.beaveriot.data.jpa.BaseJpaRepositoryImpl; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.data.jpa.repository.config.EnableJpaAuditing; | ||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories; | ||
import org.springframework.scheduling.annotation.EnableAsync; | ||
|
||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.web.servlet.config.annotation.CorsRegistry; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
|
||
/** | ||
* @author leon | ||
*/ | ||
@EnableJpaAuditing | ||
@EnableJpaRepositories(repositoryBaseClass = BaseJpaRepositoryImpl.class ) | ||
@SpringBootApplication | ||
@EnableAsync | ||
public class DevelopApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(DevelopApplication.class, args); | ||
} | ||
|
||
@Configuration | ||
public class WebConfig implements WebMvcConfigurer { | ||
@Override | ||
public void addCorsMappings(CorsRegistry registry) { | ||
registry.addMapping("/**") | ||
.allowCredentials(true) | ||
.allowedOriginPatterns("*") | ||
.allowedMethods("GET", "POST", "PUT", "DELETE") | ||
.allowedHeaders("*") | ||
.exposedHeaders("*"); | ||
} | ||
} | ||
} |
Oops, something went wrong.