在我的 Java Jersey Rest 服务中,对于更新方法,值“money”在 server.xml 中表示为 long。有效值介于 30.00 和 500.00 之间
哪种方法更标准?我是否应该强制客户端将货币值发送为 30.00 并在服务器中手动解析,而不是使其加倍/长。或以 3000 发送并以这种方式解析。或者在 java/jerseylibrary 中已经有办法做到这一点。
@PUT
@Path("/money")
@Consumes("text/plain)
public void updateThreshold(String threshold) {
*//check value and update in server*
}
注意:我不想使用参数化请求将参数类型设置为双精度