update
This commit is contained in:
parent
ef680757ee
commit
ef595f1e90
2
api.py
2
api.py
@ -1,11 +1,13 @@
|
|||||||
from flask import Flask
|
from flask import Flask
|
||||||
from flask_restful import Resource, Api
|
from flask_restful import Resource, Api
|
||||||
from flask_restful import reqparse
|
from flask_restful import reqparse
|
||||||
|
from flask_cors import CORS
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
from handler import *
|
from handler import *
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
CORS(app)
|
||||||
api = Api(app)
|
api = Api(app)
|
||||||
|
|
||||||
parser = reqparse.RequestParser()
|
parser = reqparse.RequestParser()
|
||||||
|
116
index.html
Normal file
116
index.html
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<!-- import CSS -->
|
||||||
|
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app">
|
||||||
|
<el-row v-loading="loading"
|
||||||
|
element-loading-text="拼命加载中"
|
||||||
|
element-loading-spinner="el-icon-loading"
|
||||||
|
>
|
||||||
|
|
||||||
|
<el-select v-model="game" placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<el-time-picker
|
||||||
|
is-range
|
||||||
|
v-model="date"
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="开始时间"
|
||||||
|
end-placeholder="结束时间"
|
||||||
|
placeholder="选择时间范围">
|
||||||
|
</el-time-picker>
|
||||||
|
<el-button icon="el-icon-search" circle @click="seach()"></el-button>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<h1>user</h1>
|
||||||
|
<el-row v-html="userTable">
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<h1>paylist</h1>
|
||||||
|
<el-row v-html="paylistTable">
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<h1>event</h1>
|
||||||
|
<el-row v-html="eventTable">
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
<!-- import Vue before Element -->
|
||||||
|
<script src="https://unpkg.com/vue/dist/vue.js"></script>
|
||||||
|
<!-- import JavaScript -->
|
||||||
|
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
|
||||||
|
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
|
||||||
|
new Vue({
|
||||||
|
el: '#app',
|
||||||
|
|
||||||
|
|
||||||
|
data: function () {
|
||||||
|
return {
|
||||||
|
options: [{
|
||||||
|
value: 'fengbaoqibing',
|
||||||
|
label: '风暴奇兵'
|
||||||
|
}, {
|
||||||
|
value: 'geshouccs',
|
||||||
|
label: '歌手ccs'
|
||||||
|
}, {
|
||||||
|
value: 'shenghuajiyuan',
|
||||||
|
label: '生化纪元'
|
||||||
|
}, {
|
||||||
|
value: 'xinyaoling',
|
||||||
|
label: '新妖灵'
|
||||||
|
}, {
|
||||||
|
value: 'zgzhanchui',
|
||||||
|
label: '中古战锤'
|
||||||
|
}],
|
||||||
|
loading: false,
|
||||||
|
game: '',
|
||||||
|
date: [new Date(), new Date()],
|
||||||
|
userTable: '',
|
||||||
|
paylistTable: '',
|
||||||
|
eventTable: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
seach: function () {
|
||||||
|
this.loading = true;
|
||||||
|
var game = this.game;
|
||||||
|
var st = Date.parse(this.date[0]) / 1000;
|
||||||
|
var et = Date.parse(this.date[1]) / 1000;
|
||||||
|
axios.get('http://10.0.0.107:5000/' + game, {params: {'st': st, 'et': et}})
|
||||||
|
.then(response => {
|
||||||
|
this.userTable = response.data['user'];
|
||||||
|
this.paylistTable = response.data['paylist'];
|
||||||
|
this.eventTable = response.data['event'];
|
||||||
|
this.loading = false;
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
alert('查询异常');
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
|
68
model.py
68
model.py
@ -41,6 +41,7 @@ class TBaseModel(BaseModel):
|
|||||||
'type_error.integer': '需要整数类型',
|
'type_error.integer': '需要整数类型',
|
||||||
'type_error.str': '需要字符串类型',
|
'type_error.str': '需要字符串类型',
|
||||||
'type_error.dict': '需要字典类型',
|
'type_error.dict': '需要字典类型',
|
||||||
|
'type_error.list': '需要列表类型',
|
||||||
'value_error.list.min_items': '最少需要{limit_value}项',
|
'value_error.list.min_items': '最少需要{limit_value}项',
|
||||||
'value_error.any_str.min_length': '最小需要{limit_value}个字符',
|
'value_error.any_str.min_length': '最小需要{limit_value}个字符',
|
||||||
'value_error.missing': '缺少该字段',
|
'value_error.missing': '缺少该字段',
|
||||||
@ -69,6 +70,7 @@ class GBaseModel(BaseModel):
|
|||||||
'type_error.integer': '需要整数类型',
|
'type_error.integer': '需要整数类型',
|
||||||
'type_error.str': '需要字符串类型',
|
'type_error.str': '需要字符串类型',
|
||||||
'type_error.dict': '需要字典类型',
|
'type_error.dict': '需要字典类型',
|
||||||
|
'type_error.list': '需要列表类型',
|
||||||
'value_error.list.min_items': '最少需要{limit_value}项',
|
'value_error.list.min_items': '最少需要{limit_value}项',
|
||||||
'value_error.any_str.min_length': '最小需要{limit_value}个字符',
|
'value_error.any_str.min_length': '最小需要{limit_value}个字符',
|
||||||
'value_error.missing': '缺少该字段',
|
'value_error.missing': '缺少该字段',
|
||||||
@ -92,16 +94,7 @@ class TUserModel(TBaseModel):
|
|||||||
role_number: StrictInt = Field(...)
|
role_number: StrictInt = Field(...)
|
||||||
role_yxb: StrictInt = Field(...)
|
role_yxb: StrictInt = Field(...)
|
||||||
|
|
||||||
class Config:
|
|
||||||
error_msg_templates = {
|
|
||||||
'type_error.integer': '需要整数类型',
|
|
||||||
'type_error.str': '需要字符串类型',
|
|
||||||
'type_error.dict': '需要字典类型',
|
|
||||||
'value_error.list.min_items': '最少需要{limit_value}项',
|
|
||||||
'value_error.any_str.min_length': '最小需要{limit_value}个字符',
|
|
||||||
'value_error.missing': '缺少该字段',
|
|
||||||
'type_error.enum': '需要{enum_values}'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class UserModel(GBaseModel):
|
class UserModel(GBaseModel):
|
||||||
@ -120,16 +113,7 @@ class UserModel(GBaseModel):
|
|||||||
role_number: int = Field(..., title="")
|
role_number: int = Field(..., title="")
|
||||||
role_yxb: int = Field(..., title="")
|
role_yxb: int = Field(..., title="")
|
||||||
|
|
||||||
class Config:
|
|
||||||
error_msg_templates = {
|
|
||||||
'type_error.integer': '需要整数类型',
|
|
||||||
'type_error.str': '需要字符串类型',
|
|
||||||
'type_error.dict': '需要字典类型',
|
|
||||||
'value_error.list.min_items': '最少需要{limit_value}项',
|
|
||||||
'value_error.any_str.min_length': '最小需要{limit_value}个字符',
|
|
||||||
'value_error.missing': '缺少该字段',
|
|
||||||
'type_error.enum': '需要{enum_values}'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class TPaylistModel(TBaseModel):
|
class TPaylistModel(TBaseModel):
|
||||||
@ -137,16 +121,7 @@ class TPaylistModel(TBaseModel):
|
|||||||
money: StrictInt = Field(...)
|
money: StrictInt = Field(...)
|
||||||
proid: StrictStr = Field(...)
|
proid: StrictStr = Field(...)
|
||||||
|
|
||||||
class Config:
|
|
||||||
error_msg_templates = {
|
|
||||||
'type_error.integer': '需要整数类型',
|
|
||||||
'type_error.str': '需要字符串类型',
|
|
||||||
'type_error.dict': '需要字典类型',
|
|
||||||
'value_error.list.min_items': '最少需要{limit_value}项',
|
|
||||||
'value_error.any_str.min_length': '最小需要{limit_value}个字符',
|
|
||||||
'value_error.missing': '缺少该字段',
|
|
||||||
'type_error.enum': '需要{enum_values}'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class PaylistModel(GBaseModel):
|
class PaylistModel(GBaseModel):
|
||||||
@ -154,16 +129,7 @@ class PaylistModel(GBaseModel):
|
|||||||
money: int = Field(..., gt=0)
|
money: int = Field(..., gt=0)
|
||||||
proid: str = Field(..., min_length=1)
|
proid: str = Field(..., min_length=1)
|
||||||
|
|
||||||
class Config:
|
|
||||||
error_msg_templates = {
|
|
||||||
'type_error.integer': '需要整数类型',
|
|
||||||
'type_error.str': '需要字符串类型',
|
|
||||||
'type_error.dict': '需要字典类型',
|
|
||||||
'value_error.list.min_items': '最少需要{limit_value}项',
|
|
||||||
'value_error.any_str.min_length': '最小需要{limit_value}个字符',
|
|
||||||
'value_error.missing': '缺少该字段',
|
|
||||||
'type_error.enum': '需要{enum_values}'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class TEventModel(TBaseModel):
|
class TEventModel(TBaseModel):
|
||||||
@ -175,16 +141,7 @@ class TEventModel(TBaseModel):
|
|||||||
need: List[Dict] = Field(None, alias='_game_version')
|
need: List[Dict] = Field(None, alias='_game_version')
|
||||||
prize: List[Dict] = Field(None, alias='_game_version')
|
prize: List[Dict] = Field(None, alias='_game_version')
|
||||||
|
|
||||||
class Config:
|
|
||||||
error_msg_templates = {
|
|
||||||
'type_error.integer': '需要整数类型',
|
|
||||||
'type_error.str': '需要字符串类型',
|
|
||||||
'type_error.dict': '需要字典类型',
|
|
||||||
'value_error.list.min_items': '最少需要{limit_value}项',
|
|
||||||
'value_error.any_str.min_length': '最小需要{limit_value}个字符',
|
|
||||||
'value_error.missing': '缺少该字段',
|
|
||||||
'type_error.enum': '需要{enum_values}'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class EventModel(GBaseModel):
|
class EventModel(GBaseModel):
|
||||||
@ -196,16 +153,7 @@ class EventModel(GBaseModel):
|
|||||||
need: List[Dict] = Field(None, min_items=1)
|
need: List[Dict] = Field(None, min_items=1)
|
||||||
prize: List[Dict] = Field(None, min_items=1)
|
prize: List[Dict] = Field(None, min_items=1)
|
||||||
|
|
||||||
class Config:
|
|
||||||
error_msg_templates = {
|
|
||||||
'type_error.integer': '需要整数类型',
|
|
||||||
'type_error.str': '需要字符串类型',
|
|
||||||
'type_error.dict': '需要字典类型',
|
|
||||||
'value_error.list.min_items': '最少需要{limit_value}项',
|
|
||||||
'value_error.any_str.min_length': '最小需要{limit_value}个字符',
|
|
||||||
'value_error.missing': '缺少该字段',
|
|
||||||
'type_error.enum': '需要{enum_values}'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# a = """_game_role_id 角色id str >0
|
# a = """_game_role_id 角色id str >0
|
||||||
|
Loading…
Reference in New Issue
Block a user