【功能修改】IoT:更新问候语打印方法,返回问候语数量;删除不再使用的插件控制器和配置类

This commit is contained in:
安浩浩
2024-12-16 18:43:08 +08:00
parent 290fcd94d5
commit ce49123043
5 changed files with 6 additions and 76 deletions

View File

@@ -30,11 +30,12 @@ public class Greetings {
@Autowired
private List<Greeting> greetings;
public void printGreetings() {
public Integer printGreetings() {
System.out.printf("找到扩展点的 %d 个扩展 '%s'%n", greetings.size(), Greeting.class.getName());
for (Greeting greeting : greetings) {
System.out.println(">>> " + greeting.getGreeting());
}
return greetings.size();
}
}
}

View File

@@ -123,12 +123,12 @@ public class PluginController {
/**
* 打印问候语
*
* @return 1
* @return 问候语数量
*/
@PermitAll
@GetMapping("/printGreetings")
public ResponseEntity<Integer> printGreetings() {
greetings.printGreetings();
return ResponseEntity.ok(1);
Integer count = greetings.printGreetings();
return ResponseEntity.ok(count);
}
}