Interface
Let's Learn Go -- (6) Interface
· ☕ 5 min read
1. Interface-Oriented Programming 1.1 Characteristics Interface-oriented programming emphasizes interaction between modules through interfaces. First, the caller specifies a set of method signatures; then, the callee implements that set of methods. What sets interface programming apart from other programming styles is that it focuses on methods, not attributes. In many programming scenarios, methods are defined around attributes.

API of Serializer and ViewSet in restframework
· ☕ 4 min read
1. Serializer 1.1 Data Validation When deserializing data, the validity of the data needs to be checked. At this point you can call is_valid() for validation, and if a validation error occurs, you can get the error message from the .errors attribute. For example: 1 2 3 4 serializer.is_valid() # False serializer.

ViewSet and Serializer in restframework
· ☕ 6 min read
1. View Class in Django First, recall how Django handles a request. After receiving a request, Django creates a handler of type WSGIHandler, and the handler controls the entire processing flow. So how are the request URL and the View associated with each other? Django first loads the URLconf according to the ROOT_URLCONF setting, then matches the URLpatterns in the URLconf one by one in order, stopping as soon as a match is found.

Using axios in Vue
· ☕ 2 min read
1. Installing axios Install with npm 1 npm install axios --save There are two ways to register it globally: Bind it to the prototype 1 2 import axios from "axios"; Vue.prototype.axios = axios; With this approach, every Vue object gets a new axios object. 1 2 3 this.axios.post(apiUrl).then((res) => {

API Interface Specification
· ☕ 2 min read
In the process of Web application development, backend developers need to deliver API interfaces frequently, and frontend developers need to call API interfaces frequently. To lower communication costs and prevent possible security risks, and following the principle of convention over configuration, it is necessary to standardize the API specification. Restful