It's the sample of code-first
You can write microservice without swagger contract.
Just write codes without swagger contract. When the server is starting, it will build the contract and register the service to the service center.
@RpcSchema(schemaId = "codeFirst")
public class CodeFirstPojo {
public int reduce(int a, int b) {
return a - b;
}
public Person sayHello(Person user) {
user.setName("hello " + user.getName());
return user;
}
public String saySomething(String prefix, Person user) {
return prefix + " " + user.getName();
}
}how to start the service center
mvn test -Pservermvn test -Pclient