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 0000000..3234c5f Binary files /dev/null and b/gesong/__pycache__/__init__.cpython-38.pyc differ diff --git a/gesong/__pycache__/__main__.cpython-38.pyc b/gesong/__pycache__/__main__.cpython-38.pyc new file mode 100644 index 0000000..8b735bb Binary files /dev/null and b/gesong/__pycache__/__main__.cpython-38.pyc differ diff --git a/gesong/__pycache__/route.cpython-38.pyc b/gesong/__pycache__/route.cpython-38.pyc new file mode 100644 index 0000000..19d1a05 Binary files /dev/null and b/gesong/__pycache__/route.cpython-38.pyc differ diff --git a/gesong/__pycache__/test.cpython-38.pyc b/gesong/__pycache__/test.cpython-38.pyc new file mode 100644 index 0000000..c1f9441 Binary files /dev/null and b/gesong/__pycache__/test.cpython-38.pyc differ 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