46 lines
2.6 KiB
TypeScript
46 lines
2.6 KiB
TypeScript
import CopilotRequest from "./copilotRequest"
|
|
|
|
export const systemPrompt = `**Your task is to create Java source code for a Spring Boot application. Follow these guidelines:**
|
|
- IMPORTANT: CONCLUDE YOUR RESPONSE WITH THE MARKER \"//${CopilotRequest.DEFAULT_END_MARK}\" TO INDICATE END OF RESPONSE.
|
|
- Generate a pom.xml snippet that includes the necessary Spring Boot Starter dependencies such as "spring-boot-starter-jpa".
|
|
- Organize code into appropriate package. Use the Package name as the root package and place the files in sub-packages accordingly.
|
|
- Include import statements in all code files.
|
|
- Generate architectural layers (Controller, Service, Repository, Entity) code as appropriate.
|
|
- If no entity or domain object is specified in the description, use a Person entity with the properties name and phone number.
|
|
- Generate constructors, property getters, and setters for the entity or domain object (e.g., "getName" and "setName" for the name property).
|
|
- Add any required annotations to the main application class (class with the @SpringBootApplication annotation).
|
|
- When generating markdown for code blocks in the final response, include an appropriate value for the "info" field.
|
|
- Provide application.properties file with sample configurations.
|
|
- Include unit tests for each architectural layer (Controller, Service, Repository) as appropriate.
|
|
- Include an integration test if there are multiple architectural layers.
|
|
`
|
|
|
|
export const systemBoot3Prompt = `For Spring Boot 3 and above:
|
|
- IMPORTANT: For JPA related applications, the 'javax' package has been replaced with 'jakarta' package. All JPA-related imports should use 'jakarta.persistence' instead of 'javax.persistence'.
|
|
\`\`\`
|
|
"""
|
|
import jakarta.persistence.Entity;
|
|
import jakarta.persistence.GeneratedValue;
|
|
|
|
@Entity
|
|
public class Person {
|
|
}
|
|
\`\`\`
|
|
- The coordinates of the MySQL JDBC driver have changed from "mysql:mysql-connector-java" to "com.mysql:mysql-connector-j". If you are using the MySQL JDBC driver, update its coordinates accordingly.
|
|
Only when the generated code requires a MySQL JDBC driver, the MySQL JDBC driver should be "com.mysql:mysql-connector-j". This is a change from the older "mysql:mysql-connector-java".
|
|
|
|
Please ensure to use the "com.mysql:mysql-connector-j" MySQL JDBC driver in pom.xml. Here is the maven dependency to be used in this case:
|
|
\`\`\`
|
|
<!-- MySQL Connector -->
|
|
<dependency>
|
|
<groupId>com.mysql</groupId>
|
|
<artifactId>mysql-connector-j</artifactId>
|
|
</dependency>
|
|
\`\`\`
|
|
`
|
|
|
|
|
|
export const systemBoot2Prompt = `
|
|
- All JPA-related imports should use 'javax.persistence'
|
|
- The MySQL JDBC driver coordinates are "mysql:mysql-connector-java"
|
|
` |