-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: stock_evaluate 요청 및 응답 형식 변경
- Loading branch information
1 parent
540cc13
commit 561aed8
Showing
2 changed files
with
8 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
from array import array | ||
from typing import List, Dict, Any | ||
from typing import Any | ||
|
||
|
||
class Output: | ||
def __init__(self, product_number, name, percentage): | ||
def __init__(self, product_number, name, quantity): | ||
self.product_number = product_number | ||
self.name = name | ||
self.percentage = percentage | ||
self.quantity = quantity | ||
|
||
def to_dict(self): | ||
return { | ||
'productNumber': self.product_number, | ||
'name': self.name, | ||
"percentage": self.percentage, | ||
"quantity": self.quantity, | ||
} | ||
|
||
|
||
# 요청된 주식 목록에 따라 각 주식의 구매 비율을 리턴하는 메서드 | ||
def get_stock_order_ratio(stocks) -> list[dict[str, Any]]: | ||
print(stocks) | ||
|
||
outputs = [] | ||
output = Output("삼성전자", "000000", 0.1) | ||
output = Output("005930", "삼성전자", 1) | ||
outputs.append(output.to_dict()) | ||
|
||
return outputs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters