Home > Back-end > Today development interface, receive the caller parameters using the map, the leader says I low, let
Today development interface, receive the caller parameters using the map, the leader says I low, let
Time:05-21
Background: others let me provide an interface, internal calls, the reference is defined, only two parameters, and I have the vo class is not coincidence, use a post request, if I build a vo alone is a little waste, so I just use the @ RequestBody Map receiving, leadership let me change, want to do you have the relevant specification or reasons for why can't write?
CodePudding user response:
bosses who can help explain the younger brother
CodePudding user response:
You can hold a ali coding standards
CodePudding user response:
Few parameters directly defined String userId String bookId can Build a more actually vo not bother entity class ah, convenient extension after Naming conventions can be simple and clear
CodePudding user response:
Use the benefits of vo is code readability is very high, can immediately know what are the parameters, but don't know what are the key map, and you don't define this map, the request. GetParameterMap is parameter in it
CodePudding user response:
PO, VO, BO know
CodePudding user response:
Build a vo not bother, less than a minute, but physical analogy map more constraints and also more intuitive, more simple, maintain the map almost no constraint, strongly typed can reduce the communication cost and maintain
Actually, according to my idea is that you return the value returned Data I feel not perfect, this is pure code duplication, direct return objects can To combat it under your leadership ~ https://blog.csdn.net/educast/article/details/82863570
CodePudding user response:
Vo + the validator + swagger2 + unified exception handling