演示剩余的两部分内容
provider要有可供我们可调用的方法。provider里面我们直接写controller就可以了
provider服务里面新建controller包,新建ProviderController
package com.mooc.meetingfilm.provider.controller;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@Slf4j
public class ProviderController {
@Value("${server.port}")
private int port;
@RequestMapping(value="/provider/sayhello")
public String providerSayHello(String message){
log.error("provider sayhello port:{}, message:{}",port,message);
return "Provider sayhello port:"+port+" , message:"+message;
}
}
结束