@@ -8,7 +8,7 @@ import java.io.InputStream
8
8
class PromptGenerator () {
9
9
// 1. read resources/prompts/create_story_detail.txt
10
10
// 2. replace {project} with project name
11
- fun fillStoryDetail (project : SimpleProjectInfo , story : String ): String {
11
+ fun storyDetail (project : SimpleProjectInfo , story : String ): String {
12
12
val promptText: InputStream =
13
13
this ::class .java.classLoader.getResourceAsStream(" prompts/create_story_detail.txt" )!!
14
14
val promptTextString = promptText.bufferedReader().use { it.readText() }
@@ -17,15 +17,15 @@ class PromptGenerator() {
17
17
.replace(" {story}" , story)
18
18
}
19
19
20
- fun fillEndpoint (storyDetail : String , files : List <DtClass >): String {
20
+ fun createEndpoint (storyDetail : String , files : List <DtClass >): String {
21
21
val promptText: InputStream = this ::class .java.classLoader.getResourceAsStream(" prompts/create_endpoint.txt" )!!
22
22
val promptTextString = promptText.bufferedReader().use { it.readText() }
23
23
return promptTextString
24
24
.replace(" {controllers}" , files.map { it.name }.joinToString(" ," ))
25
25
.replace(" {storyDetail}" , storyDetail)
26
26
}
27
27
28
- fun fillUpdateMethod (targetClazz : DtClass , storyDetail : String ): String {
28
+ fun updateControllerMethod (targetClazz : DtClass , storyDetail : String ): String {
29
29
val promptText: InputStream = this ::class .java.classLoader.getResourceAsStream(" prompts/update_controller_method.txt" )!!
30
30
val promptTextString = promptText.bufferedReader().use { it.readText() }
31
31
return promptTextString
@@ -34,8 +34,7 @@ class PromptGenerator() {
34
34
.replace(" {storyDetail}" , storyDetail)
35
35
}
36
36
37
- // code complete
38
- fun fillCodeComplete (methodCode : String , className : @NlsSafe String? ): String {
37
+ fun codeComplete (methodCode : String , className : @NlsSafe String? ): String {
39
38
val promptText: InputStream = this ::class .java.classLoader.getResourceAsStream(" prompts/code_complete.txt" )!!
40
39
val promptTextString = promptText.bufferedReader().use { it.readText() }
41
40
return promptTextString
0 commit comments