cherry_be/test/lesson.py

86 lines
2.4 KiB
Python

from urllib.request import quote, unquote
import base64
import json
def btoa(content):
"""
JSON转base64
"""
return base64.b64encode(quote(content).encode())
def atob(content):
"""
base64转JSON
"""
return unquote(base64.b64decode(content).decode())
print(atob("JTdCJTIyS0JMWCUyMiUzQSUyMjIlMjIlMkMlMjJDWExYJTIyJTNBJTIyMCUyMiUyQyUyMlhOWFElMjIlM0ElMjIyMDIwMiUyMiUyQyUyMkNYSUQlMjIlM0ElMjJkZDcwOWU3Ny0zNGY4LTQzZjctOGVmYS0wODM4ZmQxMzg0MzAlMjIlMkMlMjJDWFpDJTIyJTNBJTIyMCUyMiUyQyUyMkpYQkxYJTIyJTNBJTIyJTIyJTdE"))
"""
param = {
"pagingParam": {
"IsPaging": false,
"Offset": 0,
"Limit": 50,
"Orders": {
"PropertyParams": [
{
"Field": "ClassInfo.ProfessionInfoYear.NF",
"IsDesc": true
},
{
"Field": "ClassInfo.ProfessionInfoYear.Department.DWBH",
"IsDesc": false
},
{
"Field": "ClassInfo.ProfessionInfoYear.XNZYBH",
"IsDesc": false
},
{
"Field": "ClassInfo.BJBH",
"IsDesc": false
},
{
"Field": "XH",
"IsDesc": false
}
]
},
"Searchs": {
"PropertyParams": [
]
},
"Conditions": {
"PropertyParams": [
{
"Field": "ClassInfo.ProfessionInfoYear.NF",
"Value": "2019",
"Operation": 3,
"Logic": 0
},
{
"Field": "ClassInfo.ProfessionInfoYear.Department.BDDWXXID",
"Value": "3c438133-0ede-443f-8fb7-1a7a58c7e104",
"Operation": 3,
"Logic": 0
},
{
"Field": "ClassInfo.ProfessionInfoYear.BDZYXXNDID",
"Value": "d70fd0d5-7521-4a31-a068-70f484daa8ef",
"Operation": 3,
"Logic": 0
},
{
"Field": "ClassInfo.BDBJXXID",
"Value": "33eb5cf7-1688-44e6-bd09-fc08a2b3e8a5",
"Operation": 3,
"Logic": 0
}
]
}
}
}
"""