|
@@ -14,9 +14,7 @@ from PIL import Image
|
|
|
import base64, io
|
|
|
from random import randrange
|
|
|
import models
|
|
|
-import time
|
|
|
|
|
|
-time = time.ctime()
|
|
|
app = fastapi.FastAPI()
|
|
|
|
|
|
app.add_middleware(
|
|
@@ -286,15 +284,15 @@ async def nftdrops(userModel : models.NftDrops):
|
|
|
table3 = db['nftdrops']
|
|
|
|
|
|
# input對應
|
|
|
- userid = userModel.userid
|
|
|
- email = userModel.email
|
|
|
eventid = '1'
|
|
|
nftid = '101'
|
|
|
+ userid = userModel.userid
|
|
|
+ email = userModel.email
|
|
|
|
|
|
# 如果userid不在db, 寫入到一個空值nft
|
|
|
if not table3.find_one(userid=userid):
|
|
|
# 新增資料
|
|
|
- table3.insert(dict(eventid=eventid, nftid=nftid, userid=userid, email=email, time=time))
|
|
|
+ table3.insert(dict(eventid=eventid, nftid=nftid, userid=userid, email=email))
|
|
|
db.close()
|
|
|
return "新增成功"
|
|
|
# 如果userid存在,回傳通知
|