Files
boc/landvex-paket/bounties/__pycache__/main.cpython-39.pyc
T

32 lines
3.2 KiB
Plaintext
Raw Normal View History

a
± Mj$
ã@sddlmZmZddlmZddlmZddlmZddlZddl Z eddZ
e j   e j  
e¡dd ¡Zd
d Zd d
ZGdddeƒZGdddeƒZe
 d¡ddƒZe
jdededœddƒZe
jdededœddƒZe
jdededœddƒZdS) é)ÚFastAPIÚ
HTTPException)Ú BaseModel)Údatetime)ÚOptionalNzLandveX Bounties)Útitlez..z
landvex.dbcCst t¡}tj|_|S©N)Úsqlite3ÚconnectÚDB_PATHZRowZ row_factory©Úconn©rú>/home/bernt/.openclaw/workspace/landvex-paket/bounties/main.pyÚget_db
s
rcCs$tƒ}| d¡| ¡| ¡dS)NaH
CREATE TABLE IF NOT EXISTS bounties (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT NOT NULL,
description TEXT,
reward REAL,
status TEXT DEFAULT 'open',
created_at TEXT DEFAULT CURRENT_TIMESTAMP,
submitted_at TEXT
)
)rÚexecuteÚcommitÚcloser rrrÚinit_dbs ÿ
rc@s.eZdZUeed<dZeed<dZeed<dS)Ú BountyCreaterÚÚ descriptiongÚrewardN)Ú__name__Ú
__module__Ú __qualname__ÚstrÚ__annotations__rrÚfloatrrrrr&s
 rc@sXeZdZUeed<eed<eed<eed<eed<eed<eeed<Gdd „d ƒZd
S) Ú BountyOutÚidrrrÚstatusZ
created_atZ submitted_atc@seZdZdZdS)zBountyOut.ConfigTN)rrrZfrom_attributesrrrrÚConfig5sr"N) rrrÚintrrrrr"rrrrr,s
 rÚstartupcCs
tƒdSr)rrrrrr$9sz /v0/bounties)Zresponse_model)ÚbountycCsNtƒ}| d|j|j|jf¡}|j}| ¡| d|f¡ ¡}| ¡t |ƒS)NzBINSERT INTO bounties (title, description, reward) VALUES (?, ?, ?)ú#SELECT * FROM bounties WHERE id = ?)