Files
param-hub-python/modules/routes/__pycache__/api_pin.cpython-310.pyc
T

23 lines
2.7 KiB
Plaintext
Raw Normal View History

2026-07-10 23:59:53 +08:00
o
¿Qj ã@sdZddlmZmZmZddlmZmZmZm Z ddl
m Z m Z ede
ƒZddZdd „Zejd
d gd d
dƒZejdd gd ddƒZejdd gd ddƒZejdd gd ddƒZejdd gd ddƒZejdd gd ddƒZejdd gd dd „ƒZejd!d gd d"d#„ƒZd$S)%u
置顶和热度 API
é)Ú BlueprintÚrequestÚjsonify)Ú MODELS_FILEÚ GPUS_FILEÚ CPUS_FILEÚDATA_DIR)Ú load_dataÚ save_dataÚapi_pincsht|ƒ}tfdd|Dƒdƒ}|std|diƒdfS| dd¡ |d<t||ƒtd|dd œƒS)
Nc3ó |] }|dˆkr|VqdS©ÚidN©©Ú.0ÚÚitem_idrú_/home/openclaw/.openclaw/workspace-hz4th_coder/works/param-hub-python/modules/routes/api_pin.pyÚ <genexpr>
óz_toggle_pin.<locals>.<genexpr>Úerrorú
not foundé”Ú is_pinnedFT)Úsuccessr©r ÚnextrÚgetr
©Ú file_pathrÚ entity_nameÚitemsÚitemrrrÚ _toggle_pin s
r%csjt|ƒ}tfdd|Dƒdƒ}|std|diƒdfS| dd¡d|d<t||ƒtd |dd
œƒS) Nc3r r
rrrrrrrz_add_view.<locals>.<genexpr>rrrÚviewsréT)rr&rr rrrÚ _add_views
r(z/api/models/<model_id>/pinÚPOST)ÚmethodscCó tt|dƒS©Model)r%r©Úmodel_idrrrÚapi_toggle_model_pin ó r0z/api/gpus/<gpu_id>/pincCr+©GPU)r%r©Úgpu_idrrrÚapi_toggle_gpu_pin$r1r6z/api/cpus/<cpu_id>/pincCr+©CPU)r%r©Úcpu_idrrrÚapi_toggle_cpu_pin(r1r;z&/api/items/<category_id>/<item_id>/pincCótd|d}t||dƒS©items_z.jsonÚItem)rr%©Ú category_idrÚ
items_filerrrÚapi_toggle_item_pin,ó rCz/api/models/<model_id>/viewcCr+r,)r(rr.rrrÚapi_model_view3r1rEz/api/gpus/<gpu_id>/viewcCr+r2)r(rr4rrrÚ api_gpu_view7r1rFz/api/cpus/<cpu_id>/viewcCr+r7)r(rr9rrrÚ api_cpu_view;r1rGz'/api/items/<category_id>/<item_id>/viewcCr<r=)rr(r@rrrÚ
api_item_view?rDrHN)Ú__doc__ÚflaskrrrÚconfigrrrrÚutilsr r
Ú__name__Úpin_bpr%r(Úrouter0r6r;rCrErFrGrHrrrrÚ<module>s.