Here, Chogory, a programmer at Dachang, records every bit of his life since joining dachang from school.

things

The cause of

As shown in the figure, it happened on a weekday this week when the interface document review was completed (PS: Writing interface document on giant development need to develop, and then by the high T to review the interface documents, document no problem, then the front-end and back-end development carried out in accordance with the interface document), you then need to according to the evaluation opinions, modified for some reason, the interface of the document development work need to handover to develop the new intern. So Mr. Chogory let the interns do the rest of the editing and development.

Procedure for modifying interface documentation

There are not many changes, one is to add a paging effect, the other is to add some fields in the return result, I understand the workload is not much.

Add some fields to the return result. I expect the result to look like this:

{
    "data":{
        "A1":{
            "A1":[
                "A1-1",
                "A1-2"
            ],
            "current":""
        }
    }
}
Copy the code

A1 is a list containing all values of data.a1. A1. The data.a1. current field represents the selected field of data.a1. A1.

But to my surprise, when the intern gave me the modified interface document, I saw the result like this:

{
    "data":{
        "A1":{
            "A1": {A1-1,A1-2} ,
            "new":null
        }
    }
}
Copy the code

I asked the intern, and you can have itJson online parsing urlParsed intojson? The intern said to me,What is JSON?Chogory was just????? Well,jsonI don’t know if I don’t know, but thisChanges to achieve paging effect are also full of slots.

Here’s what I expect:

{
    "page":{
        "pageNo":1,
        "pageSize":10,
        "totalCount":1
    }
}
Copy the code

The intern only added onePage: 1Can you paginate a field like this? Just a few pages, not how many pages per page?

The process

Finally I see him so ah, modify do not know when, I put the interface document modification work personally changed.

Reflect on the recruitment standards of big factories

(Photo) Now, you might wonder,I depend, how does so dish enter Baidu?. In fact, when the hair circle of friends, on a pile of people in the following comments asked me, (PS: want to pry my circle of friends first-hand news, you can add me ha has my friends on the need to add ha, the number of people has not reached the upper limit, copyQGLNB12342Add it)

Here and you say what big factory recruit interns fancy, in fact, we can look at the big factory from the Internet to know:

  • Basic knowledge of computer: operating system, database, data structure, computer network, design module, Java basic collection Spring
  • Handwritten algorithm questions can be written out within 10 minutes of each question above “Sword Finger Offer” by hand
  • There’s a project I can talk about
  • Education is ok, education is not good only to find someone to push inside, like Chogory push inside.

So you see, you’re not going to be asked to write it by handjsonAh, not being able to json doesn’t stop you from getting through the interview. Here’s a list of things That Chowgory compiled while preparing for an interview

I have helped many fans get offers from Internet companies. Recently, a reader friend said that she got an offer of 22K+12W signing fee from Baidu.

Need in my public good programmer Jorghry backstage reply 888 to get this big factory interview gem book.

Interface documentation

As for the intern, ALTHOUGH I modified the interface document by myself, I thought that I could not always write the interface document by myself in the future, so I sorted out some materials and sent them to the intern on the night of Double 11.

Don’t ask why he didn’t spend double 11 with his girlfriend. If He had a girlfriend, why would he send this information to a big man at night?

Juejin. Cn/post / 684490…

I need to sort out these interface documentation information, can be in the Chogory public good: programmer Chogory backend reply interface documentation access.

Naming conventions for interfaces

The most important point in the URL of the interface is the path.

The path, also known as the endpoint, represents the specific URL of the API.

In a RESTful architecture, each url represents a resource, so there can be no verbs in the url, only nouns, and the nouns usually correspond to the table names in the database. Generally speaking, tables in a database are “collections” of the same records, so nouns in apis should also be plural.

For example, there is an API that provides information about zoos, including various animals

If you want to locate an animal in a zoo, your url is:

Api.example.com/v1/zoos/ {zo…

Change zooID to the corresponding zooID and animals to the corresponding animal.

Api.example.com/v1/zoos/2/a… It stands for pig at Zoo two.

Add, delete, change and check the interface

For example, if you create a configuration and save it, you should use post, and then you should use PUT.

Although you can use post to achieve editing functions in the back end, you can even use POST to use the GET method, but in fact, it is not in accordance with the specification, large factories still pay attention to the specification.

Page turning design

Each company may have the front end of the page turn default set, it is best to align with the front end in advance to design the interface document, another interface document a page turn way, to the front end and back end have increased a lot of work.

alignment

If the document is changed, align the interface document with everyone else

The last

Chogory original is not easy, feel helpful, I hope the talents forward, like, see a wave of support.