-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
# Conflicts: # types/artistHomepage.go # types/musicianTasks.go
- Loading branch information
Showing
47 changed files
with
338 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package api | ||
|
||
import ( | ||
"encoding/json" | ||
|
||
"github.com/XiaoMengXinX/Music163Api-Go/types" | ||
"github.com/XiaoMengXinX/Music163Api-Go/utils" | ||
) | ||
|
||
// ArtistHomepageAPI 获取歌手主页API | ||
const ArtistHomepageAPI = "/api/personal/home/page/artist" | ||
|
||
// ArtistHomepageReq 获取歌手主页API 的 body json | ||
type ArtistHomepageReq struct { | ||
ArtistId int64 `json:"artistId"` | ||
} | ||
|
||
// CreateArtistHomepageReqJson 创建获取歌手主页API 的 body json | ||
func CreateArtistHomepageReqJson(artistId int64) string { | ||
reqBody := ArtistHomepageReq{ | ||
ArtistId: artistId, | ||
} | ||
reqBodyJson, _ := json.Marshal(reqBody) | ||
return string(reqBodyJson) | ||
} | ||
|
||
// GetArtistHomepage 获取歌手主页 | ||
func GetArtistHomepage(data utils.RequestData, artistID int64) (result types.ArtistHomepageData, err error) { | ||
var options utils.EapiOption | ||
options.Path = ArtistHomepageAPI | ||
options.Url = "https://music.163.com/eapi/personal/home/page/artist" | ||
options.Json = CreateArtistHomepageReqJson(artistID) | ||
resBody, _, err := utils.ApiRequest(options, data) | ||
if err != nil { | ||
return result, err | ||
} | ||
err = json.Unmarshal([]byte(resBody), &result) | ||
result.RawJson = resBody | ||
return result, err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package api | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
|
||
"github.com/XiaoMengXinX/Music163Api-Go/types" | ||
"github.com/XiaoMengXinX/Music163Api-Go/utils" | ||
) | ||
|
||
// ProgramDetailAPI 节目详情API | ||
const ProgramDetailAPI = `/api/dj/program/detail` | ||
|
||
type programDetailReq struct { | ||
ID string `json:"id"` | ||
} | ||
|
||
// CreateProgramDetailReqJson 创建获取节目详情请求json | ||
func CreateProgramDetailReqJson(id int) string { | ||
reqBody := programDetailReq{ | ||
ID: fmt.Sprintf("%d", id), | ||
} | ||
reqBodyJson, _ := json.Marshal(reqBody) | ||
return string(reqBodyJson) | ||
} | ||
|
||
// GetProgramDetail 获取节目详情 | ||
func GetProgramDetail(data utils.RequestData, id int) (result types.ProgramDetailData, err error) { | ||
var options utils.EapiOption | ||
options.Path = ProgramDetailAPI | ||
options.Url = "https://music.163.com/eapi/dj/program/detail" | ||
reqBodyJson := CreateProgramDetailReqJson(id) | ||
options.Json = reqBodyJson | ||
resBody, _, err := utils.ApiRequest(options, data) | ||
if err != nil { | ||
return result, err | ||
} | ||
err = json.Unmarshal([]byte(resBody), &result) | ||
result.RawJson = resBody | ||
return result, err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.