From 5ae3a3a814fa9ce8dca9fd919658b80e903e8b35 Mon Sep 17 00:00:00 2001 From: Bigsk Date: Sun, 27 Feb 2022 15:35:44 +0800 Subject: [PATCH] Document Backup Update --- document/front_design/README.md | 68 +++++++++++++++++++++ gesong/__init__.py | 10 +++ gesong/__main__.py | 45 ++++++++++++++ gesong/__pycache__/__init__.cpython-38.pyc | Bin 0 -> 431 bytes gesong/__pycache__/__main__.cpython-38.pyc | Bin 0 -> 1216 bytes gesong/__pycache__/route.cpython-38.pyc | Bin 0 -> 708 bytes gesong/__pycache__/test.cpython-38.pyc | Bin 0 -> 320 bytes gesong/admin/__init__.py | 0 gesong/admin/access.py | 0 gesong/admin/audit.py | 0 gesong/admin/list.py | 0 gesong/admin/system.py | 0 gesong/database.py | 0 gesong/page/__init__.py | 0 gesong/page/back/access.py | 0 gesong/page/back/audit.py | 0 gesong/page/back/list.py | 0 gesong/page/back/system.py | 0 gesong/page/front/confirm.py | 0 gesong/page/front/history.py | 0 gesong/page/front/index.py | 0 gesong/page/front/list.py | 0 gesong/page/front/search.py | 0 gesong/route.py | 22 +++++++ gesong/song/__init__.py | 0 gesong/song/cache.py | 0 gesong/song/detail.py | 0 gesong/song/history.py | 0 gesong/song/sdks/netease/.keep | 0 gesong/song/sdks/tencent_cloud/.keep | 0 gesong/song/search.py | 0 gesong/user/__init__.py | 0 gesong/user/oauth/ghink.py | 0 gesong/user/oauth/sdks/ghink/.keep | 0 34 files changed, 145 insertions(+) create mode 100644 document/front_design/README.md create mode 100644 gesong/__init__.py create mode 100644 gesong/__main__.py create mode 100644 gesong/__pycache__/__init__.cpython-38.pyc create mode 100644 gesong/__pycache__/__main__.cpython-38.pyc create mode 100644 gesong/__pycache__/route.cpython-38.pyc create mode 100644 gesong/__pycache__/test.cpython-38.pyc create mode 100644 gesong/admin/__init__.py create mode 100644 gesong/admin/access.py create mode 100644 gesong/admin/audit.py create mode 100644 gesong/admin/list.py create mode 100644 gesong/admin/system.py create mode 100644 gesong/database.py create mode 100644 gesong/page/__init__.py create mode 100644 gesong/page/back/access.py create mode 100644 gesong/page/back/audit.py create mode 100644 gesong/page/back/list.py create mode 100644 gesong/page/back/system.py create mode 100644 gesong/page/front/confirm.py create mode 100644 gesong/page/front/history.py create mode 100644 gesong/page/front/index.py create mode 100644 gesong/page/front/list.py create mode 100644 gesong/page/front/search.py create mode 100644 gesong/route.py create mode 100644 gesong/song/__init__.py create mode 100644 gesong/song/cache.py create mode 100644 gesong/song/detail.py create mode 100644 gesong/song/history.py create mode 100644 gesong/song/sdks/netease/.keep create mode 100644 gesong/song/sdks/tencent_cloud/.keep create mode 100644 gesong/song/search.py create mode 100644 gesong/user/__init__.py create mode 100644 gesong/user/oauth/ghink.py create mode 100644 gesong/user/oauth/sdks/ghink/.keep diff --git a/document/front_design/README.md b/document/front_design/README.md new file mode 100644 index 0000000..e07db3f --- /dev/null +++ b/document/front_design/README.md @@ -0,0 +1,68 @@ +# Front Design For GeSong System + +## Content +### Before +### Front(User) +#### 1. Index Page +#### 2. Search Page +#### 3. History Page +#### 4. List Page +#### 5. Confirm Page +### Back(Admin) +#### 1. Access Page +#### 2. Audit Page +#### 3. List Page +#### 4. System Page + +## Before +#### All template use WebApi to deal the operate +#### Recommand Vue.js, but you still can use jQuery(Ajax) :D +#### All Response Code (Int) +##### `10000` `Success` + +## Front(User) + +### Index Page +#### The index page use the root path ("/"), +#### Server will response a 301 code to jump to search page ("/search") + +### Search Page +#### The search page use the path "/search" +#### A user have to log in to use the search function +#### WebApi Interface Detail: +##### Path: `/api/search` +##### Method: `POST` +##### Args: +###### `keyword` `string` `keyword of the song` +###### `token` `string` `user token` +##### Response Format: `Json` +##### Json Args: +###### `code` `int` `response code` +###### `content` `list` `list of songs` +##### List of Songs Args(content): +###### `pid` `int` `platform id` +###### `id` `int` `song id(platform)` +###### `name` `string` `name of song` +###### `artists` `list` `list of artists` +###### `album` `dict` `album of this song` +###### `url` `string` `the media url of this song` +##### List of Artists Args: +###### `id` `int` `artist id(platform)` +###### `name` `string` `name of this artist` +###### `cover` `string` `image url of this aritist` +##### Album Args: +###### `id` `int` `album id(platform)` +###### `name` `string` `name of this album` +###### `cover` `string` `image url of this album` + +### History Page +#### The history page use the path "/history" +#### Anybody can directly get history of songs +#### WebApi Interface Detail: +##### Path: `/api/history` +##### Method: `GET` +##### Args: `Nothing` +##### Response Format: `Json` +##### Json Args: +###### `code` `int` `response code` +###### `content` `list` `list of history songs` \ No newline at end of file diff --git a/gesong/__init__.py b/gesong/__init__.py new file mode 100644 index 0000000..4c65a2b --- /dev/null +++ b/gesong/__init__.py @@ -0,0 +1,10 @@ +''' + Copyright Ghink Network Studio © 2014 + MIT Fengming High School Techy Group & Radio Station + Website: https://www.ghink.net, https://radio.fmhs.club, https://techy.fmhs.club + Main Program by Bigsk (https://www.xiaxinzhe.cn) +''' + +from flask import Flask + +APP = Flask("GeSong System") \ No newline at end of file diff --git a/gesong/__main__.py b/gesong/__main__.py new file mode 100644 index 0000000..cffd237 --- /dev/null +++ b/gesong/__main__.py @@ -0,0 +1,45 @@ +''' + Copyright Ghink Network Studio © 2014 + MIT Fengming High School Techy Group & Radio Station + Website: https://www.ghink.net, https://radio.fmhs.club, https://techy.fmhs.club + Main Program by Bigsk (https://www.xiaxinzhe.cn) +''' + +from __init__ import * + +import route + +import os, json +from threading import Thread +from flask import Flask +from urllib.request import urlopen + +# Define network check function +def network(source = r"http://www.baidu.com", retry = 3): + flag = False + for _ in range(retry): + try: + fp = urlopen(source) + fp.read(100).decode() + fp.close() + except: + pass + else: + flag = True + return flag +# Define json check function +def check_json(content): + try: + json.loads(content) + except: + return False + else: + return True + finally: + return False +# Define main function +def main(): + APP.run("127.0.0.1", 8000) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/gesong/__pycache__/__init__.cpython-38.pyc b/gesong/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3234c5f1b4f5ca658537f0e5f3a734cc9b3598a5 GIT binary patch literal 431 zcmYjO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2eGL;10*MHo8nnpfwC4P_Gtpe{>OlB_)@5>k{v#G^|VQ8Y_A3 z3Z=rDGuHE&T)EIyT1f4~z{xtdxi{9ONuX0_bm)j?Q9Bz`og;e#Tx%{jv*S|2h4L6? z>}3W&mH@a8>TZKUm|}vve<&s3Vf}9Lv(9#G5njFaLCGaQX>^hHLXUG{3eH2HbETE% y+{R38*_IcQ7e_~7Jr{yEcFt`xmsidF+ua00=s#T;0pK$Xk?Vt@y*{}``h&kTpu3F# literal 0 HcmV?d00001 diff --git a/gesong/__pycache__/test.cpython-38.pyc b/gesong/__pycache__/test.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c1f9441533c0adf10ccfeb1ca7904fe23c67dea9 GIT binary patch literal 320 zcmYjL!Ab)$5S>Y~Yb+K#`U@+iMb9FN_fpVaN+D<`T~^lJCD~Q<;6<cNJmXkRtQ%zmv@8Bf&*7UPG zoaff_Xx>`i4x9U+;-~SI7fc{r!o12lS1ra_60|WzRkX$gc{-Vd#MNDE l|14qWlE`$fG_EV{I`aP(R}1>+rY0U9$Bli;q=m+w`~_>ZK`{UT literal 0 HcmV?d00001 diff --git a/gesong/admin/__init__.py b/gesong/admin/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/gesong/admin/access.py b/gesong/admin/access.py new file mode 100644 index 0000000..e69de29 diff --git a/gesong/admin/audit.py b/gesong/admin/audit.py new file mode 100644 index 0000000..e69de29 diff --git a/gesong/admin/list.py b/gesong/admin/list.py new file mode 100644 index 0000000..e69de29 diff --git a/gesong/admin/system.py b/gesong/admin/system.py new file mode 100644 index 0000000..e69de29 diff --git a/gesong/database.py b/gesong/database.py new file mode 100644 index 0000000..e69de29 diff --git a/gesong/page/__init__.py b/gesong/page/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/gesong/page/back/access.py b/gesong/page/back/access.py new file mode 100644 index 0000000..e69de29 diff --git a/gesong/page/back/audit.py b/gesong/page/back/audit.py new file mode 100644 index 0000000..e69de29 diff --git a/gesong/page/back/list.py b/gesong/page/back/list.py new file mode 100644 index 0000000..e69de29 diff --git a/gesong/page/back/system.py b/gesong/page/back/system.py new file mode 100644 index 0000000..e69de29 diff --git a/gesong/page/front/confirm.py b/gesong/page/front/confirm.py new file mode 100644 index 0000000..e69de29 diff --git a/gesong/page/front/history.py b/gesong/page/front/history.py new file mode 100644 index 0000000..e69de29 diff --git a/gesong/page/front/index.py b/gesong/page/front/index.py new file mode 100644 index 0000000..e69de29 diff --git a/gesong/page/front/list.py b/gesong/page/front/list.py new file mode 100644 index 0000000..e69de29 diff --git a/gesong/page/front/search.py b/gesong/page/front/search.py new file mode 100644 index 0000000..e69de29 diff --git a/gesong/route.py b/gesong/route.py new file mode 100644 index 0000000..1358148 --- /dev/null +++ b/gesong/route.py @@ -0,0 +1,22 @@ +''' + Copyright Ghink Network Studio © 2014 + MIT Fengming High School Techy Group & Radio Station + Website: https://www.ghink.net, https://radio.fmhs.club, https://techy.fmhs.club + Main Program by Bigsk (https://www.xiaxinzhe.cn) +''' + +from __init__ import * + +import json, time + +def ping(): + return json.dumps({ + "ping": "pong", + "time": time.time() + }, + ensure_ascii = False, + sort_keys = True, + indent = 4, + separators = (',', ':')) + +APP.add_url_rule("/ping", view_func = ping) \ No newline at end of file diff --git a/gesong/song/__init__.py b/gesong/song/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/gesong/song/cache.py b/gesong/song/cache.py new file mode 100644 index 0000000..e69de29 diff --git a/gesong/song/detail.py b/gesong/song/detail.py new file mode 100644 index 0000000..e69de29 diff --git a/gesong/song/history.py b/gesong/song/history.py new file mode 100644 index 0000000..e69de29 diff --git a/gesong/song/sdks/netease/.keep b/gesong/song/sdks/netease/.keep new file mode 100644 index 0000000..e69de29 diff --git a/gesong/song/sdks/tencent_cloud/.keep b/gesong/song/sdks/tencent_cloud/.keep new file mode 100644 index 0000000..e69de29 diff --git a/gesong/song/search.py b/gesong/song/search.py new file mode 100644 index 0000000..e69de29 diff --git a/gesong/user/__init__.py b/gesong/user/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/gesong/user/oauth/ghink.py b/gesong/user/oauth/ghink.py new file mode 100644 index 0000000..e69de29 diff --git a/gesong/user/oauth/sdks/ghink/.keep b/gesong/user/oauth/sdks/ghink/.keep new file mode 100644 index 0000000..e69de29