public ApiReturnModel DeleteUserAddress([FromBody] ApiUserAddressModel apiUserAddressModel) { var userInfo = GetCurrentUserInfo(); if (UserAddressBusiness.DeleteUserAddress(apiUserAddressModel.Id, userInfo.Id)) { return(ApiReturnModel.ReturnOk()); } return(ApiReturnModel.ReturnError()); }
public ApiReturnModel AddUserAddress([FromBody] ApiUserAddressModel apiUserAddressModel) { var userInfo = GetCurrentUserInfo(); UserAddress userAddress = new UserAddress() { Id = Guid.NewGuid(), UserId = userInfo.Id, City = apiUserAddressModel.City, Province = apiUserAddressModel.Province, DetailedAddress = apiUserAddressModel.DetailedAddress, ConsigneeName = apiUserAddressModel.ConsigneeName, Flag = 0, Phone = apiUserAddressModel.Phone }; userAddress = UserAddressBusiness.AddItem(userAddress); return(ApiReturnModel.ReturnOk("增加成功", userAddress)); }
public ApiReturnModel UpdateUserAddress([FromBody] ApiUserAddressModel apiUserAddressModel) { var userInfo = GetCurrentUserInfo(); UserAddress userAddress = new UserAddress() { Id = apiUserAddressModel.Id, UserId = userInfo.Id, City = apiUserAddressModel.City, Province = apiUserAddressModel.Province, DetailedAddress = apiUserAddressModel.DetailedAddress, ConsigneeName = apiUserAddressModel.ConsigneeName, Flag = 0, Phone = apiUserAddressModel.Phone }; if (UserAddressBusiness.UpdateUserAddress(userAddress)) { return(ApiReturnModel.ReturnOk()); } return(ApiReturnModel.ReturnError()); }