cherry_be/coc.py
2020-02-14 15:55:08 +08:00

54 lines
1.3 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 引入文件夹中的文件
import sys
sys.path.append('./lib')
from allFunction import manageLogin, managePhoto, manageAdd, manageDel, manageGet, manageDetail, manageComment
from flask import Flask, request, session
app = Flask(__name__)
# 登录接口前端提供cid和pwd包装在data里边然后md5校验也就是data:{cid,pwd,sign}
@app.route('/api/login',methods=['POST'])
def login():
res = manageLogin(request)
return res
# 上传图片
@app.route('/api/photo/upload', methods=['PUT'], strict_slashes=False)
def upload_photo():
res = managePhoto(request)
return res
# 新增失物招领信息
@app.route('/api/laf/add',methods=['POST'])
def laf_add():
res = manageAdd(request)
return res
# 删除失物招领信息
@app.route('/api/laf/del',methods=['POST'])
def laf_del():
res = manageDel(request)
return res
# 获取全部失物招领信息
@app.route('/api/laf/get',methods=['POST'])
def laf_get():
res = manageGet()
return res
# 获取指定失物招领信息
@app.route('/api/laf/detail',methods=['POST'])
def laf_detail():
res = manageDetail(request)
return res
# 新增评论
@app.route('/api/laf/comment',methods=['POST'])
def laf_comment():
res = manageComment(request)
return res
if __name__ == '__main__':
app.debug = True
app.run()