新增小程序后端代码,包括数据库、路由、服务层等。
小程序前后端打通,包括登录、注册、绑定设备、查询绑定信息,修改小朋友名称等功能。
This commit is contained in:
13
mini-program/app/dao/__init__.py
Normal file
13
mini-program/app/dao/__init__.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from sqlalchemy import text
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
|
||||
class BaseDAO:
|
||||
def __init__(self, db: Session):
|
||||
self.db = db
|
||||
|
||||
def execute(self, query, params: dict = None):
|
||||
return self.db.execute(text(query), params or {})
|
||||
|
||||
def commit(self):
|
||||
self.db.commit()
|
||||
Reference in New Issue
Block a user