field_edit.py
1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#author: 4N
#createtime: 2021/1/27
#email: nheweijun@sina.com
from app.models import Columns
import datetime
from app.models import db
from app.util.component.ApiTemplate import ApiTemplate
class Api(ApiTemplate):
api_name = "修改属性"
def process(self):
#返回结果
res={}
column_guid = self.para.get("column_guid")
try:
Columns.query.filter_by(guid = column_guid).update({"alias":self.para.get("column_alias"),"update_time":datetime.datetime.now()})
db.session.commit()
res["result"] = True
res["msg"] = "属性别名修改成功!"
except Exception as e:
raise e
return res
api_doc={
"tags":["管理接口"],
"parameters":[
{"name": "column_guid",
"in": "formData",
"type": "string",
"description": "属性guid","required":"true"},
{"name": "column_alias",
"in": "formData",
"type": "string",
"description": "属性别名","required":"true"},
],
"responses":{
200:{
"schema":{
"properties":{
}
}
}
}
}