Removes redundant DB data fields and adds photo submission endpoint along with MinIO support for image storage
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package net.halfbinary.scavengerhuntapi.model.converter
|
||||
|
||||
import net.halfbinary.scavengerhuntapi.model.domain.Photo
|
||||
import net.halfbinary.scavengerhuntapi.model.record.PhotoRecord
|
||||
import net.halfbinary.scavengerhuntapi.model.response.PhotoResponse
|
||||
|
||||
fun Photo.toRecord() = PhotoRecord(
|
||||
id = id,
|
||||
itemId = itemId,
|
||||
huntId = huntId,
|
||||
hunterId = hunterId,
|
||||
foundDateTime = foundDateTime,
|
||||
status = status,
|
||||
statusChangeDateTime = statusChangeDateTime
|
||||
)
|
||||
|
||||
fun Photo.toResponse() = PhotoResponse(
|
||||
id = id,
|
||||
hunterId = hunterId,
|
||||
photoUploadDateTime = foundDateTime,
|
||||
photoStatus = status,
|
||||
photoStatusChangeDateTime = statusChangeDateTime
|
||||
)
|
||||
Reference in New Issue
Block a user