浅谈API编写中的注意事项

2020-11-12 06:36:00 by wst

web开发

在实际的项目开发过程中,如果有清晰明确的规范会减少很多不必要的麻烦。比如:字段少传了、字段传空了、返回报错崩溃了。

 

根据最近遇到的一些问题,做如下约定:

1 字段约定

确定哪些是必传字段,比如:开始时间、结束时间、渠道id。

只要有一个没传,立马给前端返回参数错误。

 

2查询结果为空

如果查询结果为空,这是一种正常情况。

返回数据的时候,首先状态码要给1,其次返回空数组即可。

 

3异常提示

后端代码在处理的过程中,难免报错。

此时要给出一个友好的提示,比如:“查询过程错误,请重试。”、“系统内部错误,请联系管理员”。

否则的话,用户会一脸懵逼;甚至会骂两句--什么垃圾系统

 

总结

这里主要说了最近遇到的问题。

实际当中需要注意的问题还有很多,后续如遇到再来补充。

 


Comments(133) Add Your Comment

Charlesnag
“I haven’t seen you in these parts,” the barkeep said, sidling settled to where I sat. “Repute’s Bao.” He stated it exuberantly, as if say of his exploits were shared aside settlers about multitudinous a firing in Aeternum. He waved to a unimpassioned tun apart from us, and I returned his gesture with a nod. He filled a field-glasses and slid it to me across the stained red wood of the bench in the vanguard continuing. “As a betting man, I’d be ready to wager a honourable piece of invent you’re in Ebonscale Reach for the purpose more than the carouse and sights,” he said, eyes glancing from the sword sheathed on my with it to the capitulate slung across my back. http://www.google.com.sb/url?sa=t&rct=j&q=how+does+bone+repair+pdf&source=web&cd=3&ved=0cdgqfjac&url=https://renewworld.ru/
Kevingaw
https://maps.google.bg/url?q=https://betonlinecasinobonuscodes.com/pl/ https://images.google.tl/url?q=https://www.simacek.com/present/inc/wie_man_ein_casino_online_schl_gt__clevere_tipps_f_r_anf_nger_und_erfahrene_spieler.html http://justinekeptcalmandwentvegan.com/wp-content/pages/welches_online_casino_ist_zu_empfehlen___online_casinos_mit_guter_rendite_2022_.html http://images.google.hn/url?q=https://1xbitapk.com/ https://www.feldbahn-ffm.de/wp-content/pages/wie_man_blackjack_in_einem_casino_spielt_und_gewinnt.html
Mpjffj
buy atorvastatin 20mg without prescription <a href="https://lipiws.top/">atorvastatin 10mg uk</a> oral atorvastatin 40mg
Llcyyo
buy cipro 500mg pills - <a href="https://cipropro.top/bactrimos/">purchase bactrim pills</a> clavulanate ca
Ptnbdl
order cipro 1000mg without prescription - <a href="https://metroagyl.top/cefaclor/">purchase cephalexin generic</a> augmentin generic
Azwkxe
ciplox 500mg over the counter - <a href="https://septrim.top/erythromycin/">cheap erythromycin 250mg</a> erythromycin 500mg cost
Pgvgmr
metronidazole 400mg sale - <a href="https://metroagyl.top/clindamycin/">buy cleocin 300mg online cheap</a> purchase zithromax generic
Ogrsgv
buy ivermectin pills - <a href="https://keflexin.top/cefixime/">order suprax 100mg online</a> tetracycline 250mg drug
Icftdk
side effects of ivermectin - <a href="https://keflexin.top/ceftin/">cefuroxime 500mg uk</a> generic tetracycline 500mg
Fbwqsn
buy valacyclovir 500mg generic - <a href="https://gnantiviralp.com/diltiazem/">diltiazem price</a> order generic acyclovir 400mg
Bdkrtn
purchase ampicillin generic <a href="https://ampiacil.top/doxycyclineantb/">vibra-tabs over the counter</a> amoxicillin without prescription
Ofifus
cost metronidazole 400mg - <a href="https://metroagyl.top/cefaclor/">cefaclor 250mg oral</a> purchase azithromycin pill
Yssjjg
order lasix sale - <a href="https://antipathogenc.com/medex/">order warfarin 2mg sale</a> cheap captopril 25mg
Cicxjj
metformin 1000mg usa - <a href="https://gnantiacidity.com/septra/">buy bactrim 480mg online</a> lincocin 500 mg price
Aqsxpl
retrovir 300 mg us - <a href="https://canadiangnp.com/">buy glycomet 1000mg without prescription</a> zyloprim 300mg over the counter
Oyibnn
clozaril 50mg for sale - <a href="https://genonlinep.com/frumil/">frumil over the counter</a> pepcid 40mg cheap
Bwskeu
buy quetiapine 100mg online - <a href="https://gnkantdepres.com/desyrel/">cost trazodone 100mg</a> buy cheap eskalith
Atcqob
anafranil online - <a href="https://antdeponline.com/cymbalta/">order duloxetine 20mg online</a> generic doxepin 75mg
Wndvee
atarax 10mg cheap - <a href="https://antdepls.com/buspar/">buspin buy online</a> amitriptyline buy online
Zcbxza
buy augmentin 625mg - <a href="https://atbioinfo.com/septra/">order bactrim 480mg online</a> oral ciprofloxacin 1000mg
Gomqhj
order amoxil for sale - <a href="https://atbioxotc.com/cefadroxil/">how to buy duricef</a> buy ciprofloxacin 500mg without prescription
Tobwuh
buy generic zithromax 250mg - <a href="https://gncatbp.com/ctinidazole/">buy tindamax pill</a> buy ciprofloxacin 500mg generic
Rfpuuw
clindamycin tablet - <a href="https://cadbiot.com/doxycycline/">doxycycline online order</a> cheap chloramphenicol
Kqdmul
ivermectin 12 mg for people - <a href="https://antibpl.com/szdoryx/">doryx pill</a> buy generic cefaclor 250mg
Yifcnr
albuterol medication - <a href="https://antxallergic.com/oiphenergan/">buy promethazine tablets</a> order theo-24 Cr 400 mg pills
Mjexjk
methylprednisolone cost in usa - <a href="https://ntallegpl.com/loratadine/">how to buy loratadine</a> azelastine 10ml oral
Zjoxpx
buy clarinex online - <a href="https://rxtallerg.com/getaristocort/">how to get aristocort without a prescription</a> buy generic ventolin for sale
Fzyjhz
buy glycomet 1000mg - <a href="https://arxdepress.com/acarbose50/">buy acarbose online cheap</a> order acarbose for sale
Dccwdz
buy glyburide pills - <a href="https://prodeprpl.com/">glyburide usa</a> how to get forxiga without a prescription
Glgzxy
semaglutide for sale online - <a href="https://infodeppl.com/ddavpspray/">how to get DDAVP without a prescription</a> purchase DDAVP sale
Ttryzm
buy terbinafine 250mg for sale - <a href="https://treatfungusx.com/adiflucanv/">diflucan 200mg brand</a> grifulvin v uk
Fiyhvo
generic nizoral 200mg - <a href="https://antifungusrp.com/itraconazole100/">itraconazole us</a> order itraconazole 100 mg
Eotozu
famciclovir 500mg over the counter - <a href="https://amvinherpes.com/acyclovircream/">brand zovirax 800mg</a> valcivir price
Kuflvs
metoprolol 50mg us - <a href="https://bloodpresspl.com/">order lopressor pills</a> brand adalat
Xoqvis
microzide 25mg usa - <a href="https://norvapril.com/">microzide 25mg uk</a> buy zebeta for sale
Peocpr
nitroglycerin - <a href="https://nitroproxl.com/catapres/">clonidine where to buy</a> diovan medication
Tdvpej
simvastatin difference - <a href="https://canescholest.com/gemfibrozil/">gemfibrozil prove</a> lipitor 20mg usa
Hlqsjw
rosuvastatin linger - <a href="https://antcholesterol.com/ezetimibe/">ezetimibe explosion</a> caduet brown
Vsjzfq
buy viagra professional secret - <a href="https://edsildps.com/">viagra professional online dispose</a> levitra oral jelly pace
Tphfwo
dapoxetine current - <a href="https://promedprili.com/fildena/">fildena overcome</a> cialis with dapoxetine minister
Ewumem
cenforce prisoner - <a href="https://xcenforcem.com/zenegrasildenafil/">zenegra online respectable</a> brand viagra online bubble
Lwwbrd
brand cialis dismiss - <a href="https://probrandtad.com/viagrasofttabs/">viagra soft tabs cause</a> penisole describe
Oojmzo
brand cialis amount - <a href="https://probrandtad.com/penisole/">penisole rich</a> penisole unlike
Kcadhk
cialis soft tabs pills betray - <a href="https://supervalip.com/cialisoraljelly/">cialis oral jelly pills gesture</a> viagra oral jelly best
Ivvmcl
cialis soft tabs pills preparation - <a href="https://supervalip.com/">cialis soft tabs mansion</a> viagra oral jelly mark
Jfaetf
priligy advice - <a href="https://promedprili.com/viagraplus/">viagra plus blank</a> cialis with dapoxetine spite
Dwdyxv
cenforce online every - <a href="https://xcenforcem.com/silagrasildenafil/"></a> brand viagra pills serious
Oythcs
asthma treatment doom - <a href="https://bsasthmaps.com/">asthma treatment traveller</a> inhalers for asthma good
Weyoye
acne medication career - <a href="https://placnemedx.com/">acne treatment thomas</a> acne medication ruin
Abzhhm
prostatitis treatment head - <a href="https://xprosttreat.com/">prostatitis pills around</a> prostatitis medications hurl
Hvdzwv
treatment for uti heaven - <a href="https://amenahealthp.com/">uti medication cry</a> uti antibiotics distress
Ghnxul
claritin pills fish - <a href="https://clatadine.top/">claritin pills troop</a> claritin pills consideration
Nxzgdq
valtrex rattle - <a href="https://gnantiviralp.com/">valacyclovir pills accord</a> valacyclovir online explore
Pasjfk
priligy pursuit - <a href="https://prilixgn.top/">dapoxetine stomach</a> priligy moody
Lzrlgt
claritin swarm - <a href="https://clatadine.top/">claritin phrase</a> claritin pills sacrifice
Fiazne
ascorbic acid chill - <a href="https://ascxacid.com/">ascorbic acid frantic</a> ascorbic acid variety
Kzcttl
promethazine indeed - <a href="https://prohnrg.com/">promethazine degree</a> promethazine statement
Vyjvfd
clarithromycin pills haul - <a href="https://gastropls.com/mesalaminepl/">mesalamine pills level</a> cytotec shelf
Mkdwrr
florinef prayer - <a href="https://gastroplusp.com/prlansoprazole/">lansoprazole unexpected</a> lansoprazole experience
Ojcytv
buy rabeprazole without a prescription - <a href="https://gastrointesl.com/reglanmetoclop/">maxolon price</a> buy generic domperidone online
Emjvms
cost aciphex - <a href="https://gastrointesl.com/">brand aciphex 20mg</a> buy motilium 10mg pills
Hfnrso
purchase bisacodyl without prescription - <a href="https://gastroinfop.com/">buy generic dulcolax 5mg</a> buy liv52 medication
Rohrsm
eukroma online order - <a href="https://dupsteron.com/">duphaston 10mg canada</a> buy dydrogesterone 10 mg online cheap
Qcgajt
cotrimoxazole 480mg drug - <a href="https://tobmycin.com/">tobra buy online</a> buy tobra 5mg
Hfttrb
griseofulvin generic - <a href="https://dipyrilx.com/">buy dipyridamole 25mg online cheap</a> gemfibrozil canada
Idbdmb
buy dapagliflozin 10 mg pills - <a href="https://forpaglif.com/">dapagliflozin 10mg without prescription</a> buy precose online
Dncctd
buy generic dimenhydrinate for sale - <a href="https://prasilx.com/">buy prasugrel pill</a> purchase actonel generic
Xqwqta
vasotec uk - <a href="https://xalanoprost.com/">buy xalatan generic</a> buy cheap zovirax
Cfhdcn
cheap monograph 600 mg - <a href="https://cilosetal.com/">cilostazol without prescription</a> buy cilostazol sale
Hezfuy
piroxicam online order - <a href="https://feldexicam.com/">order feldene 20 mg online</a> exelon 6mg usa
Zcqqnl
buy nootropil paypal - <a href="https://nootquin.com/praziquantel/">praziquantel 600mg sale</a> sinemet for sale online
Hycpka
buy hydroxyurea - <a href="https://hydroydrinfo.com/pentoxifylline/">buy trental</a> robaxin 500mg canada
Uvstac
order depakote 250mg pill - <a href="https://adepamox.com/topiramate/">buy topiramate 200mg for sale</a> buy topiramate medication
Jnwkwe
norpace usa - <a href="https://anorpica.com/pregabal/">cost lyrica 150mg</a> purchase chlorpromazine sale
Dryhxy
aldactone 25mg sale - <a href="https://aldantinep.com/dosulepin/">buy dosulepin no prescription</a> naltrexone without prescription
Getgjt
cyclophosphamide cheap - <a href="https://cycloxalp.com/stavudine/">buy stavudine paypal</a> purchase trimetazidine for sale
Uawafw
buy flexeril cheap - <a href="https://abflequine.com/primaquine/">primaquine usa</a> purchase vasotec for sale
Iprecf
ondansetron generic - <a href="https://azofarininfo.com/">cheap zofran 4mg</a> requip canada
Zbmhqo
order generic ascorbic acid 500mg - <a href="https://mdacidinfo.com/prochlorperazine/">order prochlorperazine generic</a> purchase prochlorperazine pills
Ktgjsk
purchase durex gel cheap - <a href="https://xalaplinfo.com/durexcondoms/">buy durex condoms online cheap</a> zovirax ca
Uqsxbv
buy generic rogaine online - <a href="https://hairlossmedinfo.com/finasteridehl/">order finasteride 1mg online cheap</a> purchase proscar sale
Ziubaz
leflunomide pills - <a href="https://infohealthybones.com/">order arava 20mg pills</a> cheap generic cartidin
Jyvkje
calan brand - <a href="https://infoheartdisea.com/cardizem/">diltiazem brand</a> tenoretic price
Baglns
buy tenormin for sale - <a href="https://heartmedinfox.com/clopidogrel/">plavix 150mg pills</a> buy carvedilol pill
Lixbri
gasex usa - <a href="https://herbalinfomez.com/">cheap gasex for sale</a> buy diabecon
Byoond
buy lasuna no prescription - <a href="https://infoherbalmz.com/himcolin/">purchase himcolin generic</a> order himcolin without prescription
Sshstw
buy generic norfloxacin over the counter - <a href="https://gmenshth.com/flutamide/">eulexin online buy</a> confido over the counter
Qghznh
where to buy speman without a prescription - <a href="https://spmensht.com/finasteride/">fincar over the counter</a> buy cheap generic fincar
Fausjz
order finax without prescription - <a href="https://finmenura.com/">finax order online</a> alfuzosin 10 mg for sale
Agbzpo
purchase terazosin online cheap - <a href="https://hymenmax.com/tamsulosin/">flomax oral</a> generic priligy 30mg
Zwazqp
trileptal 600mg over the counter - <a href="https://trileoxine.com/">purchase oxcarbazepine</a> buy synthroid cheap
Sdxnxd
cheap duphalac - <a href="https://duphalinfo.com/mentat/">brahmi oral</a> betahistine online order
Nrjbgp
cyclosporine online - <a href="https://asimusxate.com/">purchase imusporin</a> colchicine 0.5mg generic
Ainhci
deflazacort price - <a href="https://lazacort.com/">order deflazacort pill</a> alphagan online buy
Tvwglh
buy besivance sale - <a href="https://besifxcist.com/carbocysteine/">buy carbocysteine</a> buy sildamax no prescription
Gbzrjo
buy gabapentin medication - <a href="https://aneutrin.com/ibuprofen/">motrin 600mg usa</a> sulfasalazine medication
Krmvsc
buy probenecid 500 mg pills - <a href="https://bendoltol.com/monograph/">etodolac 600mg us</a> buy carbamazepine paypal
Slbofb
celebrex online order - <a href="https://celespas.com/">celecoxib 100mg generic</a> buy indocin 50mg online
Ohpdlg
colospa order online - <a href="https://coloxia.com/etoricoxib/">order etoricoxib 120mg sale</a> purchase pletal sale
Addwzs
voltaren 100mg tablet - <a href="https://dicloltarin.com/">buy voltaren generic</a> aspirin brand
Nibwal
buy rumalaya - <a href="https://rumaxtol.com/shallaki/">shallaki generic</a> buy elavil generic
Kalese
pyridostigmine cheap - <a href="https://mestonsx.com/azathioprine/">buy azathioprine paypal</a> azathioprine 25mg price
Ikwbbs
baclofen 10mg us - <a href="https://baclion.com/">baclofen order</a> piroxicam order
Groxib
buy cyproheptadine 4 mg without prescription - <a href="https://periheptadn.com/">periactin sale</a> buy tizanidine medication
Ephplo
buy mobic generic - <a href="https://meloxiptan.com/asrizatriptan/">maxalt sale</a> purchase toradol without prescription
Cbnkat
buy omnicef 300 mg sale - <a href="https://omnixcin.com/">purchase cefdinir without prescription</a> cheap cleocin
Bpgfjn
artane where to buy - <a href="https://voltapll.com.com/">artane online order</a> voltaren gel buy online
Yyvnfs
generic isotretinoin - <a href="https://aisotane.com/">buy generic accutane for sale</a> deltasone 5mg oral
Dyaygg
order deltasone pills - <a href="https://apreplson.com/prednisolone/">prednisolone 40mg ca</a> order permethrin cream
Cwzdai
acticin canada - <a href="https://actizacs.com/tretinoin/">tretinoin online</a> order retin sale
Vjadug
buy betamethasone 20 gm sale - <a href="https://betnoson.com/awdifferin/">buy adapalene cream</a> buy monobenzone
Zuxzbi
metronidazole 400mg for sale - <a href="https://ametronles.com/">order metronidazole 400mg sale</a> buy cenforce 50mg without prescription
Imjssp
amoxiclav drug - <a href="https://baugipro.com/">where can i buy clavulanate</a> order synthroid 150mcg
Bjydxu
buy cleocin 300mg online cheap - <a href="https://clinycinpl.com/">purchase cleocin pill</a> indomethacin for sale
Ryngjs
where can i buy losartan - <a href="https://acephacrsa.com/">cost keflex 500mg</a> cephalexin 500mg ca
Ybytyg
buy generic modafinil 200mg - <a href="https://sleepagil.com/phenergan/">promethazine ca</a> order melatonin 3 mg generic
Docsmr
bupropion pills - <a href="https://bupropsl.com/shuddhaguggulu/">buy generic shuddha guggulu</a> shuddha guggulu over the counter
Rsitsj
capecitabine pills - <a href="https://xelocap.com/mefenamicacid/">mefenamic acid price</a> danazol sale
Bkckvg
prometrium price - <a href="https://apromid.com/clomiphene/">purchase clomiphene for sale</a> fertomid for sale
Ktgxtc
buy alendronate generic - <a href="https://pilaxmax.com/">fosamax us</a> order provera 5mg pill
Zxexxe
norethindrone 5mg uk - <a href="https://norethgep.com/bimatoprost/">careprost eye drops</a> order yasmin
Xxvghc
purchase yasmin generic - <a href="https://festrolp.com/anastrozole/">order arimidex 1 mg pills</a> buy anastrozole sale
Sxrgrp
order dostinex 0.25mg generic - <a href="https://adostilin.com/cabgolin/">cheap cabgolin tablets</a> buy generic alesse online
Asdphu
гѓ—гѓ¬гѓ‰гѓ‹гѓі йЈІгЃїж–№ - <a href="https://jpaonlinep.com/jamoxicillin/">г‚ўгѓўг‚­г‚·гѓ«йЊ  250mg еј·гЃ•</a> г‚ёг‚№гѓ­гѓћгѓѓг‚ЇгЃ®йЈІгЃїж–№гЃЁеЉ№жћњ
Emuafw
バイアグラの購入 - <a href="https://jpedpharm.com/">バイアグラ処方</a> タダラフィル 飲み方
Sonkyl
プレドニン通販 - <a href="https://jpanfarap.com/">プレドニンの飲み方と効果</a> イソトレチノイン おすすめ
Ankmqs
eriacta tomb - <a href="https://eriagra.com/asildigrah/">sildigra back</a> forzest mission
Adwuxr
valif pills light - <a href="https://avaltiva.com/">valif online acknowledge</a> brand sinemet
Amsypj
crixivan pill - <a href="https://confindin.com/">purchase indinavir online cheap</a> where can i purchase voltaren gel
Wdhxkx
valif anybody - <a href="https://avaltiva.com/rtsinemet/">buy sinemet sale</a> sinemet pill
Bvrcyx
oral modafinil - <a href="https://provicef.com/">provigil 200mg brand</a> purchase epivir without prescription
Rtdgaf
purchase phenergan - <a href="https://prometacin.com/asciprofloxacin/">ciprofloxacin where to buy</a> purchase lincomycin without prescription
Esvxdk
stromectol 3mg online - <a href="https://ivercand.com/carbamazepine/">carbamazepine 400mg price</a> buy carbamazepine 200mg online cheap