Skip to main content

IntelliJ IDEA Plugin

EchoAPI for IDEA Plugin Overview

This IDEA plugin streamlines your development process by automatically generating comprehensive API documentation from your code. It also offers quick debugging, custom API crafting, secure data sync, flexible parameter parsing, and a lightweight design—all designed to enhance your productivity!

1. Plugin Installation

  • Open IntelliJ IDEA.
  • Go to the Plugins Marketplace.
  • Search for the "EchoAPI for IDEA" plugin.
  • Select the plugin and click the "Install" button in the top right corner.
  • Restart IDEA after installation to activate the plugin. download EchoAPI.png

2. Main Features

1. Automatic Code Interface and Directory Recognition

  • Feature Description: Automatically recognizes the project's code structure and generates the corresponding interfaces and directories based on comments and class definitions.
  • Steps to Use:
    1. Open your project.
    2. The system will scan the code and automatically generate the interfaces and directories (you can adjust the recognition rules in settings).
    img_v3_02di_55c8b6ef-15e0-4bcd-9086-9e0c4a28726g.png

2. Manually Create Interfaces and Directories

  • Feature Description: Allows users to manually add new interfaces or directories for better organization and management.
  • Steps to Use:
    1. Click on **"New Interface"** or **"New Directory."**
    2. Enter a name and click **"OK"** to create it; the new interface or directory will appear in the list.
    image.png

3. Push and Pull Cloud Data

⚠️ Note: Pulling data will overwrite existing interfaces. When pushing, resolve any conflicts by selecting either cloud or local data.

  • Feature Description: Push local data to the cloud or pull data from the cloud.

  • Steps to Use:

    1. Click **"Push Data"** to upload local data to the cloud.

    image.png 2. Click "Pull Data" to update local data. image.png 3. After a successful operation, you can jump to the debug interface or share the link. image.png

  • Methods:

    1. Right-click on methods, classes, packages, or modules in the code to push interfaces.

    image.png 2. Right-click on the interface tree to push interfaces, supporting modules, packages, classes, and methods. image.png 3. Use the "Push" and "Pull" icons for operations. image.png

4. Interface Debugging Feature

  • Feature Description: Provides debugging capabilities, saves history records, checks response statuses, and supports JSON downloads.
  • Steps to Use:
    1. Open the interface debugging interface.
    2. Click the **"Save"** button and enter an interface name to save the record.
    image.png 4. Click "Save Record"; each method can save up to 20 request records. image.png 5. Click "Send" to debug the interface and view responses and status codes. image.png 6. Click the download button to save the data as a JSON file. image.png

    (Optional) Set global request headers and Host; save the global headers after the input box loses focus. The Host does not require this step.

3. Upload Interface Settings

🌍 Access via: EchoAPI Config - Authentication.

1. Cloud Domain Configuration

Cloud domain address: https://open.echoapi.com (do not modify)

2. Cloud Account

  • Feature Description: Log in to your EchoAPI cloud account to quickly sync local data to the cloud or pull data from the cloud, ensuring data is not lost.
  • Steps to Use:
    1. Click the **"Sign in to EchoAPI"** button.
    image.png 2. Log in via Google, GitHub, or your email/password. image.png 3. If you don’t have an account, click "Create Account" to register. image.png 4. Click "Sign Out - Clear Data" to log out. Cloud project data in the local list will be cleared, and you will need to pull cloud data again upon re-login. image.png

    🌍 Access via: EchoAPI Config - Push Settings.

3. Interface and Directory Upload Methods

  • Feature Description: Configure how interfaces are pushed to the cloud.
  • Steps to Use:
    1. **Automatically create module and class comment directories:** Select a project during upload, and the system will automatically create parent module and class comment directories.
    2. **Manually select project directories:** Choose specific directories or projects during upload (default).
    image.png

4. Set Upload Host

  • Feature Description: Configure the host address for data uploads.
  • Steps to Use:
    1. **Default Configuration:** The system automatically uses the port and `server.servlet.context-path` from the configuration file.
    2. **Empty Host Settings:** The system will only use relative paths for uploads. You can specify the host address in the EchoAPI client environment settings.
    image.png

5. Upload Parameter Settings

  • Feature Description: Configure parameters related to the data upload process.
  • Steps to Use:
    1. **Parameter Naming Rules:** Define the format for parameter names.
    2. **Include Parent Class Properties in Input/Output:** Choose whether to include parent class properties.
    3. **Non-Serializable Parameters:** List parameters that do not require serialization.
    4. **Parameter Mapping:** Set mapping relationships between different parameter names.
    image.png

4. Additional Features

1. Refresh

  • Click to refresh the interface tree list and get the latest interface data.

2. Search Functionality

  • Search interface comments: Mac: Command+\ | Win: Ctrl+.
  • Search the interface tree: Mac: Option+\ | Win: Alt+.

3. Expand and Collapse Interface Tree:

  • Expand All: Expands the entire interface tree.
  • Collapse All: Collapses the entire interface tree.

4. Side-by-Side Interface Data Display

  • Horizontal: Displays the interface list on the left and details on the right. image.png
  • Vertical: Displays the interface list on top and details below. image.png

5. Cloud Account Project List Display

  • Not Logged In: Shows local teams and projects. image.png
  • Logged In: Shows cloud and local team projects. (When logging out, cloud project data in the local list will be cleared; you'll need to pull cloud data again when you log in.) image.png

6. Help Documentation

  • Click to access the user guide.

7. Contact Us

  • Click to email us.

8. Navigation Features

  • Click the arrow on the left side of the code area to jump to the interface tree. image.png
  • Click on an interface in the interface tree to jump to the code area. image.png

5. IDEA Coding Standards

  • Follow Java Standards: Code should comply with Java programming standards.
  • Interface Naming: Automatically generates interface names when methods include comments. The default interface path is the method name.
  • Supports Swagger 3.0: The system supports Swagger 3.0 annotations.
  • Input Parameter Comments: Missing input parameter comments may affect the upload functionality.

Example Code

/* 
* This is a class comment
* @author EchoAPI at 2024/08/01 13:48
*/
@RestController
@RequestMapping("api")
public class AController {

/*
* User information
* @author EchoAPI at 2024/8/1 14:14
*/
@Data
public class User {
/*
* ID
*/
@ApiModelProperty(value = "id")
private Long id;
/*
* Role list
*/
private List roleList;
/*
* Role object
*/
private Role role;
}
}

6. Contact Us

Feel free to reach out to our customer service and join our plugin beta group to experience the latest features!