ResponseEntity<Device[]> result = restTemplate.exchange(HELLO_URL, HttpMethod.POST, new HttpEntity<>(headers), Device[].class);
org.springframework.web.client.RestClientException: Error while extracting response for type [class [Lcom.javainuse.model.Device;] and content type [application/json;charset=UTF-8]; nested exception is org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize instance of `[Lcom.javainuse.model.Device;` out of START_OBJECT token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `[Lcom.javainuse.model.Device;` out of START_OBJECT token
at [Source: (PushbackInputStream); line: 1, column: 1]
class Response(models.Model):
"""Отклики"""
user = models.OneToOneField(User, on_delete=models.CASCADE, verbose_name="Пользователь", null=True, blank=True)
text = models.TextField(verbose_name="Сообщение", max_length=5000)
post = models.ForeignKey(Bb, verbose_name="Пост", on_delete=models.CASCADE, null=True, blank=True)
def __str__(self):
return f"{self.name} - {self.post}"
class Meta:
verbose_name = "Отклик"
verbose_name_plural = "Отклики"
class Bb(models.Model):
title = models.CharField(max_length=50, verbose_name="Товар")
content = models.TextField(null=True, blank=True, verbose_name="Описание")
rubric = models.ForeignKey('Rubric', null=True, on_delete=models.PROTECT, verbose_name="Рубрика")
price = models.FloatField(null=True, blank=True, verbose_name="Цена")
published = models.DateTimeField(auto_now_add=True, db_index=True, verbose_name="Опубликовано")
user = models.ForeignKey(User, on_delete=models.CASCADE, null=True, default=User, verbose_name="Пользователь")
class Meta:
verbose_name = "Обьявление"
verbose_name_plural = "Обьявления"
ordering = ['-published']
def __str__(self):
return self.title
class Rubric(models.Model):
name = models.CharField(max_length=20, db_index=True, verbose_name="Название")
class Meta:
verbose_name = "Рубрика"
verbose_name_plural = "Рубрики"
ordering = ['name']
def __str__(self):
return self.name
def profile_view(request, pk):
profile = Profile.objects.get(user_id=pk)
context = {'profile': profile}
return render(request, 'bboard/profile.html', context)
class Response(models.Model):
"""Отзывы"""
name = models.OneToOneField(User, on_delete=models.CASCADE, verbose_name="Пользователь")
text = models.TextField(verbose_name="Сообщение", max_length=5000)
post = models.ForeignKey(Bb, verbose_name="Пост", on_delete=models.CASCADE)
def __str__(self):
return f"{self.name} - {self.post}"
class Meta:
verbose_name = "Отзыв"
verbose_name_plural = "Отзывы"
ищу чем можно заменить этот способ чтоб внедрить его в свое приложение
а на счет гугл аккаунта - хочу попытаться найти российские аналоги, так как есть риски отключение гугла в россии