Skip to content

Commit

Permalink
fast-rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
Paddi-Yan committed Feb 10, 2023
0 parents commit d3aae13
Show file tree
Hide file tree
Showing 317 changed files with 9,535 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions .idea/saveactions_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions .idea/uiDesigner.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 53 additions & 0 deletions irpc-framework-consumer/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?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>
<artifactId>irpc-framework</artifactId>
<groupId>org.example</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>irpc-framework-consumer</artifactId>
<dependencies>
<dependency>
<groupId>org.example</groupId>
<artifactId>irpc-framework-spring-starter</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.example</groupId>
<artifactId>irpc-framework-core</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.1.13.RELEASE</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.example</groupId>
<artifactId>irpc-framework-interfaces</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.paddi;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
* @Author: Paddi-Yan
* @Project: irpc-framework
* @CreatedTime: 2023年02月09日 18:15:33
*/
@SpringBootApplication
public class ConsumerApplication {
public static void main(String[] args) {
SpringApplication.run(ConsumerApplication.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.paddi.controller;

import com.paddi.common.RpcReference;
import com.paddi.service.good.GoodRpcService;
import com.paddi.service.user.UserRpcService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* @Author: Paddi-Yan
* @Project: irpc-framework
* @CreatedTime: 2023年02月09日 18:11:02
*/
@RestController
@RequestMapping(value = "/user")
public class UserController {

@RpcReference()
private UserRpcService userRpcService;

/**
* 验证各类参数配置是否异常
*/
@RpcReference(timeout = 10000)
private GoodRpcService goodRpcService;

@GetMapping(value = "/getUserId")
public String test(){
return userRpcService.getUserId();
}

@GetMapping(value = "/getGoods")
public Object goodInvoke() {
return goodRpcService.selectGoodsNoByUserId("123");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.paddi.spi.filter;

import com.paddi.core.common.ChannelFutureWrapper;
import com.paddi.core.common.RpcInvocation;
import com.paddi.core.filter.ClientFilter;

import java.util.List;

/**
* @Author linhao
* @Date created in 4:31 下午 2022/2/4
*/
public class LogFilterImpl implements ClientFilter {
@Override
public void doFilter(List<ChannelFutureWrapper> src, RpcInvocation rpcInvocation) {
System.out.println("this is a test");
}
}
Loading

0 comments on commit d3aae13

Please sign in to comment.