Fakultas Ilmu Komputer UI

Skip to content
Snippets Groups Projects
Unverified Commit e85fdb56 authored by Antoine Rey's avatar Antoine Rey
Browse files

Add ownerId property to Pet

parent a87a4f4f
No related branches found
No related tags found
No related merge requests found
package org.springframework.samples.petclinic.mapper;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.springframework.samples.petclinic.rest.dto.PetDto;
import org.springframework.samples.petclinic.rest.dto.PetFieldsDto;
import org.springframework.samples.petclinic.rest.dto.PetTypeDto;
......@@ -14,6 +15,8 @@ import java.util.Collection;
*/
@Mapper
public interface PetMapper {
@Mapping(source = "owner.id", target = "ownerId")
PetDto toPetDto(Pet pet);
Collection<PetDto> toPetsDto(Collection<Pet> pets);
......
......@@ -722,6 +722,14 @@ components:
minimum: 0
example: 1
readOnly: true
ownerId:
title: Owner ID
description: The ID of the pet's owner.
type: integer
format: int32
minimum: 0
example: 1
readOnly: true
visits:
title: Visits
description: Vet visit bookings for this pet.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment