提交代码
This commit is contained in:
parent
6c3923283b
commit
37d54eccbb
|
|
@ -279,6 +279,25 @@ namespace HuanMeng.MiaoYu.Code.Music
|
|||
return new BaseResponse<int>(ResonseCode.Success, "音乐正在生成", m_SongInfo.Id) { };
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 删除音乐
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<BaseResponse<bool>> DelMusic(int id)
|
||||
{
|
||||
var s = await Dao.daoDbMiaoYu.context.M_Songs.Where(it => it.Id == id && it.AuthorId == _UserId).FirstOrDefaultAsync();
|
||||
|
||||
if (s == null)
|
||||
{
|
||||
return new BaseResponse<bool>(ResonseCode.Success, "未找到音乐", false);
|
||||
}
|
||||
s.State = -2;
|
||||
s.IsPublic = false;
|
||||
await Dao.daoDbMiaoYu.context.SaveChangesAsync();
|
||||
return new BaseResponse<bool>(ResonseCode.Success, "删除成功", false);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取音乐生成进度
|
||||
/// </summary>
|
||||
|
|
@ -373,7 +392,7 @@ namespace HuanMeng.MiaoYu.Code.Music
|
|||
{
|
||||
throw new Exception("歌曲不存在");
|
||||
}
|
||||
if (songs.State == 0)
|
||||
if (songs.State <= 0)
|
||||
{
|
||||
throw new Exception("请等待歌曲生成成功");
|
||||
}
|
||||
|
|
@ -418,7 +437,7 @@ namespace HuanMeng.MiaoYu.Code.Music
|
|||
{
|
||||
throw new Exception("歌曲不存在");
|
||||
}
|
||||
if (songs.State == 0)
|
||||
if (songs.State <= 0)
|
||||
{
|
||||
throw new Exception("请等待歌曲生成成功");
|
||||
}
|
||||
|
|
@ -498,7 +517,7 @@ namespace HuanMeng.MiaoYu.Code.Music
|
|||
var data = Mapper.Map<List<MusicSongInfoDto>>(list);
|
||||
return new BaseResponse<List<MusicSongInfoDto>>(ResonseCode.Success, "", data);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -83,6 +83,17 @@ namespace HuanMeng.MiaoYu.WebApi.Controllers
|
|||
MusicBLL musicBLL = new MusicBLL(ServiceProvider);
|
||||
return await musicBLL.CreateMusic(musicCreateRequest);
|
||||
}
|
||||
/// <summary>
|
||||
/// 删除音乐
|
||||
/// </summary>
|
||||
/// <param name="musicReviewRequest"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<BaseResponse<bool>> DelMusic([FromBody] MusicReviewRequest musicReviewRequest)
|
||||
{
|
||||
MusicBLL musicBLL = new MusicBLL(ServiceProvider);
|
||||
return await musicBLL.DelMusic(musicReviewRequest.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取音乐生成进度
|
||||
|
|
@ -198,7 +209,7 @@ namespace HuanMeng.MiaoYu.WebApi.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取我的收藏
|
||||
/// 获取我的点赞
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user