added card on post and feed

This commit is contained in:
SlimusMinus
2026-06-04 00:32:51 +03:00
parent b3b15c3f97
commit c68cdf1c3e
4 changed files with 54 additions and 8 deletions

View File

@@ -2,7 +2,6 @@ package com.krylov.refound.controller;
import com.krylov.refound.dto.PostRequest;
import com.krylov.refound.dto.PostResponse;
import com.krylov.refound.entity.Post;
import com.krylov.refound.enums.PostType;
import com.krylov.refound.service.PostService;
import java.util.List;
@@ -15,7 +14,6 @@ import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
@@ -49,6 +47,9 @@ public class PostController {
@PathVariable Long id,
@RequestParam String type,
@RequestParam String title,
@RequestParam(required = false) String address,
@RequestParam(required = false) Double latitude,
@RequestParam(required = false) Double longitude,
@RequestParam(required = false) String description,
@RequestParam(required = false) String category,
@RequestParam(required = false) String phone,
@@ -60,6 +61,9 @@ public class PostController {
request.setDescription(description);
request.setCategory(category);
request.setPhone(phone);
request.setLatitude(latitude);
request.setLongitude(longitude);
request.setAddress(address);
return service.update(id, request, image);
}