|
1 | 1 | package com.example.demo; |
2 | 2 |
|
3 | | -import io.swagger.annotations.Api; |
4 | | -import io.swagger.annotations.ApiModel; |
5 | | -import io.swagger.annotations.ApiOperation; |
6 | | -import io.swagger.annotations.ApiParam; |
7 | | -import org.springframework.data.domain.Page; |
| 3 | +import io.swagger.annotations.*; |
8 | 4 | import org.springframework.data.repository.PagingAndSortingRepository; |
9 | 5 | import org.springframework.data.repository.query.Param; |
10 | 6 | import org.springframework.data.rest.core.annotation.RepositoryRestResource; |
11 | | -import org.springframework.web.bind.annotation.RequestParam; |
12 | 7 |
|
13 | | -import java.awt.print.Pageable; |
14 | 8 | import java.util.List; |
15 | 9 |
|
16 | 10 | @Api(tags = "Address Entity") |
17 | 11 | @RepositoryRestResource(path = "addresses") |
18 | 12 | public interface AddressRepository extends PagingAndSortingRepository<Address, Long> { |
19 | 13 |
|
20 | | - @ApiOperation("find all Addresses that are associated with a given Customer") |
21 | | - List<Address> findByCustomerId(@Param("customerId") @RequestParam @ApiParam(name="customerId", value="ID of the customer") Long customerId); |
| 14 | + @ApiOperation("find all Addresses that are associated with a given Customer") |
| 15 | + List<Address> findByCustomerId(@Param("customerId") @ApiParam(name = "customerId", value = "ID of the customer", type = "body") Long customerId); |
22 | 16 |
|
23 | | - @Override |
24 | | - @SuppressWarnings("unchecked") |
25 | | - @ApiOperation("saves a new Address") |
26 | | - Address save(Address address); |
| 17 | + @Override |
| 18 | + @SuppressWarnings("unchecked") |
| 19 | + @ApiOperation("saves a new Address") |
| 20 | + @ApiResponses({@ApiResponse(code = 201, message = "Created", response = Address.class)}) |
| 21 | + Address save(Address address); |
27 | 22 |
|
28 | 23 | } |
0 commit comments