代码拉取完成,页面将自动刷新
from flask import Blueprint, request
import json
from deco import *
from res import *
import oppressor as OP
Student = Blueprint('student', __name__)
@Student.route('/student/volbook/<int:stuId>', methods = ['GET'])
@Deco
def getVolunteerWork(stuId, json_data, token_data):
fl,r=OP.select("volId,volTimeInside,volTimeOutside,volTimeLarge,status","stu_vol","stuId=%s", stuId,
["volId","inside","outside","large","status"],only=False)
if not fl:
if "message" in r and r["message"]==OP.OP_NOT_FOUND:
return {"type":"ERROR","message":"该学生没有义工记录"}
return r
for i in r:
ff,rr=OP.select("volName","volunteer","volId=%s",i["volId"], ["name"])
if not ff: return rr
i.update({"name": rr["name"]})
return {"type":"SUCCESS","message":"获取成功","rec":r}
@Student.route('/student/volcert/', methods = ['POST'])
@Deco
def getVolunteerCertification(json_data, token_data):
stuId,volId=json_data["stuId"],json_data["volId"]
f1,r1=OP.select(
"stuId,volTimeInside,volTimeOutside,volTimeLarge,status,thought",
"stu_vol","stuId=%s AND volId=%s",(stuId,volId),
["id","inside","outside","large","status","thought"],only=True
)
if not f1: return r1
f2,r2=OP.select(
"volId,volName,description,volTime,volDate,volTimeInside,volTimeOutside,volTimeLarge",
"volunteer","volId=%s",volId,
["id","name","description","time","date","inside","outside","large"],only=True
)
if not f2: return r2
return {"type":"SUCCESS","message":"获取成功","stu":r1,"vol":r2}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。