package com.kwan.shuyu.controller; import com.alibaba.dubbo.config.annotation.Reference; import com.kwan.shuyu.service.UserService; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @Controller public class UserController { @Reference(interfaceClass = UserService.class, version = "2.6.0", check = false) private UserService userService; @RequestMapping("/count") @ResponseBody public String getCount() { int count = userService.getCount(); return "当前在线的人数为:" + count; } }