Skip to content

Commit

Permalink
Merge pull request #199 from pigbayspy/dev
Browse files Browse the repository at this point in the history
doc: 更新 readme 文档中的代码格式
  • Loading branch information
noear authored Sep 20, 2023
2 parents c0efa4f + cebfa8a commit 7a459f7
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
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

0 comments on commit 7a459f7

Please sign in to comment.