You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
779 B
31 lines
779 B
3 months ago
|
|
||
|
import 'package:dio/dio.dart';
|
||
|
import 'package:music_player_miao/models/universal_bean.dart';
|
||
|
|
||
|
|
||
|
const String _SonglistMusicURL = 'http://8.210.250.29:10010/songlist-musics';
|
||
|
|
||
|
class SonglistMusicApi {
|
||
|
final Dio dio = Dio();
|
||
|
|
||
|
Future<UniversalBean> addMusicToSongList({
|
||
|
required int musicId,
|
||
|
required int songlistId,
|
||
|
required String Authorization
|
||
|
}) async {
|
||
|
Response response = await dio.post(
|
||
|
_SonglistMusicURL,
|
||
|
data: [{
|
||
|
'musicId': musicId,
|
||
|
'songlistId': songlistId,
|
||
|
}],
|
||
|
options: Options(
|
||
|
headers: {
|
||
|
'Authorization': Authorization,
|
||
|
'Content-Type': 'application/json;charset=UTF-8'
|
||
|
}
|
||
|
)
|
||
|
);
|
||
|
return UniversalBean.formMap(response.data);
|
||
|
}
|
||
|
}
|