In this section, we start with the small steps to set up related functions:

Open p_cases.html and find our right_div:

What about the Settings? We can copy the design of our interface setup.

But before that, our steps have some special properties, such as the order in which they are executed:

Look at the results:

And then the name:

Note the position and width of these input boxes, of course my design is not very good ~

Then the request method and URL:

You don’t have to hand copy, after a while will paste the source code.

And then host:

And our header:

Then there is the important thing that we are missing, which is that the design that acts as a bridge between our interface repository and the use case repository is the interface that applies to the interface repository.

So we need to create a drop-down box, so that the user can select the existing interface, and then our step will directly become the interface request data, so that we can modify the request data according to the requirements, and then become a small step ~

As shown above, we chose to insert the dropdown box at the top and set its ID.

The effect is as follows:

But what about the contents? How do I bring it in?

This can be done directly in HTML with a loop, and then a background function takes all the data from the interface repository when it enters the use case library.

Write the loop first:

Then go to the data controller function in views.py:

child_json
Copy the code

Find the p_cases.html branch in it and add the library interface to its return value:

Finally, let’s restart the service and refresh the page to see the result:

Remember the two interfaces in my interface warehouse:

Then look at the steps drop-down box:

It is found that the two interfaces can be selected

Well, that’s it for this video. Welcome to continue to follow ~