亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

api - Java 開發(fā) App 接口中關(guān)于 url 和入?yún)⒚Q規(guī)范的問題
PHP中文網(wǎng)
PHP中文網(wǎng) 2017-04-18 10:48:21
0
5
965

現(xiàn)在公司用開發(fā)給前端用的接口,語言是Java,現(xiàn)在想定開發(fā)規(guī)范,然后有些糾結(jié)的地方:

一個是接口的名稱,之前用的的駝峰的形式,比如myTopic,但是看網(wǎng)上推薦的有my_topic,更容易辨識,或者推薦比較多的my-topic,看到說法是比前一種輸入起來更方便。

還有個入?yún)⒌膯栴},比如一個接口接受的參數(shù)是分頁的頁數(shù),之前也是習(xí)慣性的駝峰的pageNum,但看很多公司,比如支付寶的接受參數(shù)都是page_num這種。

想問下大家以上兩個問題一般用的是那種或推薦哪種?

PHP中文網(wǎng)
PHP中文網(wǎng)

認(rèn)證0級講師

reply all(5)
伊謝爾倫

Each company has different writing methods, and even different teams within a company will have different writing methods.

But there is always a way of writing that is correct most of the time, and that is the hump.

The camel case writing method has also been verified by experiments. It is the easiest to recognize and the recognition speed is fast. You can read the study on camelback readability here

黃舟

Personally, I think the so-called specification is the agreement between your front-end and backend. Once the agreement is made and it can meet the needs, then this agreement is your specification.

左手右手慢動作

The first one
https://img.hacpai.com/file/2...

劉奇

There is no standard answer to the style question. Cases can be found in the 3 methods you listed.

I personally use the underline method page_num, which is more readable and uses lowercase letters, which is more suitable for url/uri.

小葫蘆

It is recommended to use Douban’s URL design http://www.prower.cn/interact...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template