-
Notifications
You must be signed in to change notification settings - Fork 9
Listen and Response a Request
Ta Van Dung edited this page Jun 15, 2016
·
1 revision
import com.tvd12.ezyfox.core.annotation.ClientRequestListener;
import com.tvd12.ezyfox.core.annotation.ClientResponseHandler;
import com.tvd12.ezyfox.core.annotation.RequestParam;
import com.tvd12.ezyfox.core.annotation.ResponseParam;
import com.tvd12.ezyfox.core.content.AppContext;
import lombok.Data;
@Data
@ClientResponseHandler // auto response to client with command = "sum"
@ClientRequestListener(command = "sum")
public class SumRequestListener {
@RequestParam private int a;
@RequestParam private int b;
@ResponseParam private int total;
public void execute(AppContext context, GameUser user) {
total = a + b;
}
}
Hello World