@Component@ManagedResource(objectName = "sample:name=countUsers", description = "统计当前用户注册数")public class CountUsers { @Autowired UserService userService; @ManagedAttribute(description = "获取注册用户数") public int getCountUsers() { return userService.getCountUsers(); }}
Sign in to make a reply
好先生的菜