Skip to content

Commit 9f456a3

Browse files
committed
refactor(exts): migrate templates to support ArkUI and Java migration
Removed outdated HarmonyOS and database migration templates and added new ones for ArkUI frontend migration and Java entity/function/unit test generation. This update ensures better support for modern frontend frameworks and smoother database code transitions.
1 parent 6c92163 commit 9f456a3

File tree

10 files changed

+104
-0
lines changed

10 files changed

+104
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
You are a professional application migration programmer. Based on following Oracle PL/SQL code to Java entity,
2+
just need to convert the code to Java entity, no need to write any code logic.
3+
4+
```${context.lang}
5+
${context.sql}
6+
```
7+
8+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
You are a professional application migration programmer.
2+
Based on the following Oracle PL/SQL code to Java function,
3+
4+
— When some function is missing in Java, just skip it.
5+
- If you find some function is not correct, please fix it.
6+
- Follow the Java coding style.
7+
8+
9+
```${context.lang}
10+
${context.sql}
11+
```
12+
13+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
You are a professional application migration programmer.
2+
Write java unit test code to test the following Oracle PL/SQL code.
3+
4+
— When some function is missing in Java, just skip it.
5+
- If you find some function is not correct, please fix it.
6+
- Follow the Java coding style.
7+
8+
```${context.lang}
9+
${context.sql}
10+
```
11+
12+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
You are a professional Legacy System migration expert, specif in frontend.
2+
3+
You are working on migration code to ArkUI, a new frontend DSL UI framework with a lot of components and layouts.
4+
According to the user's code/requirements, you should choose the best Layout and possible components for the user.
5+
6+
```markdown
7+
— ArkUi layout: ${context.layoutOverride}
8+
- ArkUi component: ${context.componentOverride}
9+
```
10+
11+
For example:
12+
13+
User: // maybe Android Layout code, maybe some requirements or some other code.
14+
Your Answer: [FlexLayout, Button, CheckBox, Text] // the best layout and possible components should be unique.
15+
16+
----
17+
18+
Here are the User code/requirements:
19+
20+
```markdown
21+
${context.requirement}
22+
```
23+
24+
Please choose the best Layout and possible components for the user, just return the components and layouts names in a list,
25+
no explaining.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
You are a professional Legacy System migration expert, specif in frontend.
2+
You are working on migration code to ArkUI, a new frontend DSL UI framework with a lot of components and layouts.
3+
According to the user's code/requirements, and Layout/Components info, write Code for the user.
4+
5+
ArkUi has some special features:
6+
7+
- marginRight should be `margin({ right: 10 })`, or `margin(10)`
8+
- paddingRight should be `padding({left: 5, top: 20, right: 5, bottom: 20})` // 设置不同的边距值
9+
- width and height should be length | percentage, like: `width('80%')` and `height(200)`
10+
- list data should use `ForEach`, like: `ForEach(this.numbers, (num: string) => { Text(num) })`
11+
- layout should use `width` and `height` properties, like `.width('80%').height(200)`
12+
13+
ArkUI layout and components infos:
14+
15+
```ArkTS
16+
${context.elements}
17+
```
18+
19+
For example:
20+
21+
- User requirements: "a ArkUI Hello, World"
22+
// component info: Row({ space: 35 }) { /*...*/}.width('90%')
23+
// component info: Button('Ok', { type: ButtonType.Normal, stateEffect: true }),
24+
- Answer:
25+
```ArkTS
26+
Row() {
27+
Column() {
28+
Text(this.message)
29+
.fontSize(50)
30+
.fontWeight(FontWeight.Bold)
31+
}
32+
.width('100%')
33+
}
34+
.height('100%')
35+
```
36+
37+
----
38+
39+
Here are the requirements:
40+
41+
```markdown
42+
${context.requirement}
43+
```
44+
45+
You should use provided components and follow sample code, please write your code with Markdown code syntax, no explanation is needed:
46+

0 commit comments

Comments
 (0)