Чистка кода
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using PlaylistShared.Api.Entities;
|
||||
using PlaylistShared.Api.Services;
|
||||
using PlaylistShared.Shared;
|
||||
using PlaylistShared.Shared.Auth;
|
||||
using PlaylistShared.Shared.DTO;
|
||||
|
||||
[ApiController]
|
||||
|
||||
@@ -4,9 +4,10 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using PlaylistShared.Api.Entities;
|
||||
using PlaylistShared.Api.Extensions;
|
||||
using PlaylistShared.Api.Services;
|
||||
using PlaylistShared.Shared.DTO;
|
||||
using PlaylistShared.Shared;
|
||||
using PlaylistShared.Shared.Enums;
|
||||
using PlaylistShared.Shared.Models;
|
||||
using PlaylistShared.Shared.Playlist;
|
||||
using PlaylistShared.Shared.Shared;
|
||||
using YandexMusic;
|
||||
|
||||
namespace PlaylistShared.Api.Controllers;
|
||||
|
||||
@@ -4,8 +4,9 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using PlaylistShared.Api.Entities;
|
||||
using PlaylistShared.Api.Extensions;
|
||||
using PlaylistShared.Api.Services;
|
||||
using PlaylistShared.Shared;
|
||||
using PlaylistShared.Shared.DTO;
|
||||
using PlaylistShared.Shared.Models;
|
||||
using PlaylistShared.Shared.Shared;
|
||||
using YandexMusic.API.Models.Playlist;
|
||||
|
||||
[ApiController]
|
||||
|
||||
@@ -4,7 +4,8 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using PlaylistShared.Api.Entities;
|
||||
using PlaylistShared.Api.Extensions;
|
||||
using PlaylistShared.Api.Services;
|
||||
using PlaylistShared.Shared.DTO;
|
||||
using PlaylistShared.Shared;
|
||||
using PlaylistShared.Shared.Profile;
|
||||
|
||||
namespace PlaylistShared.Api.Controllers;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using AutoMapper;
|
||||
using PlaylistShared.Api.Entities;
|
||||
using PlaylistShared.Shared.Models;
|
||||
using PlaylistShared.Shared.Auth;
|
||||
using PlaylistShared.Shared.Shared;
|
||||
|
||||
namespace PlaylistShared.Api.Mapping;
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PlaylistShared.Api.Data;
|
||||
using PlaylistShared.Api.Entities;
|
||||
using PlaylistShared.Shared.DTO;
|
||||
using PlaylistShared.Shared.Enums;
|
||||
using PlaylistShared.Shared.Models;
|
||||
using PlaylistShared.Shared.Playlist;
|
||||
using PlaylistShared.Shared.Shared;
|
||||
|
||||
namespace PlaylistShared.Api.Services;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@page "/login"
|
||||
@using PlaylistShared.Shared.Auth
|
||||
@using PlaylistShared.Shared.DTO
|
||||
@using PlaylistShared.Pwa.Services
|
||||
@inject HttpClient Http
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
@page "/my-playlists"
|
||||
@attribute [Authorize]
|
||||
@using PlaylistShared.Shared.DTO
|
||||
@using PlaylistShared.Shared.Playlist
|
||||
@inject HttpClient Http
|
||||
@inject ISnackbar Snackbar
|
||||
@inject NavigationManager Navigation
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@page "/register"
|
||||
@using PlaylistShared.Shared.Auth
|
||||
@inject HttpClient Http
|
||||
@inject AuthStateProvider AuthProvider
|
||||
@inject NavigationManager Navigation
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
@using PlaylistShared.Shared.DTO
|
||||
@using PlaylistShared.Shared.Enums
|
||||
@using PlaylistShared.Pwa.Services
|
||||
@using PlaylistShared.Shared.Models
|
||||
@using PlaylistShared.Shared.Shared
|
||||
@inject HttpClient Http
|
||||
@inject ISnackbar Snackbar
|
||||
@inject NavigationManager Navigation
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using PlaylistShared.Shared.DTO;
|
||||
using PlaylistShared.Shared;
|
||||
using PlaylistShared.Shared.Auth;
|
||||
using PlaylistShared.Shared.DTO;
|
||||
using System.Net.Http.Json;
|
||||
|
||||
namespace PlaylistShared.Pwa.Services;
|
||||
|
||||
@@ -12,4 +12,4 @@
|
||||
@using PlaylistShared.Pwa.Services
|
||||
@using MudBlazor
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using PlaylistShared.Shared.DTO
|
||||
@using PlaylistShared.Shared
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace PlaylistShared.Shared.DTO;
|
||||
namespace PlaylistShared.Shared;
|
||||
|
||||
/// <summary>Универсальный контейнер ответа API.</summary>
|
||||
/// <typeparam name="T">Тип данных ответа.</typeparam>
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace PlaylistShared.Shared.Models;
|
||||
namespace PlaylistShared.Shared.Auth;
|
||||
|
||||
/// <summary>DTO пользователя (без конфиденциальных данных).</summary>
|
||||
public class ApplicationUserDto
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace PlaylistShared.Shared.DTO;
|
||||
namespace PlaylistShared.Shared.Auth;
|
||||
|
||||
/// <summary>Запрос на вход по паролю.</summary>
|
||||
public class LoginRequest
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace PlaylistShared.Shared.DTO;
|
||||
namespace PlaylistShared.Shared.Auth;
|
||||
|
||||
/// <summary>Ответ после успешного входа.</summary>
|
||||
public class LoginResponse
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace PlaylistShared.Shared.DTO;
|
||||
namespace PlaylistShared.Shared.Auth;
|
||||
|
||||
/// <summary>Запрос на регистрацию нового пользователя.</summary>
|
||||
public class RegisterRequest
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace PlaylistShared.Shared.DTO;
|
||||
namespace PlaylistShared.Shared;
|
||||
|
||||
/// <summary>Стандартный ответ сервера при ошибке.</summary>
|
||||
public class ErrorResponse
|
||||
@@ -1,7 +1,7 @@
|
||||
using PlaylistShared.Shared.Enums;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace PlaylistShared.Shared.DTO;
|
||||
namespace PlaylistShared.Shared.Playlist;
|
||||
|
||||
/// <summary>Запрос на создание нового шеринг-плейлиста.</summary>
|
||||
public class SharePlaylistDto
|
||||
7
PlaylistShared.Shared/Playlist/SharePlaylistRequest.cs
Normal file
7
PlaylistShared.Shared/Playlist/SharePlaylistRequest.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace PlaylistShared.Shared.Playlist;
|
||||
|
||||
public class SharePlaylistRequest
|
||||
{
|
||||
public string Kind { get; set; }
|
||||
public string OwnerUid { get; set; }
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace PlaylistShared.Shared.DTO;
|
||||
namespace PlaylistShared.Shared.Playlist;
|
||||
|
||||
/// <summary>Информация о плейлисте из Яндекс.Музыки (для импорта).</summary>
|
||||
public class YandexPlaylistInfo
|
||||
@@ -37,9 +37,3 @@ public class YandexPlaylistInfo
|
||||
[JsonPropertyName("shareToken")]
|
||||
public string? ShareToken { get; set; }
|
||||
}
|
||||
|
||||
public class SharePlaylistRequest
|
||||
{
|
||||
public string Kind { get; set; }
|
||||
public string OwnerUid { get; set; }
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace PlaylistShared.Shared.DTO;
|
||||
namespace PlaylistShared.Shared.Profile;
|
||||
|
||||
public class SetYandexTokenRequest
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace PlaylistShared.Shared.DTO;
|
||||
namespace PlaylistShared.Shared.Profile;
|
||||
|
||||
public class YandexTokenStatus
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace PlaylistShared.Shared.DTO;
|
||||
namespace PlaylistShared.Shared.Shared;
|
||||
|
||||
public class AddTrackByLinkRequest
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace PlaylistShared.Shared.DTO;
|
||||
namespace PlaylistShared.Shared.Shared;
|
||||
|
||||
public class AddTracksRequest
|
||||
{
|
||||
@@ -1,7 +1,8 @@
|
||||
using PlaylistShared.Shared.Enums;
|
||||
using PlaylistShared.Shared.Auth;
|
||||
using PlaylistShared.Shared.Enums;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace PlaylistShared.Shared.Models;
|
||||
namespace PlaylistShared.Shared.Shared;
|
||||
|
||||
/// <summary>DTO шеринг-плейлиста (без навигационных свойств).</summary>
|
||||
public class SharedPlaylistDto
|
||||
@@ -1,7 +1,7 @@
|
||||
using PlaylistShared.Shared.Enums;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace PlaylistShared.Shared.DTO;
|
||||
namespace PlaylistShared.Shared.Shared;
|
||||
|
||||
/// <summary>Запрос на обновление прав доступа шеринг-плейлиста.</summary>
|
||||
public class UpdatePermissionsDto
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace PlaylistShared.Shared.DTO;
|
||||
using PlaylistShared.Shared.DTO;
|
||||
|
||||
namespace PlaylistShared.Shared.Shared;
|
||||
|
||||
public class YandexPlaylistData
|
||||
{
|
||||
Reference in New Issue
Block a user