| 기능 | Method | URL | request | response | 상태코드 |
|---|---|---|---|---|---|
| 유저 등록(회원가입) | POST | /users | body: 유저생성 DTO | 생성 정보 | 201: 정상등록 400: 오류 |
| 유저 조회 | GET | /{id} | body: 유저수정 DTO | 조회 정보 | 200: 정상조회 406: 오류 |
| 유저목록 조회 | GET | /users | - | 목록 조회 정보 | 200: 정상조회 404: 오류 |
| 유저 삭제 | DELETE | /id} | - | - | 200: 정상삭제 |
유저 등록(회원 가입)
-
요청 정보
메소드 요청 URL POST /users -
예시
- 요청: POST /users
{ "name" : "홍길동", "email" : "a@b.com", "password" : 1234 }- 응답: HTTP/1.1 200 OK
{ "id" : 1, "name" : "홍길동", "email" : "a@b.com" }
유저 조회
-
요청 정보
메소드 요청 URL GET /users/{id} -
예시
-
요청: GET /users/1
-
응답: HTTP/1.1 200 OK
{ "id" : 1, "name" : "홍길동", "email" : "a@b.com" } -
유저 목록 조회
-
요청 정보
메소드 요청 URL GET /users -
예시
-
요청: GET /users
-
응답: HTTP/1.1 200 OK
[{ "id" : 1, "name" : "홍길동", "email" : "a@b.com" }, { "id" : 2, "name" : "김길동", "email" : "a@bc.com" }, { "id" : 3, "name" : "박길동", "email" : "a@bcd.com" } ] -
유저 삭제
-
요청 정보
메소드 요청 URL DELETE /users/{id} -
예시
- 요청: DELETE /users/1
- 응답: HTTP/1.1 200 OK
| 기능 | Method | URL | request | response | 상태코드 |
|---|---|---|---|---|---|
| 화폐 등록 | POST | /currencies | body: 화폐생성 DTO | 등록 정보 | 201: 정상등록 400: 오류 |
| 화폐 조회 | GET | /currencies/{id} | - | 단건 응답 정보 | 200: 정상조회 404: 오류 |
| 화폐 목록 조회 | GET | /currencies | - | 다건 응답 정보 | 200: 정상조회 400: 오류 |
화폐 등록
-
요청 정보
메소드 요청 URL POST /currencies -
예시
- 요청: POST /currencies
{ "currencyCode" : "USD", "exchangeRate" : "1430.00", "symbol" : "$" }- 응답: HTTP/1.1 201 Created
{ "id" : 1, "currencyCode" : "USD", "exchangeRate" : "1430.00", "symbol" : "$" }
화폐 조회
-
요청 정보
메소드 요청 URL GET /currencies/{id} -
예시
-
요청: GET /currencies/1
-
응답: HTTP/1.1 200 OK
{ "id" : 1, "currencyCode" : "USD", "exchangeRate" : "1430.00", "symbol" : "$" } -
화폐 목록 조회
- 요청 정보
메소드 요청 URL GET /currencies - 예시
-
요청: GET /currencies
-
응답: HTTP/1.1 200 OK
[{ "id" : 1, "currencyCode" : "USD", "exchangeRate" : "1430.00", "symbol" : "$" }, { "id" : 2, "currencyCode" : "JPY", "exchangeRate" : "9.19", "symbol" : "¥" }, { "id" : 3, "currencyCode" : "EUR", "exchangeRate" : "1474.38", "symbol" : " €" } ] -
| 기능 | Method | URL | request | response | 상태코드 |
|---|---|---|---|---|---|
| 환전 요청 | POST | /exchanges | body: 환전요청 DTO | 등록 정보 | 200: 정상등록 400: 오류 |
| 환전 정보 조회 | GET | /exchanges | - | 단건 응답 정보 | 200: 정상조회 404: 오류 |
| 환전 정보 토탈 조회 | GET | /exchanges/total | - | 단건 응답 정보 | 200: 정상조회 400: 오류 |
| 환전 정보 수정 | PATCH | /exchanges/{exchangeId} | - | - | 200: 정상조회 400: 오류 |
환전 요청
-
요청 정보
메소드 요청 URL POST /exchanges -
예시
- 요청: POST /exchanges
{ "currencyCode" : "USD", "money" : 10000 }- 응답: HTTP/1.1 200 OK
{ "name" : "홍길동", "currencyCode" : "USD", "beforeExchange" : 10000, "afterExchange" : 6.99, "status" : "NORMAL", "createdAt" : "2024-11-29:000000" }
환전 정보 조회
-
요청 정보
메소드 요청 URL GET /exchanges -
예시
-
요청: GET /exchanges
-
응답: HTTP/1.1 200 OK
[{ "name" : "홍길동", "currencyCode" : "USD", "beforeExchange" : 10000, "afterExchange" : 6.99, "createdAt" : "2024-11-29:000000" }, { "name" : "홍길동", "currencyCode" : "JPY", "beforeExchange" : 10000, "afterExchange" : 1088.13, "createdAt" : "2024-11-29:000000" }, { "name" : "홍길동", "currencyCode" : "EUR", "beforeExchange" : 10000, "afterExchange" : 6.78, "createdAt" : "2024-11-30:000000" } ] -
환전 정보 토탈 조회
- 요청 정보
메소드 요청 URL GET /exchanges/total - 예시
-
요청: GET /exchanges/total
-
응답: HTTP/1.1 200 OK
{ "totalCount" : 3, "totalSum" : 30000.00 } -
환전 정보 수정
- 요청 정보
메소드 요청 URL PATCH /exchanges/{exchangeId} - 예시
-
요청: PATCH /exchanges/1
-
응답: HTTP/1.1 200 OK
{ "id" : 1 } -
create table user (
id bigint not null auto_increment,
email varchar(255),
name varchar(255),
password varchar(255),
primary key (id)
) engine=InnoDB
create table currency (
exchange_rate decimal(38,2) not null,
id bigint not null auto_increment,
symbol varchar(255),
currency_code enum ('EUR','JPY','USD') not null,
primary key (id)
) engine=InnoDB
create table user_currency (
amount_after_exchange decimal(38,2) not null,
amount_in_krw decimal(38,2) not null,
created_at datetime(6),
id bigint not null auto_increment,
modified datetime(6),
to_currency_id bigint,
user_id bigint,
status enum ('CANCELLED','NORMAL') not null,
primary key (id)
) engine=InnoDB
