package com.twjitm.core.service.rpc.service;

import com.twjitm.core.common.annotation.NettyRpcServiceAnnotation;
import com.twjitm.core.utils.logs.LoggerUtils;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Repository;

/**
 * @author twjitm - [Created on 2018-08-20 10:26]

 * @jdk java version "1.8.0_77"
 * 这个地方一定是注入的是业务对象的接口~~~~~~~~~~~~~~~~
 */
@NettyRpcServiceAnnotation(IHelloWorld.class)
@Repository
public class HelloWorldImpl implements IHelloWorld {
    private Logger logger = LoggerUtils.getLogger(HelloWorldImpl.class);

    @Override
    public String getHelloWorld(int number) {
        StringBuilder builder = new StringBuilder();
        for (int i = number; i > 0; i--) {
            builder.append("helloworld");
            builder.append(i);
        }
        System.out.println("rpc 远程调用方法成功。。。。。，即将返回给远程客户端调用");
        return builder.toString();
    }
    class Task implements Runnable{

        @Override
        public void run() {

        }
    }
}
