From 41fe08f311028974b981a9f932907d6d62813cba Mon Sep 17 00:00:00 2001 From: Bigsk Date: Fri, 4 Mar 2022 12:52:35 +0800 Subject: [PATCH] User Interface Doc for Front --- document/front_design/README.md | 108 ++++++++++++++++++++++++++++++-- 1 file changed, 103 insertions(+), 5 deletions(-) diff --git a/document/front_design/README.md b/document/front_design/README.md index e07db3f..7ac37ae 100644 --- a/document/front_design/README.md +++ b/document/front_design/README.md @@ -18,9 +18,11 @@ #### 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` +##### `10000` `Success` `Successfully requested` +##### `20000` `No enough times` `No enough times to song` +##### `30000` `Forbidden` `Wrong Access (For User)` -## Front(User) +## Front (User) ### Index Page #### The index page use the root path ("/"), @@ -45,7 +47,7 @@ ###### `name` `string` `name of song` ###### `artists` `list` `list of artists` ###### `album` `dict` `album of this song` -###### `url` `string` `the media url of this song` +###### `url` `string` `the media url of this song (source platform or system cache)` ##### List of Artists Args: ###### `id` `int` `artist id(platform)` ###### `name` `string` `name of this artist` @@ -57,7 +59,7 @@ ### History Page #### The history page use the path "/history" -#### Anybody can directly get history of songs +#### Anybody can directly get the history of songs #### WebApi Interface Detail: ##### Path: `/api/history` ##### Method: `GET` @@ -65,4 +67,100 @@ ##### Response Format: `Json` ##### Json Args: ###### `code` `int` `response code` -###### `content` `list` `list of history songs` \ No newline at end of file +###### `content` `list` `list of history 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 (system cache)` +##### 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` + +### List Page +#### The list page use the path "/list" +#### Anybody can directly get the list of whitelist and blacklist +#### WebApi Interface Detail: +##### Path: `/api/list` +##### Method: `GET` +##### Args: `Nothing` +##### Response Format: `Json` +##### Json Args: +###### `code` `int` `response code` +###### `content` `dict` `dict of list, included whitelist and blacklist` +##### Content Dict(content): +###### `white` `list` `songs list of whitelist` +###### `black` `list` `songs list of blacklist` +##### List of Songs Args: +###### `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` +##### 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` + +### Confirm Page +#### The confirm page use the path "/confirm" +#### This page only use for the twice confirm +#### Located from the search page +#### Read the parameter from url on front code (Javascript) +#### Get Parameter: +##### `platform` `int` `platform id` +##### `id` `int` `id of the song` +#### Then use the id and platform id to requests the song detail +#### WebApi Interface Detail: +##### Path: `/api/detail` +##### Method: `POST` +##### Args: +###### `platform` `int` `id of the platform` +###### `id` `int` `id 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 (source platform or system cache)` +##### 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` +#### After user clicking the confirm button, send request to this interface +#### WebApi Interface Detail: +##### Path: `/api/detail` +##### Method: `POST` +##### Args: +###### `platform` `int` `id of the platform` +###### `id` `int` `id of the song` +###### `date` `string` `YYYY-MM-DD` +###### `token` `string` `user token` +##### Response Format: `Json` +##### Json Args: +###### `code` `int` `response code` + +## Back (Admin) + +### Access Page \ No newline at end of file