commit
6c8089ed8e
5 changed files with 293 additions and 0 deletions
@ -0,0 +1,188 @@
@@ -0,0 +1,188 @@
|
||||
|
||||
# Created by https://www.gitignore.io/api/venv,python,pycharm |
||||
|
||||
### PyCharm ### |
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm |
||||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 |
||||
|
||||
# User-specific stuff: |
||||
.idea/ |
||||
.idea/**/workspace.xml |
||||
.idea/**/tasks.xml |
||||
.idea/dictionaries |
||||
|
||||
# Sensitive or high-churn files: |
||||
.idea/**/dataSources/ |
||||
.idea/**/dataSources.ids |
||||
.idea/**/dataSources.xml |
||||
.idea/**/dataSources.local.xml |
||||
.idea/**/sqlDataSources.xml |
||||
.idea/**/dynamic.xml |
||||
.idea/**/uiDesigner.xml |
||||
|
||||
# Gradle: |
||||
.idea/**/gradle.xml |
||||
.idea/**/libraries |
||||
|
||||
# CMake |
||||
cmake-build-debug/ |
||||
|
||||
# Mongo Explorer plugin: |
||||
.idea/**/mongoSettings.xml |
||||
|
||||
## File-based project format: |
||||
*.iws |
||||
|
||||
## Plugin-specific files: |
||||
|
||||
# IntelliJ |
||||
/out/ |
||||
|
||||
# mpeltonen/sbt-idea plugin |
||||
.idea_modules/ |
||||
|
||||
# JIRA plugin |
||||
atlassian-ide-plugin.xml |
||||
|
||||
# Cursive Clojure plugin |
||||
.idea/replstate.xml |
||||
|
||||
# Ruby plugin and RubyMine |
||||
/.rakeTasks |
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ) |
||||
com_crashlytics_export_strings.xml |
||||
crashlytics.properties |
||||
crashlytics-build.properties |
||||
fabric.properties |
||||
|
||||
### PyCharm Patch ### |
||||
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 |
||||
|
||||
# *.iml |
||||
# modules.xml |
||||
# .idea/misc.xml |
||||
# *.ipr |
||||
|
||||
# Sonarlint plugin |
||||
.idea/sonarlint |
||||
|
||||
### Python ### |
||||
# Byte-compiled / optimized / DLL files |
||||
__pycache__/ |
||||
*.py[cod] |
||||
*$py.class |
||||
|
||||
# C extensions |
||||
*.so |
||||
|
||||
# Distribution / packaging |
||||
.Python |
||||
build/ |
||||
develop-eggs/ |
||||
dist/ |
||||
downloads/ |
||||
eggs/ |
||||
.eggs/ |
||||
lib/ |
||||
lib64/ |
||||
parts/ |
||||
sdist/ |
||||
var/ |
||||
wheels/ |
||||
*.egg-info/ |
||||
.installed.cfg |
||||
*.egg |
||||
|
||||
# PyInstaller |
||||
# Usually these files are written by a python script from a template |
||||
# before PyInstaller builds the exe, so as to inject date/other infos into it. |
||||
*.manifest |
||||
*.spec |
||||
|
||||
# Installer logs |
||||
pip-log.txt |
||||
pip-delete-this-directory.txt |
||||
|
||||
# Unit test / coverage reports |
||||
htmlcov/ |
||||
.tox/ |
||||
.coverage |
||||
.coverage.* |
||||
.cache |
||||
nosetests.xml |
||||
coverage.xml |
||||
*.cover |
||||
.hypothesis/ |
||||
|
||||
# Translations |
||||
*.mo |
||||
*.pot |
||||
|
||||
# Django stuff: |
||||
*.log |
||||
local_settings.py |
||||
|
||||
# Flask stuff: |
||||
instance/ |
||||
.webassets-cache |
||||
|
||||
# Scrapy stuff: |
||||
.scrapy |
||||
|
||||
# Sphinx documentation |
||||
docs/_build/ |
||||
|
||||
# PyBuilder |
||||
target/ |
||||
|
||||
# Jupyter Notebook |
||||
.ipynb_checkpoints |
||||
|
||||
# pyenv |
||||
.python-version |
||||
|
||||
# celery beat schedule file |
||||
celerybeat-schedule.* |
||||
|
||||
# SageMath parsed files |
||||
*.sage.py |
||||
|
||||
# Environments |
||||
.env |
||||
.venv |
||||
env/ |
||||
venv/ |
||||
ENV/ |
||||
env.bak/ |
||||
venv.bak/ |
||||
|
||||
# Spyder project settings |
||||
.spyderproject |
||||
.spyproject |
||||
|
||||
# Rope project settings |
||||
.ropeproject |
||||
|
||||
# mkdocs documentation |
||||
/site |
||||
|
||||
# mypy |
||||
.mypy_cache/ |
||||
|
||||
### venv ### |
||||
# Linux |
||||
bin/ |
||||
include/ |
||||
|
||||
# Window |
||||
Include/ |
||||
Lib/ |
||||
Scripts/ |
||||
|
||||
# Shared |
||||
pyvenv.cfg |
||||
|
||||
|
||||
|
||||
# End of https://www.gitignore.io/api/venv,python,pycharm |
||||
@ -0,0 +1,33 @@
@@ -0,0 +1,33 @@
|
||||
## 接口 |
||||
| 接口名 | 请求方法 | 参数 | 备注 | |
||||
| --------------- | -------- | ---------------------------------- | -------------------------------- | |
||||
| /index | GET | | | |
||||
| /update | POST | [{"name":string, "awards_id":int}] | 提交中奖用户 | |
||||
| /revoke | POST | {"uid":string} | 取消用户中奖信息,uid为工号,例如G0001 | |
||||
| /lucky_users | GET/POST | {"awards_id":int} | 获取所有中奖用户列表,使用post方式获取指定奖项的中奖用户列表 | |
||||
| /users | GET | | 获取所有用户列表 | |
||||
| /luckless_users | GET | | 获取未中奖用户列表 | |
||||
| /awards | GET | | 获取所有奖项列表 | |
||||
| /reset | GET | | 重置所有数据 | |
||||
|
||||
--- |
||||
|
||||
## 数据库表-leaders |
||||
|
||||
| 字段值 | 字段类型 | 字段描述 | |
||||
| -------- | ------ | ------------------------------ | |
||||
| uid | string | 工号,例如:G0001 | |
||||
| name | string | 姓名 | |
||||
| award_id | int | 奖项id | |
||||
| role | int | 角色值,0:实习生,1:正式员工,2:管理层,3:大boss | |
||||
|
||||
|
||||
## 数据库表-awards |
||||
|
||||
| 字段值 | 字段类型 | 字段描述 | |
||||
| -------------- | ------ | ------- | |
||||
| award_id | int | 奖项id | |
||||
| award_name | string | 奖项名称 | |
||||
| award_size | int | 可抽取奖项数量 | |
||||
| award_capacity | int | 奖项总数 | |
||||
|
||||
@ -0,0 +1,5 @@
@@ -0,0 +1,5 @@
|
||||
#! /usr/bin/python3 |
||||
# -*- coding:utf-8 -*- |
||||
from src import main |
||||
|
||||
main.run('localhost', 8080, True) |
||||
@ -0,0 +1,4 @@
@@ -0,0 +1,4 @@
|
||||
#! /usr/bin/python3 |
||||
# -*- coding:utf-8 -*- |
||||
import os |
||||
CURRENT_DIR = os.path.abspath(os.path.dirname(__file__)) |
||||
@ -0,0 +1,63 @@
@@ -0,0 +1,63 @@
|
||||
#! /usr/bin/python3 |
||||
# -*- coding:utf-8 -*- |
||||
import bottle as b |
||||
import os |
||||
from . import CURRENT_DIR |
||||
|
||||
app = b.Bottle() |
||||
|
||||
|
||||
@app.route('/') |
||||
def index(): |
||||
return b.static_file('index.html', os.path.join(CURRENT_DIR, "templates")) |
||||
|
||||
|
||||
@app.route('/update', method='POST') |
||||
def update(): |
||||
b.abort(403, "禁止修改中奖用户名单") |
||||
|
||||
|
||||
@app.route('/revoke', method='POST') |
||||
def revoke(): |
||||
pass |
||||
|
||||
|
||||
@app.route('/users') |
||||
def users(): |
||||
pass |
||||
|
||||
|
||||
@app.route('/lucky_users') |
||||
def lucky_users(): |
||||
if b.request.method == 'POST': |
||||
pass |
||||
else: |
||||
pass |
||||
|
||||
|
||||
@app.route('/luckless_users') |
||||
def luckless_users(): |
||||
pass |
||||
|
||||
|
||||
@app.route('/awards') |
||||
def awards(): |
||||
pass |
||||
|
||||
|
||||
@app.route('/reset') |
||||
def reset(): |
||||
pass |
||||
|
||||
|
||||
@app.route('/static/<filepath:path>') |
||||
def callback(filepath): |
||||
return b.static_file(filepath, os.path.join(CURRENT_DIR, "static")) |
||||
|
||||
|
||||
def run(host, port, debug): |
||||
app.run(host=host, port=port, debug=debug) |
||||
|
||||
|
||||
if __name__ == '__main__': |
||||
run('localhost', 8080, True) |
||||
Loading…
Reference in new issue