Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: 更新 readme 文档中的代码格式 #199

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,32 +92,32 @@ Solon v2.5.5-SNAPSHOT

```java
@SolonMain
public class App{
public static void main(String[] args){
Solon.start(App.class, args, app->{
public class App {
public static void main(String[] args) {
Solon.start(App.class, args, app -> {
//Handler 模式:
app.get("/hello",(c)->c.output("Hello world!"));
app.get("/hello", c -> c.output("Hello world!"));
});
}
}

//Controller 模式:(mvc or rest-api)
@Controller
public class HelloController{
public class HelloController {
//限定 Socket 方法类型
@Socket
@Mapping("/mvc/hello")
public String hello(String name){
public String hello(String name) {
return "Hello " + name;
}
}

//Remoting 模式:(rpc)
@Mapping("/rpc/")
@Remoting
public class HelloServiceImpl implements HelloService{
public class HelloServiceImpl implements HelloService {
@Override
public String hello(){
public String hello() {
return "Hello world!";
}
}
Expand Down
16 changes: 8 additions & 8 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,32 +91,32 @@ Build from scratch. It has its own standards and norms and open ecology. Combina

```java
@SolonMain
public class App{
public static void main(String[] args){
Solon.start(App.class, args, app->{
public class App {
public static void main(String[] args) {
Solon.start(App.class, args, app -> {
//Handler mode:
app.get("/hello",(c)->c.output("Hello world!"));
app.get("/hello", c -> c.output("Hello world!"));
});
}
}

//Controller mode: (mvc or rest-api)
@Controller
public class HelloController{
public class HelloController {
//Limit Socket method type
@Socket
@Mapping("/mvc/hello")
public String hello(String name){
public String hello(String name) {
return "Hello " + name;
}
}

//Remoting mode: (rpc)
@Mapping("/rpc/")
@Remoting
public class HelloServiceImpl implements HelloService{
public class HelloServiceImpl implements HelloService {
@Override
public String hello(){
public String hello() {
return "Hello world!";
}
}
Expand Down
16 changes: 8 additions & 8 deletions README_JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,32 +92,32 @@ Solon v2.5.5-SNAPSHOT

```java
@SolonMain
public class App{
public static void main(String[] args){
Solon.start(App.class, args, app->{
public class App {
public static void main(String[] args) {
Solon.start(App.class, args, app -> {
//Handler mode:
app.get("/hello",(c)->c.output("Hello world!"));
app.get("/hello", c -> c.output("Hello world!"));
});
}
}

//Controller mode:(mvc or rest-api)
@Controller
public class HelloController{
public class HelloController {
//Socketメソッドタイプの修飾
@Socket
@Mapping("/mvc/hello")
public String hello(String name){
public String hello(String name) {
return "Hello " + name;
}
}

//Remoting mode:(rpc)
@Mapping("/rpc/")
@Remoting
public class HelloServiceImpl implements HelloService{
public class HelloServiceImpl implements HelloService {
@Override
public String hello(){
public String hello() {
return "Hello world!";
}
}
Expand Down
16 changes: 8 additions & 8 deletions README_RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,32 +92,32 @@ Solon v2.5.5-SNAPSHOT

```java
@SolonMain
public class App{
public static void main(String[] args){
Solon.start(App.class, args, app->{
public class App {
public static void main(String[] args) {
Solon.start(App.class, args, app -> {
//Handler модел:
app.get("/hello",(c)->c.output("Hello world!"));
app.get("/hello", c -> c.output("Hello world!"));
});
}
}

//Controller модел:(mvc or rest-api)
@Controller
public class HelloController{
public class HelloController {
//Ограничение типов методов Socket
@Socket
@Mapping("/mvc/hello")
public String hello(String name){
public String hello(String name) {
return "Hello " + name;
}
}

//Remoting модел:(rpc)
@Mapping("/rpc/")
@Remoting
public class HelloServiceImpl implements HelloService{
public class HelloServiceImpl implements HelloService {
@Override
public String hello(){
public String hello() {
return "Hello world!";
}
}
Expand Down