@Test public void testAddAddress() throws Exception { DeliveryAddress da = new DeliveryAddress(); da.setUserId(1000l); da.setAddress("qwert"); post("/user/address/add", JSON.toJSONString(da)); }
@RequestMapping(value = "/api/v1/user/address/add", method = {RequestMethod.POST, RequestMethod.GET}) public JSONObject addAddress(@RequestBody DeliveryAddress address) { boolean status = addressService.addDa(getUserId(),address); return response(status, "最多添加3条收货地址"); }
DeliveryAddressController extends BaseController { @RequestMapping(value = "/api/v1/user/address/add", method = {RequestMethod.POST, RequestMethod.GET}) public JSONObject addAddress(@RequestBody DeliveryAddress address) { boolean status = addressService.addDa(getUserId(),address); return response(status, "最多添加3条收货地址"); } }
DeliveryAddressController extends BaseController { @RequestMapping(value = "/api/v1/user/address/add", method = {RequestMethod.POST, RequestMethod.GET}) public JSONObject addAddress(@RequestBody DeliveryAddress address) { boolean status = addressService.addDa(getUserId(),address); return response(status, "最多添加3条收货地址"); }  }
DeliveryAddressController extends BaseController { @RequestMapping(value = "/api/v1/user/address/add", method = {RequestMethod.POST, RequestMethod.GET}) public JSONObject addAddress(@RequestBody DeliveryAddress address) { boolean status = addressService.addDa(getUserId(),address); return response(status, "最多添加3条收货地址"); }  @RequestMapping(value = "/api/v1/user/address/add", method = {RequestMethod.POST, RequestMethod.GET}) JSONObject addAddress(@RequestBody DeliveryAddress address); @RequestMapping(value = "/api/v1/user/address/del", method = {RequestMethod.POST, RequestMethod.GET}) JSONObject deleteAddress(@RequestParam("addressId") Long addressId); @ApiOperation("修改收货地址（tip；未使用！）") @RequestMapping(value = "/api/v1/user/address/up", method = {RequestMethod.POST, RequestMethod.GET}) JSONObject updateAddress(@RequestBody DeliveryAddress address); @ApiOperation("查看收货地址信息") @RequestMapping(value = "/api/v1/user/address/show", method = {RequestMethod.POST, RequestMethod.GET}) JSONObject queryAddress(); }
DeliveryAddressController extends BaseController { @RequestMapping(value = "/api/v1/user/address/add", method = {RequestMethod.POST, RequestMethod.GET}) public JSONObject addAddress(@RequestBody DeliveryAddress address) { boolean status = addressService.addDa(getUserId(),address); return response(status, "最多添加3条收货地址"); }  @RequestMapping(value = "/api/v1/user/address/add", method = {RequestMethod.POST, RequestMethod.GET}) JSONObject addAddress(@RequestBody DeliveryAddress address); @RequestMapping(value = "/api/v1/user/address/del", method = {RequestMethod.POST, RequestMethod.GET}) JSONObject deleteAddress(@RequestParam("addressId") Long addressId); @ApiOperation("修改收货地址（tip；未使用！）") @RequestMapping(value = "/api/v1/user/address/up", method = {RequestMethod.POST, RequestMethod.GET}) JSONObject updateAddress(@RequestBody DeliveryAddress address); @ApiOperation("查看收货地址信息") @RequestMapping(value = "/api/v1/user/address/show", method = {RequestMethod.POST, RequestMethod.GET}) JSONObject queryAddress();  }