Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f016710
[fit] 增加fit-server-coordination-nacos内置插件
mikeaaaaaa Jun 21, 2025
195ef7a
[fit] 增加Registry port、IP信息的动态获取
mikeaaaaaa Jun 21, 2025
d9905b5
[fit] 修改nacos默认配置,最简单化
mikeaaaaaa Jun 21, 2025
db30014
[fit] 修改nacos notify函数死循环bug
mikeaaaaaa Jun 21, 2025
bacf73e
[fit] 增加nacos的使用example以及一些类的注释
mikeaaaaaa Jun 21, 2025
790c86c
[fit] 修改example8中的nacos地址为本地地址
mikeaaaaaa Jun 21, 2025
4dbd28b
[fit] 修改example8中的nacos地址为本地地址
mikeaaaaaa Jun 21, 2025
b8a1e31
[fit] 修改文件的格式问题以及增加必要的注释
mikeaaaaaa Jul 15, 2025
7301779
[fit] 毫秒时间类型设置为long
mikeaaaaaa Jul 15, 2025
db796e9
[fit] 修改格式错误以及方法抽取
mikeaaaaaa Jul 18, 2025
1a94b63
[fit] 修改注释错误以及方法抽取
mikeaaaaaa Jul 22, 2025
b5b7f2a
[fit] 统一修改和registry相关的fitable-id和genericable-id
mikeaaaaaa Jul 22, 2025
2da9b35
[fit] 统一修改和registry相关的fitable-id和genericable-id; 增加Notify接口; 修改注释为英文;…
mikeaaaaaa Jul 31, 2025
0a6fd93
[fit] 增加缺失的 this.
mikeaaaaaa Jul 31, 2025
3aeea47
[fit] 为 NacosConfig 增加详细注释; 修改heartBeat错误拼写; 修改部分未修改的fitableId
mikeaaaaaa Aug 1, 2025
634ed23
[fit] 修改某个fitableId
mikeaaaaaa Aug 1, 2025
d37d787
[fit] 统一内存版注册中心和nacos注册中心的配置方式
mikeaaaaaa Aug 4, 2025
f63b580
[fit] 增加注册中心连接模式,默认DIRECT模式,还可设置为PROXY模式
mikeaaaaaa Aug 5, 2025
34fc5c5
[fit] 删除不必要的配置信息
mikeaaaaaa Aug 5, 2025
3e3c375
[fit] matata.registry.nacos配置改从插件中读取
mikeaaaaaa Aug 6, 2025
1385ed9
[fit] 修改格式错误
mikeaaaaaa Aug 6, 2025
45f8688
[fit] 修改代码格式错误
mikeaaaaaa Aug 6, 2025
c2eb997
[fit] 修改代码格式错误,增加this.
mikeaaaaaa Aug 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions examples/fit-example/08-nacos-complicated-apps/app-assistant/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
<?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">
<modelVersion>4.0.0</modelVersion>

<groupId>org.fitframework.example</groupId>
<artifactId>nacos-assistant-for-complicated</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>17</java.version>

<!-- FIT version -->
<fit.version>3.6.0-SNAPSHOT</fit.version>

<!-- Maven plugin versions -->
<maven.compiler.version>3.14.0</maven.compiler.version>
</properties>

<dependencies>
<dependency>
<groupId>org.fitframework.example</groupId>
<artifactId>nacos-weather-for-complicated</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.fitframework</groupId>
<artifactId>fit-starter</artifactId>
<version>${fit.version}</version>
</dependency>

<!-- FIT plugins -->
<dependency>
<groupId>org.fitframework</groupId>
<artifactId>fit-plugins-starter-web</artifactId>
<version>${fit.version}</version>
</dependency>

