Skip to content

Commit fbdd7ad

Browse files
committed
rename NacosPromptTmplProperties
1 parent b4dc09f commit fbdd7ad

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

auto-configurations/spring-ai-alibaba-autoconfigure-nacos-prompt/src/main/java/com/alibaba/cloud/ai/autoconfigure/prompt/PromptTemplateAutoConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
*/
3333

3434
@AutoConfiguration
35-
@Conditional(PromptTmplNacosConfigCondition.class)
36-
@EnableConfigurationProperties(NacosPromptTmplProperties.class)
35+
@Conditional(PromptTemplateConfigCondition.class)
36+
@EnableConfigurationProperties(PromptTemplateProperties.class)
3737
public class PromptTemplateAutoConfiguration {
3838

3939
@Bean
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@
2929
* of Nacos log error during startup.
3030
*/
3131

32-
public class PromptTmplNacosConfigCondition implements Condition {
32+
public class PromptTemplateConfigCondition implements Condition {
3333

34-
private final Logger logger = LoggerFactory.getLogger(PromptTmplNacosConfigCondition.class);
34+
private final Logger logger = LoggerFactory.getLogger(PromptTemplateConfigCondition.class);
3535

36-
public PromptTmplNacosConfigCondition() {
36+
public PromptTemplateConfigCondition() {
3737
}
3838

3939
@Override
4040
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
4141

4242
// @formatter:off
43-
String tmplPrefix = NacosPromptTmplProperties.TEMPLATE_PREFIX + ".enabled";
43+
String tmplPrefix = PromptTemplateProperties.TEMPLATE_PREFIX + ".enabled";
4444

4545
// The default value is false, means that the nacos prompt template is not enabled.
4646
Boolean enabled = context.getEnvironment().getProperty(tmplPrefix, Boolean.class, false);
@@ -50,7 +50,7 @@ public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata)
5050
if (!enabled) {
5151
System.setProperty("spring.nacos.config.enabled", "false");
5252
}
53-
logger.debug("PromptTmplNacosConfigCondition matches enabled: {}",enabled);
53+
logger.debug("PromptTemplateConfigCondition matches enabled: {}",enabled);
5454
// @formatter:on
5555

5656
return enabled;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
* @author <a href="mailto:yuluo08290126@gmail.com">yuluo</a>
2323
*/
2424

25-
@ConfigurationProperties(NacosPromptTmplProperties.TEMPLATE_PREFIX)
26-
public class NacosPromptTmplProperties {
25+
@ConfigurationProperties(PromptTemplateProperties.TEMPLATE_PREFIX)
26+
public class PromptTemplateProperties {
2727

2828
public final static String TEMPLATE_PREFIX = "spring.ai.nacos.prompt.template";
2929

auto-configurations/spring-ai-alibaba-autoconfigure-nacos-prompt/src/main/resources/META-INF/spring-configuration-metadata.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
},
2121
{
2222
"name": "spring.ai.nacos.prompt.template",
23-
"type": "com.alibaba.cloud.ai.autoconfigure.prompt.NacosPromptTmplProperties",
24-
"sourceType": "com.alibaba.cloud.ai.autoconfigure.prompt.NacosPromptTmplProperties",
23+
"type": "com.alibaba.cloud.ai.autoconfigure.prompt.PromptTemplateProperties",
24+
"sourceType": "com.alibaba.cloud.ai.autoconfigure.prompt.PromptTemplateProperties",
2525
"description": "Configuration properties for Nacos prompt template integration."
2626
}
2727
],
@@ -161,7 +161,7 @@
161161
"name": "spring.ai.nacos.prompt.template.enabled",
162162
"type": "java.lang.Boolean",
163163
"description": "Whether to enable Nacos prompt template support.",
164-
"sourceType": "com.alibaba.cloud.ai.autoconfigure.prompt.NacosPromptTmplProperties",
164+
"sourceType": "com.alibaba.cloud.ai.autoconfigure.prompt.PromptTemplateProperties",
165165
"defaultValue": false
166166
}
167167
],

auto-configurations/spring-ai-alibaba-autoconfigure-nacos-prompt/src/test/java/com/alibaba/cloud/ai/autoconfigure/prompt/NacosPromptTmplPropertiesTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
import static org.junit.jupiter.api.Assertions.assertTrue;
2727

2828
@SpringBootTest
29-
class NacosPromptTmplPropertiesTests {
29+
class PromptTemplatePropertiesTests {
3030

3131
@Autowired
32-
private NacosPromptTmplProperties properties;
32+
private PromptTemplateProperties properties;
3333

3434
@Test
3535
void testDefaultEnabled() {
@@ -43,7 +43,7 @@ void testSetEnabled() {
4343
}
4444

4545
@Configuration
46-
@EnableConfigurationProperties(NacosPromptTmplProperties.class)
46+
@EnableConfigurationProperties(PromptTemplateProperties.class)
4747
static class TestConfig {
4848

4949
}

0 commit comments

Comments
 (0)