바우처 전체 조회
GET /api/v1/vouchers
/api/v1/vouchers
GET http://localhost:8080/api/v1/vouchers Accept: application/xml
<list> <com.example.voucherproject.voucher.model.Voucher> <id>fc001d5f-e17b-4a2a-a08e-fde0ee5b922d</id> <type>FIXED</type> <amount>1000</amount> <createdAt>2022-04-24T19:48:11.311</createdAt> </com.example.voucherproject.voucher.model.Voucher> <com.example.voucherproject.voucher.model.Voucher> <id>773e8c02-ec0c-4a2f-886d-799bf8c1a85a</id> <type>FIXED</type> <amount>42</amount> <createdAt>2022-04-28T20:23:52.229</createdAt> </com.example.voucherproject.voucher.model.Voucher> </list>
GET http://localhost:8080/api/v1/vouchers Accept: application/json
[ { "id": "fc001d5f-e17b-4a2a-a08e-fde0ee5b922d", "type": "FIXED", "amount": 1000, "createdAt": "2022-04-24T19:48:11.311", "updatedAt": null }, { "id": "773e8c02-ec0c-4a2f-886d-799bf8c1a85a", "type": "FIXED", "amount": 42, "createdAt": "2022-04-28T20:23:52.229", "updatedAt": null } ]
바우처 추가
POST /api/v1/voucher
/api/v1/voucher
POST http://localhost:8080/api/v1/voucher Accept: application/json Content-Type: application/json { "type": "PERCENT", "amount": 5 }
{ "id": "22fe64d4-3ec9-48ea-b76a-87789bc08a84", "type": "PERCENT", "amount": 5, "createdAt": "2022-04-29T08:50:14.266", "updatedAt": "2022-04-29T08:50:14.266" }
POST http://localhost:8080/api/v1/voucher Accept: application/xml Content-Type: application/json { "type": "PERCENT", "amount": 7 }
<com.example.voucherproject.voucher.model.Voucher> <id>302a6066-e1dc-46f2-a558-4c81175825ca</id> <type>PERCENT</type> <amount>7</amount> <createdAt>2022-04-29T08:50:55.456</createdAt> <updatedAt>2022-04-29T08:50:55.456</updatedAt> </com.example.voucherproject.voucher.model.Voucher>
바우처 상세 조회
GET /api/v1/voucher/{id}
/api/v1/voucher/{id}
GET http://localhost:8080/api/v1/voucher/302a6066-e1dc-46f2-a558-4c81175825ca Accept: application/json
{ "id": "302a6066-e1dc-46f2-a558-4c81175825ca", "type": "PERCENT", "amount": 7, "createdAt": "2022-04-29T08:50:55.456", "updatedAt": null }
바우처 조건별 조회
POST /api/v1/voucher/query
/api/v1/voucher/query
POST http://localhost:8080/api/v1/voucher/query Accept: application/json Content-Type: application/json { "type": "FIXED", "from": "2022-04-11" }
[ { "id": "30554b40-3276-403f-8c04-b897cc3b8319", "type": "FIXED", "amount": 1222, "createdAt": "2022-04-28T15:46:27.485", "updatedAt": null }, { "id": "4272f4d2-2002-4017-8909-94e611eb0053", "type": "FIXED", "amount": 50, "createdAt": "2022-04-28T17:31:08.017", "updatedAt": null }, { "id": "4841a132-d73b-4086-b863-28d5f58be330", "type": "FIXED", "amount": 1209, "createdAt": "2022-04-28T17:52:55.163", "updatedAt": null }, { "id": "6f673a61-c438-4c2d-a71d-3b9faceedf08", "type": "FIXED", "amount": 222, "createdAt": "2022-04-28T13:52:30.581", "updatedAt": null }, { "id": "773e8c02-ec0c-4a2f-886d-799bf8c1a85a", "type": "FIXED", "amount": 42, "createdAt": "2022-04-28T20:23:52.229", "updatedAt": null }, { "id": "fc001d5f-e17b-4a2a-a08e-fde0ee5b922d", "type": "FIXED", "amount": 1000, "createdAt": "2022-04-24T19:48:11.311", "updatedAt": null }
바우처 삭제
DELETE /api/v1/voucher/{id}
/api/v1/voucher/{id}
DELETE http://localhost:8080/api/v1/voucher/ee0b4ffa-433e-4ab9-ac72-08c6811d0cea
HTTP/1.1 200 Content-Length: 0 Date: Fri, 29 Apr 2022 00:19:27 GMT Keep-Alive: timeout=60 Connection: keep-alive <Response body is empty>