-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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"); | ||
} | ||
} |