<!-- 不在默认插件集合中的插件列表 -->
<dependency>
<groupId>org.fitframework.plugin</groupId>
<artifactId>fit-client-http</artifactId>
<version>${fit.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.fitframework.plugin</groupId>
<artifactId>fit-http-client-okhttp</artifactId>
<version>${fit.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.fitframework.plugin</groupId>
<artifactId>fit-heartbeat-client</artifactId>
<version>${fit.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.fitframework.plugin</groupId>
<artifactId>fit-service-registry</artifactId>
<version>${fit.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.fitframework.plugin</groupId>
<artifactId>fit-service-discovery</artifactId>
<version>${fit.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.fitframework.plugin</groupId>
<artifactId>fit-service-coordination-locator</artifactId>
<version>${fit.version}</version>
<scope>runtime</scope>
</dependency>
<!-- 注册中心的内nacos版实现 -->
<dependency>
<groupId>org.fitframework.plugin</groupId>
<artifactId>fit-service-coordination-nacos</artifactId>
<version>${fit.version}</version>
<scope>runtime</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.fitframework</groupId>
<artifactId>fit-build-maven-plugin</artifactId>
<version>${fit.version}</version>
<executions>
<execution>
<id>package-app</id>
<goals>
<goal>package-app</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) 2025 Huawei Technologies Co., Ltd. All rights reserved.
* This file is a part of the ModelEngine Project.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

package modelengine.fit.example;

import modelengine.fitframework.annotation.Component;
import modelengine.fitframework.annotation.ScanPackages;
import modelengine.fitframework.runtime.FitStarter;

/**
* 启动类。
*
* @author 董智豪
* @since 2025-06-21
*/
@Component
@ScanPackages("modelengine")
public class AssistantStarter {
public static void main(String[] args) {
FitStarter.start(AssistantStarter.class, args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) 2025 Huawei Technologies Co., Ltd. All rights reserved.
* This file is a part of the ModelEngine Project.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

package modelengine.fit.example.controller;

import modelengine.fit.example.Weather;
import modelengine.fit.http.annotation.GetMapping;
import modelengine.fitframework.annotation.Component;
import modelengine.fitframework.annotation.Fit;

/**
* 表示助手的控制器。
*
* @author 董智豪
* @since 2025-06-21
*/
@Component
public class AssistantController {
private final Weather weather;

public AssistantController(@Fit Weather weather) {
this.weather = weather;
}

/**
* 获取天气信息。
*
* @return 表示天气信息的 {@link String}。
*/
@GetMapping(path = "/weather")
public String getWeather() {
return this.weather.get();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
application:
name: 'assistant'

worker:
id: 'assistant'
host: '127.0.0.1'
environment: 'local'
environment-sequence: 'local'

matata:
registry:
mode: 'PROXY'
host: '127.0.0.1'
port: 8848
environment: 'local'

server:
http:
port: 8080
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<?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">
<modelVersion>4.0.0</modelVersion>

<groupId>org.fitframework.example</groupId>
<artifactId>nacos-default-weather-for-complicated</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>17</java.version>

<!-- FIT version -->
<fit.version>3.6.0-SNAPSHOT</fit.version>

<!-- Maven plugin versions -->
<maven.compiler.version>3.14.0</maven.compiler.version>
</properties>

<dependencies>
<dependency>
<groupId>org.fitframework.example</groupId>
<artifactId>nacos-weather-for-complicated</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.fitframework</groupId>
<artifactId>fit-starter</artifactId>
<version>${fit.version}</version>
</dependency>

<!-- FIT plugins -->
<dependency>
<groupId>org.fitframework</groupId>
<artifactId>fit-plugins-starter-web</artifactId>
<version>${fit.version}</version>
</dependency>

<!-- 不在默认插件集合中的插件列表 -->
<dependency>
<groupId>org.fitframework.plugin</groupId>
<artifactId>fit-client-http</artifactId>
<version>${fit.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.fitframework.plugin</groupId>
<artifactId>fit-http-client-okhttp</artifactId>
<version>${fit.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.fitframework.plugin</groupId>
<artifactId>fit-heartbeat-client</artifactId>
<version>${fit.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.fitframework.plugin</groupId>
<artifactId>fit-service-registry</artifactId>
<version>${fit.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.fitframework.plugin</groupId>
<artifactId>fit-service-discovery</artifactId>
<version>${fit.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.fitframework.plugin</groupId>
<artifactId>fit-service-coordination-locator</artifactId>
<version>${fit.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.fitframework.plugin</groupId>
<artifactId>fit-service-coordination-nacos</artifactId>
<version>${fit.version}</version>
<scope>runtime</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.fitframework</groupId>
<artifactId>fit-build-maven-plugin</artifactId>
<version>${fit.version}</version>
<executions>
<execution>
<id>package-app</id>
<goals>
<goal>package-app</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) 2025 Huawei Technologies Co., Ltd. All rights reserved.
* This file is a part of the ModelEngine Project.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

package modelengine.fit.example;

import modelengine.fitframework.annotation.Component;
import modelengine.fitframework.annotation.Fitable;

/**
* 表示 {@link Weather} 的默认实现。
*
* @author 董智豪
* @since 2025-06-21
*/
@Component
public class DefaultWeather implements Weather {
@Override
@Fitable(id = "default-weather")
public String get() {
return "Default weather application is working.";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) 2025 Huawei Technologies Co., Ltd. All rights reserved.
* This file is a part of the ModelEngine Project.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

package modelengine.fit.example;

import modelengine.fitframework.annotation.Component;
import modelengine.fitframework.annotation.ScanPackages;
import modelengine.fitframework.runtime.FitStarter;

/**
* 启动类。
*
* @author 董智豪
* @since 2025-06-21
*/
@Component
@ScanPackages("modelengine")
public class DefaultWeatherStarter {
public static void main(String[] args) {
FitStarter.start(DefaultWeatherStarter.class, args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
application:
name: 'default-weather'

worker:
id: 'default-weather'
host: '127.0.0.1'
environment: 'local'
environment-sequence: 'local'

matata:
registry:
mode: 'PROXY'
host: '127.0.0.1'
port: 8848
environment: 'local'

server:
http:
port: 8081
Loading