diff --git a/PennMobile/src/main/java/com/pennapps/labs/pennmobile/NewListingsFragment.kt b/PennMobile/src/main/java/com/pennapps/labs/pennmobile/NewListingsFragment.kt index 6ecc1e5f..757f92d8 100644 --- a/PennMobile/src/main/java/com/pennapps/labs/pennmobile/NewListingsFragment.kt +++ b/PennMobile/src/main/java/com/pennapps/labs/pennmobile/NewListingsFragment.kt @@ -6,12 +6,18 @@ import android.view.View import android.view.ViewGroup import android.widget.Toast import androidx.fragment.app.Fragment +import com.google.gson.annotations.SerializedName +import com.pennapps.labs.pennmobile.api.StudentLife +import com.pennapps.labs.pennmobile.classes.AmenitiesItem import com.pennapps.labs.pennmobile.databinding.FragmentNewListingsBinding import com.pennapps.labs.pennmobile.databinding.FragmentSubletterPostedListingsBinding class NewListingsFragment : Fragment() { private var _binding: FragmentNewListingsBinding? = null private val binding get() = _binding!! + + private lateinit var mStudentLife: StudentLife + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) } @@ -24,4 +30,38 @@ class NewListingsFragment : Fragment() { } return binding.root } + + private fun postSublet(title : String, price : Int, address : String?, startDate: String, + endDate : String, beds: Int?, baths: Int?, amenities: List, + description: String?) { + + } + + /* + data class Sublet(@SerializedName("end_date") + val endDate: String = "", + @SerializedName("amenities") + val amenities: List??, + @SerializedName("baths") + val baths: Int? = 0, + @SerializedName("address") + val address: String? = "", + @SerializedName("max_price") + val maxPrice: Int = 0, + @SerializedName("expires_at") + val expiresAt: String = "", + @SerializedName("min_price") + val minPrice: Int = 0, + @SerializedName("description") + val description: String? = "", + @SerializedName("title") + val title: String = "", + @SerializedName("beds") + val beds: Int? = 0, + @SerializedName("external_link") + val externalLink: String = "", + @SerializedName("start_date") + val startDate: String = "") + + */ } \ No newline at end of file diff --git a/PennMobile/src/main/java/com/pennapps/labs/pennmobile/api/StudentLife.java b/PennMobile/src/main/java/com/pennapps/labs/pennmobile/api/StudentLife.java index 1821b596..ad24ce15 100644 --- a/PennMobile/src/main/java/com/pennapps/labs/pennmobile/api/StudentLife.java +++ b/PennMobile/src/main/java/com/pennapps/labs/pennmobile/api/StudentLife.java @@ -24,6 +24,7 @@ import com.pennapps.labs.pennmobile.classes.Poll; import com.pennapps.labs.pennmobile.classes.Post; import com.pennapps.labs.pennmobile.classes.SaveAccountResponse; +import com.pennapps.labs.pennmobile.classes.Sublet; import com.pennapps.labs.pennmobile.classes.Venue; import com.pennapps.labs.pennmobile.classes.WhartonStatus; @@ -216,4 +217,11 @@ void sendFitnessPref( @Header("Authorization") String bearerToken, @Body FitnessRequest rooms, Callback callback); + + @POST("/sublet/properties/") + void createSublet( + @Header("Authorization") String bearerToken, + @Body Sublet sublet + ); + }