This commit is contained in:
2024-05-26 14:51:11 +04:00
parent 52e76173ea
commit d3150467f2
168 changed files with 8582 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
package com.example.demo.speaker.service;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import com.example.demo.speaker.domain.Speaker;
@Service
public class SpeakerNews {
private final ApplicationContext applicationContext;
public SpeakerNews(ApplicationContext applicationContext) {
this.applicationContext = applicationContext;
}
public String say(String name, String lang) {
final Speaker speaker = (Speaker) applicationContext.getBean(lang);
return String.format("%s, %s!", speaker.say(), name);
}
}