generated from admin/template
15.10.26
This commit is contained in:
Binary file not shown.
@@ -1,46 +0,0 @@
|
|||||||
using Scalar.AspNetCore;
|
|
||||||
|
|
||||||
// 1. Модели теперь можно объявить здесь, так как они находятся внутри пространства имен
|
|
||||||
public record Pokemon(int Id, string Name, string Type, int Level);
|
|
||||||
public record PokemonInput(string Name, string Type, int Level);
|
|
||||||
|
|
||||||
public class Program
|
|
||||||
{
|
|
||||||
public static void Main(string[] args)
|
|
||||||
{
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
|
||||||
|
|
||||||
builder.Services.AddOpenApi();
|
|
||||||
|
|
||||||
var app = builder.Build();
|
|
||||||
|
|
||||||
var pokemons = new List<Pokemon>
|
|
||||||
{
|
|
||||||
new(1, "Pikachu", "Electric", 12),
|
|
||||||
new(2, "Charmander", "Fire", 8),
|
|
||||||
new(3, "Squirtle", "Water", 10)
|
|
||||||
};
|
|
||||||
|
|
||||||
// GET /pokemons
|
|
||||||
app.MapGet("/pokemons/{id}", (int id) =>
|
|
||||||
{
|
|
||||||
var pokemon = pokemons.FirstOrDefault(p => p.Id == id);
|
|
||||||
|
|
||||||
return pokemon is null
|
|
||||||
? Results.NotFound()
|
|
||||||
: Results.Ok(pokemon);
|
|
||||||
});
|
|
||||||
|
|
||||||
if (app.Environment.IsDevelopment())
|
|
||||||
{
|
|
||||||
app.MapOpenApi();
|
|
||||||
app.MapScalarApiReference(options =>
|
|
||||||
{
|
|
||||||
options.WithTitle("Pokedex API")
|
|
||||||
.WithOpenApiRoutePattern("/openapi/v1.json");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
app.Run();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
@@ -0,0 +1,35 @@
|
|||||||
|
info:
|
||||||
|
name: delete /pokemons/:id
|
||||||
|
type: http
|
||||||
|
seq: 5
|
||||||
|
tags:
|
||||||
|
- PokedexApi
|
||||||
|
|
||||||
|
http:
|
||||||
|
method: DELETE
|
||||||
|
url: http://localhost:5211/pokemons/6
|
||||||
|
auth: inherit
|
||||||
|
|
||||||
|
settings:
|
||||||
|
encodeUrl: true
|
||||||
|
timeout: 0
|
||||||
|
followRedirects: true
|
||||||
|
maxRedirects: 5
|
||||||
|
forwardAuthorizationHeader: false
|
||||||
|
|
||||||
|
examples:
|
||||||
|
- name: 200 Response
|
||||||
|
description: OK
|
||||||
|
request:
|
||||||
|
url: "{{baseUrl}}/pokemons/:id"
|
||||||
|
method: DELETE
|
||||||
|
params:
|
||||||
|
- name: id
|
||||||
|
value: ""
|
||||||
|
type: path
|
||||||
|
response:
|
||||||
|
status: 200
|
||||||
|
statusText: OK
|
||||||
|
body:
|
||||||
|
type: text
|
||||||
|
data: ""
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
info:
|
||||||
|
name: PokedexApi
|
||||||
|
type: folder
|
||||||
|
|
||||||
|
request:
|
||||||
|
auth: inherit
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
info:
|
||||||
|
name: get /pokemons/:id
|
||||||
|
type: http
|
||||||
|
seq: 3
|
||||||
|
tags:
|
||||||
|
- PokedexApi
|
||||||
|
|
||||||
|
http:
|
||||||
|
method: GET
|
||||||
|
url: http://localhost:5211/pokemons/5
|
||||||
|
auth: inherit
|
||||||
|
|
||||||
|
settings:
|
||||||
|
encodeUrl: true
|
||||||
|
timeout: 0
|
||||||
|
followRedirects: true
|
||||||
|
maxRedirects: 5
|
||||||
|
forwardAuthorizationHeader: false
|
||||||
|
|
||||||
|
examples:
|
||||||
|
- name: 200 Response
|
||||||
|
description: OK
|
||||||
|
request:
|
||||||
|
url: "{{baseUrl}}/pokemons/:id"
|
||||||
|
method: GET
|
||||||
|
params:
|
||||||
|
- name: id
|
||||||
|
value: ""
|
||||||
|
type: path
|
||||||
|
response:
|
||||||
|
status: 200
|
||||||
|
statusText: OK
|
||||||
|
body:
|
||||||
|
type: text
|
||||||
|
data: ""
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
info:
|
||||||
|
name: get /pokemons
|
||||||
|
type: http
|
||||||
|
seq: 2
|
||||||
|
tags:
|
||||||
|
- PokedexApi
|
||||||
|
|
||||||
|
http:
|
||||||
|
method: GET
|
||||||
|
url: http://localhost:5211/pokemons
|
||||||
|
auth: inherit
|
||||||
|
|
||||||
|
settings:
|
||||||
|
encodeUrl: true
|
||||||
|
timeout: 0
|
||||||
|
followRedirects: true
|
||||||
|
maxRedirects: 5
|
||||||
|
forwardAuthorizationHeader: false
|
||||||
|
|
||||||
|
examples:
|
||||||
|
- name: 200 Response
|
||||||
|
description: OK
|
||||||
|
request:
|
||||||
|
url: "{{baseUrl}}/pokemons"
|
||||||
|
method: GET
|
||||||
|
response:
|
||||||
|
status: 200
|
||||||
|
statusText: OK
|
||||||
|
body:
|
||||||
|
type: text
|
||||||
|
data: ""
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
info:
|
||||||
|
name: post /pokemons
|
||||||
|
type: http
|
||||||
|
seq: 3
|
||||||
|
tags:
|
||||||
|
- PokedexApi
|
||||||
|
|
||||||
|
http:
|
||||||
|
method: POST
|
||||||
|
url: http://localhost:5211/pokemons
|
||||||
|
body:
|
||||||
|
type: json
|
||||||
|
data: |-
|
||||||
|
{
|
||||||
|
"name": "Pikachu",
|
||||||
|
"type": "Electric",
|
||||||
|
"level": 12
|
||||||
|
}
|
||||||
|
auth: inherit
|
||||||
|
|
||||||
|
settings:
|
||||||
|
encodeUrl: true
|
||||||
|
timeout: 0
|
||||||
|
followRedirects: true
|
||||||
|
maxRedirects: 5
|
||||||
|
forwardAuthorizationHeader: false
|
||||||
|
|
||||||
|
examples:
|
||||||
|
- name: 200 Response
|
||||||
|
description: OK
|
||||||
|
request:
|
||||||
|
url: "{{baseUrl}}/pokemons"
|
||||||
|
method: POST
|
||||||
|
body:
|
||||||
|
type: json
|
||||||
|
data: |-
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"type": "",
|
||||||
|
"level": ""
|
||||||
|
}
|
||||||
|
response:
|
||||||
|
status: 200
|
||||||
|
statusText: OK
|
||||||
|
body:
|
||||||
|
type: text
|
||||||
|
data: ""
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
info:
|
||||||
|
name: put /pokemons/:id
|
||||||
|
type: http
|
||||||
|
seq: 5
|
||||||
|
tags:
|
||||||
|
- PokedexApi
|
||||||
|
|
||||||
|
http:
|
||||||
|
method: PUT
|
||||||
|
url: http://localhost:5211/pokemons/1
|
||||||
|
body:
|
||||||
|
type: json
|
||||||
|
data: |-
|
||||||
|
{
|
||||||
|
"name": "Raichu",
|
||||||
|
"type": "Electric",
|
||||||
|
"level": 32
|
||||||
|
}
|
||||||
|
auth: inherit
|
||||||
|
|
||||||
|
settings:
|
||||||
|
encodeUrl: true
|
||||||
|
timeout: 0
|
||||||
|
followRedirects: true
|
||||||
|
maxRedirects: 5
|
||||||
|
forwardAuthorizationHeader: false
|
||||||
|
|
||||||
|
examples:
|
||||||
|
- name: 200 Response
|
||||||
|
description: OK
|
||||||
|
request:
|
||||||
|
url: "{{baseUrl}}/pokemons/:id"
|
||||||
|
method: PUT
|
||||||
|
params:
|
||||||
|
- name: id
|
||||||
|
value: ""
|
||||||
|
type: path
|
||||||
|
body:
|
||||||
|
type: json
|
||||||
|
data: |-
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"type": "",
|
||||||
|
"level": ""
|
||||||
|
}
|
||||||
|
response:
|
||||||
|
status: 200
|
||||||
|
statusText: OK
|
||||||
|
body:
|
||||||
|
type: text
|
||||||
|
data: ""
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
name: Environment 1
|
||||||
|
variables:
|
||||||
|
- name: baseUrl
|
||||||
|
value: http://localhost:5211
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
opencollection: 1.0.0
|
||||||
|
|
||||||
|
info:
|
||||||
|
name: PokedexApi | v1 - 1
|
||||||
|
bundled: false
|
||||||
|
extensions:
|
||||||
|
bruno:
|
||||||
|
ignore:
|
||||||
|
- node_modules
|
||||||
|
- .git
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
info:
|
||||||
|
name: PokedexApi
|
||||||
|
type: folder
|
||||||
|
|
||||||
|
request:
|
||||||
|
auth: inherit
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
info:
|
||||||
|
name: get /hello
|
||||||
|
type: http
|
||||||
|
seq: 1
|
||||||
|
tags:
|
||||||
|
- PokedexApi
|
||||||
|
|
||||||
|
http:
|
||||||
|
method: GET
|
||||||
|
url: "{{baseUrl}}/hello"
|
||||||
|
auth: inherit
|
||||||
|
|
||||||
|
settings:
|
||||||
|
encodeUrl: true
|
||||||
|
timeout: 0
|
||||||
|
followRedirects: true
|
||||||
|
maxRedirects: 5
|
||||||
|
forwardAuthorizationHeader: false
|
||||||
|
|
||||||
|
examples:
|
||||||
|
- name: 200 Response
|
||||||
|
description: OK
|
||||||
|
request:
|
||||||
|
url: "{{baseUrl}}/hello"
|
||||||
|
method: GET
|
||||||
|
response:
|
||||||
|
status: 200
|
||||||
|
statusText: OK
|
||||||
|
headers:
|
||||||
|
- name: Content-Type
|
||||||
|
value: text/plain
|
||||||
|
body:
|
||||||
|
type: text
|
||||||
|
data: ""
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
info:
|
||||||
|
name: get /pokemons/:id
|
||||||
|
type: http
|
||||||
|
seq: 3
|
||||||
|
tags:
|
||||||
|
- PokedexApi
|
||||||
|
|
||||||
|
http:
|
||||||
|
method: GET
|
||||||
|
url: "{{baseUrl}}/pokemons/:id"
|
||||||
|
params:
|
||||||
|
- name: id
|
||||||
|
value: ""
|
||||||
|
type: path
|
||||||
|
auth: inherit
|
||||||
|
|
||||||
|
settings:
|
||||||
|
encodeUrl: true
|
||||||
|
timeout: 0
|
||||||
|
followRedirects: true
|
||||||
|
maxRedirects: 5
|
||||||
|
forwardAuthorizationHeader: false
|
||||||
|
|
||||||
|
examples:
|
||||||
|
- name: 200 Response
|
||||||
|
description: OK
|
||||||
|
request:
|
||||||
|
url: "{{baseUrl}}/pokemons/:id"
|
||||||
|
method: GET
|
||||||
|
params:
|
||||||
|
- name: id
|
||||||
|
value: ""
|
||||||
|
type: path
|
||||||
|
response:
|
||||||
|
status: 200
|
||||||
|
statusText: OK
|
||||||
|
body:
|
||||||
|
type: text
|
||||||
|
data: ""
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
info:
|
||||||
|
name: get /pokemons
|
||||||
|
type: http
|
||||||
|
seq: 2
|
||||||
|
tags:
|
||||||
|
- PokedexApi
|
||||||
|
|
||||||
|
http:
|
||||||
|
method: GET
|
||||||
|
url: "{{baseUrl}}/pokemons"
|
||||||
|
auth: inherit
|
||||||
|
|
||||||
|
settings:
|
||||||
|
encodeUrl: true
|
||||||
|
timeout: 0
|
||||||
|
followRedirects: true
|
||||||
|
maxRedirects: 5
|
||||||
|
forwardAuthorizationHeader: false
|
||||||
|
|
||||||
|
examples:
|
||||||
|
- name: 200 Response
|
||||||
|
description: OK
|
||||||
|
request:
|
||||||
|
url: "{{baseUrl}}/pokemons"
|
||||||
|
method: GET
|
||||||
|
response:
|
||||||
|
status: 200
|
||||||
|
statusText: OK
|
||||||
|
body:
|
||||||
|
type: text
|
||||||
|
data: ""
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
name: Environment 1
|
||||||
|
variables:
|
||||||
|
- name: baseUrl
|
||||||
|
value: http://localhost:5211
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
opencollection: 1.0.0
|
||||||
|
|
||||||
|
info:
|
||||||
|
name: PokedexApi | v1
|
||||||
|
version: "1"
|
||||||
|
config:
|
||||||
|
proxy:
|
||||||
|
inherit: true
|
||||||
|
config:
|
||||||
|
protocol: http
|
||||||
|
hostname: ""
|
||||||
|
port: ""
|
||||||
|
auth:
|
||||||
|
username: ""
|
||||||
|
password: ""
|
||||||
|
bypassProxy: ""
|
||||||
|
|
||||||
|
request:
|
||||||
|
variables:
|
||||||
|
- name: baseUrl
|
||||||
|
value: http://localhost:5211
|
||||||
|
bundled: false
|
||||||
|
extensions:
|
||||||
|
bruno:
|
||||||
|
ignore:
|
||||||
|
- node_modules
|
||||||
|
- .git
|
||||||
|
openapi:
|
||||||
|
- sourceUrl: ../../v1.json
|
||||||
|
groupBy: tags
|
||||||
|
lastSyncDate: 2026-10-15T12:42:49.890Z
|
||||||
|
specHash: 3772da9d0fb4ef0d1ddc6bccd9094f9d
|
||||||
|
autoCheck: true
|
||||||
|
autoCheckInterval: 5
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PokedexApi", "PokedexApi\PokedexApi.csproj", "{0AC1C38E-7B58-4271-9193-B74B674ECF6C}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PokedexApi", "PokedexApi\PokedexApi.csproj", "{9A30BAE9-E0E9-413B-953F-26F43F01E17F}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@@ -8,9 +8,9 @@ Global
|
|||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{0AC1C38E-7B58-4271-9193-B74B674ECF6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{9A30BAE9-E0E9-413B-953F-26F43F01E17F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{0AC1C38E-7B58-4271-9193-B74B674ECF6C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{9A30BAE9-E0E9-413B-953F-26F43F01E17F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{0AC1C38E-7B58-4271-9193-B74B674ECF6C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{9A30BAE9-E0E9-413B-953F-26F43F01E17F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{0AC1C38E-7B58-4271-9193-B74B674ECF6C}.Release|Any CPU.Build.0 = Release|Any CPU
|
{9A30BAE9-E0E9-413B-953F-26F43F01E17F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
@PokedexApi_HostAddress = http://localhost:5116
|
@PokedexApi_HostAddress = http://localhost:5211
|
||||||
|
|
||||||
GET {{PokedexApi_HostAddress}}/weatherforecast/
|
GET {{PokedexApi_HostAddress}}/weatherforecast/
|
||||||
Accept: application/json
|
Accept: application/json
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
using Scalar.AspNetCore;
|
||||||
|
|
||||||
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
|
builder.Services.AddOpenApi();
|
||||||
|
|
||||||
|
var app = builder.Build();
|
||||||
|
|
||||||
|
if (app.Environment.IsDevelopment())
|
||||||
|
{
|
||||||
|
app.MapOpenApi();
|
||||||
|
app.MapScalarApiReference();
|
||||||
|
}
|
||||||
|
|
||||||
|
var pokemons = new List<Pokemon>
|
||||||
|
{
|
||||||
|
new(1, "Pikachu", "Electric", 12),
|
||||||
|
new(2, "Charmander", "Fire", 8),
|
||||||
|
new(3, "Squirtle", "Water", 10)
|
||||||
|
};
|
||||||
|
|
||||||
|
app.MapGet("/pokemons", () => Results.Ok(pokemons));
|
||||||
|
|
||||||
|
app.MapGet("/pokemons/{id}", (int id) =>
|
||||||
|
{
|
||||||
|
var pokemon = pokemons.FirstOrDefault(p => p.Id == id);
|
||||||
|
return pokemon is null ? Results.NotFound() : Results.Ok(pokemon);
|
||||||
|
});
|
||||||
|
|
||||||
|
app.MapPost("/pokemons", (PokemonInput input) =>
|
||||||
|
{
|
||||||
|
var errors = Validate(input);
|
||||||
|
if (errors.Count > 0)
|
||||||
|
{
|
||||||
|
return Results.BadRequest(new { errors });
|
||||||
|
}
|
||||||
|
|
||||||
|
var newId = pokemons.Count > 0 ? pokemons.Max(p => p.Id) + 1 : 1;
|
||||||
|
var pokemon = new Pokemon(newId, input.Name, input.Type, input.Level);
|
||||||
|
pokemons.Add(pokemon);
|
||||||
|
return Results.Created($"/pokemons/{newId}", pokemon);
|
||||||
|
});
|
||||||
|
|
||||||
|
app.MapPut("/pokemons/{id}", (int id, PokemonInput input) =>
|
||||||
|
{
|
||||||
|
var existing = pokemons.FirstOrDefault(p => p.Id == id);
|
||||||
|
if (existing is null)
|
||||||
|
{
|
||||||
|
return Results.NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
var errors = Validate(input);
|
||||||
|
if (errors.Count > 0)
|
||||||
|
{
|
||||||
|
return Results.BadRequest(new { errors });
|
||||||
|
}
|
||||||
|
|
||||||
|
var updated = new Pokemon(id, input.Name, input.Type, input.Level);
|
||||||
|
pokemons[pokemons.IndexOf(existing)] = updated;
|
||||||
|
return Results.Ok(updated);
|
||||||
|
});
|
||||||
|
|
||||||
|
app.MapDelete("/pokemons/{id}", (int id) =>
|
||||||
|
{
|
||||||
|
var existing = pokemons.FirstOrDefault(p => p.Id == id);
|
||||||
|
if (existing is null)
|
||||||
|
{
|
||||||
|
return Results.NotFound();
|
||||||
|
}
|
||||||
|
pokemons.Remove(existing);
|
||||||
|
return Results.NoContent();
|
||||||
|
});
|
||||||
|
|
||||||
|
app.Run();
|
||||||
|
|
||||||
|
List<string> Validate(PokemonInput input)
|
||||||
|
{
|
||||||
|
var errors = new List<string>();
|
||||||
|
if (string.IsNullOrWhiteSpace(input.Name)) errors.Add("Имя не может быть пустым.");
|
||||||
|
if (string.IsNullOrWhiteSpace(input.Type)) errors.Add("Тип не может быть пустым.");
|
||||||
|
if (input.Level <= 0) errors.Add("Уровень должен быть больше 0.");
|
||||||
|
return errors;
|
||||||
|
}
|
||||||
|
|
||||||
|
public record Pokemon(int Id, string Name, string Type, int Level);
|
||||||
|
public record PokemonInput(string Name, string Type, int Level);
|
||||||
+2
-2
@@ -5,7 +5,7 @@
|
|||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"dotnetRunMessages": true,
|
"dotnetRunMessages": true,
|
||||||
"launchBrowser": false,
|
"launchBrowser": false,
|
||||||
"applicationUrl": "http://localhost:5116",
|
"applicationUrl": "http://localhost:5211",
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
}
|
}
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"dotnetRunMessages": true,
|
"dotnetRunMessages": true,
|
||||||
"launchBrowser": false,
|
"launchBrowser": false,
|
||||||
"applicationUrl": "https://localhost:7103;http://localhost:5116",
|
"applicationUrl": "https://localhost:7050;http://localhost:5211",
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
info:
|
||||||
|
name: "1 request "
|
||||||
|
type: http
|
||||||
|
seq: 1
|
||||||
|
|
||||||
|
http:
|
||||||
|
method: GET
|
||||||
|
url: https://pokeapi.co/api/v2/pokemon/pikachu
|
||||||
|
auth: inherit
|
||||||
|
|
||||||
|
settings:
|
||||||
|
encodeUrl: true
|
||||||
|
timeout: 0
|
||||||
|
followRedirects: true
|
||||||
|
maxRedirects: 5
|
||||||
|
forwardAuthorizationHeader: false
|
||||||
|
|
||||||
|
docs: |-
|
||||||
|
1 запрос:
|
||||||
|
|
||||||
|
Вывод покемона по имени
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
info:
|
||||||
|
name: 2 request
|
||||||
|
type: http
|
||||||
|
seq: 2
|
||||||
|
|
||||||
|
http:
|
||||||
|
method: GET
|
||||||
|
url: https://pokeapi.co/api/v2/pokemon/25
|
||||||
|
auth: inherit
|
||||||
|
|
||||||
|
settings:
|
||||||
|
encodeUrl: true
|
||||||
|
timeout: 0
|
||||||
|
followRedirects: true
|
||||||
|
maxRedirects: 5
|
||||||
|
forwardAuthorizationHeader: false
|
||||||
|
|
||||||
|
docs: |-
|
||||||
|
2 запрос:
|
||||||
|
|
||||||
|
Вывод покемона по id
|
||||||
|
|
||||||
|
<br/>
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
info:
|
||||||
|
name: 3 request
|
||||||
|
type: http
|
||||||
|
seq: 3
|
||||||
|
|
||||||
|
http:
|
||||||
|
method: GET
|
||||||
|
url: https://pokeapi.co/api/v2/pokemon?limit=5&offset=0
|
||||||
|
params:
|
||||||
|
- name: limit
|
||||||
|
value: "5"
|
||||||
|
type: query
|
||||||
|
- name: offset
|
||||||
|
value: "0"
|
||||||
|
type: query
|
||||||
|
auth: inherit
|
||||||
|
|
||||||
|
settings:
|
||||||
|
encodeUrl: true
|
||||||
|
timeout: 0
|
||||||
|
followRedirects: true
|
||||||
|
maxRedirects: 5
|
||||||
|
forwardAuthorizationHeader: false
|
||||||
|
|
||||||
|
docs: |-
|
||||||
|
3 запрос:
|
||||||
|
|
||||||
|
Вывод списка покемонов
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
info:
|
||||||
|
name: 4 request
|
||||||
|
type: http
|
||||||
|
seq: 4
|
||||||
|
|
||||||
|
http:
|
||||||
|
method: GET
|
||||||
|
url: https://pokeapi.co/api/v2/type/electric
|
||||||
|
auth: inherit
|
||||||
|
|
||||||
|
settings:
|
||||||
|
encodeUrl: true
|
||||||
|
timeout: 0
|
||||||
|
followRedirects: true
|
||||||
|
maxRedirects: 5
|
||||||
|
forwardAuthorizationHeader: false
|
||||||
|
|
||||||
|
docs: |-
|
||||||
|
4 запрос:
|
||||||
|
|
||||||
|
Вывод информации о типе
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
info:
|
||||||
|
name: 5 request
|
||||||
|
type: http
|
||||||
|
seq: 5
|
||||||
|
|
||||||
|
http:
|
||||||
|
method: POST
|
||||||
|
url: https://jsonplaceholder.typicode.com/posts
|
||||||
|
body:
|
||||||
|
type: json
|
||||||
|
data: |-
|
||||||
|
{
|
||||||
|
"title": "Мой первый покемон",
|
||||||
|
"body": "Поймал Пикачу!",
|
||||||
|
"userId": 1
|
||||||
|
}
|
||||||
|
auth: inherit
|
||||||
|
|
||||||
|
settings:
|
||||||
|
encodeUrl: true
|
||||||
|
timeout: 0
|
||||||
|
followRedirects: true
|
||||||
|
maxRedirects: 5
|
||||||
|
forwardAuthorizationHeader: false
|
||||||
|
|
||||||
|
docs: |-
|
||||||
|
5 запрос:
|
||||||
|
|
||||||
|
Создания ресурсов
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
info:
|
||||||
|
name: 6 request
|
||||||
|
type: http
|
||||||
|
seq: 6
|
||||||
|
|
||||||
|
http:
|
||||||
|
method: GET
|
||||||
|
url: https://pokeapi.co/api/v2/pokemon/unknown-pokemon-xyz
|
||||||
|
auth: inherit
|
||||||
|
|
||||||
|
settings:
|
||||||
|
encodeUrl: true
|
||||||
|
timeout: 0
|
||||||
|
followRedirects: true
|
||||||
|
maxRedirects: 5
|
||||||
|
forwardAuthorizationHeader: false
|
||||||
|
|
||||||
|
docs: |-
|
||||||
|
запрос 6:
|
||||||
|
|
||||||
|
Вывод ошибки
|
||||||
|
|
||||||
|
<br/>
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
opencollection: 1.0.0
|
opencollection: 1.0.0
|
||||||
|
|
||||||
info:
|
info:
|
||||||
name: Lab1 — PokeAPI
|
name: lab-01 - PokeAPI
|
||||||
bundled: false
|
bundled: false
|
||||||
extensions:
|
extensions:
|
||||||
bruno:
|
bruno:
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
info:
|
||||||
|
name: request bonus
|
||||||
|
type: http
|
||||||
|
seq: 7
|
||||||
|
|
||||||
|
http:
|
||||||
|
method: GET
|
||||||
|
url: https://pokeapi.co/api/v2/pokemon?limit=3&offset=10
|
||||||
|
params:
|
||||||
|
- name: limit
|
||||||
|
value: "3"
|
||||||
|
type: query
|
||||||
|
- name: offset
|
||||||
|
value: "10"
|
||||||
|
type: query
|
||||||
|
auth: inherit
|
||||||
|
|
||||||
|
settings:
|
||||||
|
encodeUrl: true
|
||||||
|
timeout: 0
|
||||||
|
followRedirects: true
|
||||||
|
maxRedirects: 5
|
||||||
|
forwardAuthorizationHeader: false
|
||||||
|
|
||||||
|
docs: |-
|
||||||
|
запрос 7:
|
||||||
|
|
||||||
|
Вывод информация о покемонах 3 со смещением 10
|
||||||
@@ -0,0 +1,185 @@
|
|||||||
|
{
|
||||||
|
"openapi": "3.1.1",
|
||||||
|
"info": {
|
||||||
|
"title": "PokedexApi | v1",
|
||||||
|
"version": "1.0.0"
|
||||||
|
},
|
||||||
|
"servers": [
|
||||||
|
{
|
||||||
|
"url": "http://localhost:5211/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"paths": {
|
||||||
|
"/hello": {
|
||||||
|
"get": {
|
||||||
|
"tags": [
|
||||||
|
"PokedexApi"
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK",
|
||||||
|
"content": {
|
||||||
|
"text/plain": {
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/pokemons": {
|
||||||
|
"get": {
|
||||||
|
"tags": [
|
||||||
|
"PokedexApi"
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"post": {
|
||||||
|
"tags": [
|
||||||
|
"PokedexApi"
|
||||||
|
],
|
||||||
|
"requestBody": {
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/PokemonInput"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/pokemons/{id}": {
|
||||||
|
"get": {
|
||||||
|
"tags": [
|
||||||
|
"PokedexApi"
|
||||||
|
],
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"in": "path",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"pattern": "^-?(?:0|[1-9]\\d*)$",
|
||||||
|
"type": [
|
||||||
|
"integer",
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"format": "int32"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"put": {
|
||||||
|
"tags": [
|
||||||
|
"PokedexApi"
|
||||||
|
],
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"in": "path",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"pattern": "^-?(?:0|[1-9]\\d*)$",
|
||||||
|
"type": [
|
||||||
|
"integer",
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"format": "int32"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"requestBody": {
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/PokemonInput"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"delete": {
|
||||||
|
"tags": [
|
||||||
|
"PokedexApi"
|
||||||
|
],
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"in": "path",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"pattern": "^-?(?:0|[1-9]\\d*)$",
|
||||||
|
"type": [
|
||||||
|
"integer",
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"format": "int32"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"components": {
|
||||||
|
"schemas": {
|
||||||
|
"PokemonInput": {
|
||||||
|
"required": [
|
||||||
|
"name",
|
||||||
|
"type",
|
||||||
|
"level"
|
||||||
|
],
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"level": {
|
||||||
|
"pattern": "^-?(?:0|[1-9]\\d*)$",
|
||||||
|
"type": [
|
||||||
|
"integer",
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"format": "int32"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"name": "PokedexApi"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -105,4 +105,124 @@ CREATE TABLE caught_pokemon (
|
|||||||
catch_region_id INTEGER REFERENCES region(region_id) ON DELETE SET NULL
|
catch_region_id INTEGER REFERENCES region(region_id) ON DELETE SET NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
INSERT INTO ability (ability_name, ability_description, ability_is_hidden) VALUES
|
||||||
|
('Overgrow', 'Усиливает травяные приёмы при низком HP', false),
|
||||||
|
('Chlorophyll', 'Удваивает скорость под ярким солнцем', false),
|
||||||
|
('Blaze', 'Усиливает огненные приёмы при низком HP', false),
|
||||||
|
('Solar Power', 'Повышает Sp. Atk на солнце, но теряет HP', true),
|
||||||
|
('Torrent', 'Усиливает водные приёмы при низком HP', false),
|
||||||
|
('Rain Dish', 'Восстанавливает HP под дождём', true),
|
||||||
|
('Shield Dust', 'Блокирует дополнительные эффекты атак', false),
|
||||||
|
('Run Away', 'Гарантирует побег от диких покемонов', false),
|
||||||
|
('Keen Eye', 'Не понижает точность', false),
|
||||||
|
('Tangled Feet', 'Повышает уклонение при путанице', true),
|
||||||
|
('Intimidate', 'Понижает атаку противника при выходе', false),
|
||||||
|
('Static', 'Может парализовать при контакте', false),
|
||||||
|
('Lightning Rod', 'Притягивает электрические атаки', true),
|
||||||
|
('Sand Veil', 'Повышает уклонение в песчаную бурю', false),
|
||||||
|
('Poison Point', 'Может отравить при контакте', false),
|
||||||
|
('Rivalry', 'Усиливает атаки против соперников того же пола', false),
|
||||||
|
('Levitate', 'Иммунитет к наземным атакам', false),
|
||||||
|
('Flash Fire', 'Поглощает огненные атаки и усиливает свои', false),
|
||||||
|
('Drought', 'Вызывает яркое солнце при выходе', true),
|
||||||
|
('Speed Boost', 'Повышает скорость каждый ход', true);
|
||||||
|
|
||||||
|
INSERT INTO move (move_name, type_id, move_category, move_power, move_accuracy, move_pp, move_description) VALUES
|
||||||
|
('Tackle', 1, 'physical', 40, 100, 35, 'Простой физический удар'),
|
||||||
|
('Growl', 1, 'status', NULL, 100, 40, 'Понижает атаку противника'),
|
||||||
|
('Vine Whip', 5, 'physical', 45, 100, 25, 'Удар лозой'),
|
||||||
|
('Razor Leaf', 5, 'physical', 55, 95, 25, 'Острые листья с высоким шансом крита'),
|
||||||
|
('Ember', 2, 'special', 40, 100, 25, 'Небольшой огненный шар'),
|
||||||
|
('Flamethrower', 2, 'special', 90, 100, 15, 'Мощная струя пламени'),
|
||||||
|
('Water Gun', 3, 'special', 40, 100, 25, 'Струя воды'),
|
||||||
|
('Hydro Pump', 3, 'special', 110, 80, 5, 'Мощный поток воды'),
|
||||||
|
('Thunder Shock', 4, 'special', 40, 100, 30, 'Электрический разряд с шансом паралича'),
|
||||||
|
('Thunderbolt', 4, 'special', 90, 100, 15, 'Сильный электрический удар'),
|
||||||
|
('Quick Attack', 1, 'physical', 40, 100, 30, 'Всегда бьёт первым'),
|
||||||
|
('Body Slam', 1, 'physical', 85, 100, 15, 'Тяжёлый удар телом с шансом паралича'),
|
||||||
|
('Ice Beam', 6, 'special', 90, 100, 10, 'Ледяной луч с шансом заморозки'),
|
||||||
|
('Blizzard', 6, 'special', 110, 70, 5, 'Мощная снежная буря'),
|
||||||
|
('Karate Chop', 7, 'physical', 50, 100, 25, 'Рубящий удар с высоким шансом крита'),
|
||||||
|
('Sludge Bomb', 8, 'special', 90, 100, 10, 'Бомба из токсичного ила'),
|
||||||
|
('Earthquake', 9, 'physical', 100, 100, 10, 'Мощное сотрясение земли'),
|
||||||
|
('Wing Attack', 10, 'physical', 60, 100, 35, 'Удар крылом'),
|
||||||
|
('Psychic', 11, 'special', 90, 100, 10, 'Психическая атака с шансом понизить Sp. Def'),
|
||||||
|
('Leech Life', 12, 'physical', 80, 100, 10, 'Высасывает HP противника'),
|
||||||
|
('Rock Slide', 13, 'physical', 75, 90, 10, 'Камнепад с шансом испуга'),
|
||||||
|
('Shadow Ball', 14, 'special', 80, 100, 15, 'Шар теней с шансом понизить Sp. Def'),
|
||||||
|
('Dragon Claw', 15, 'physical', 80, 100, 15, 'Удар драконьим когтем'),
|
||||||
|
('Crunch', 16, 'physical', 80, 100, 15, 'Укус с шансом понизить защиту'),
|
||||||
|
('Iron Tail', 17, 'physical', 100, 75, 15, 'Удар стальным хвостом'),
|
||||||
|
('Dazzling Gleam', 18, 'special', 80, 100, 10, 'Ослепительная вспышка'),
|
||||||
|
('Swords Dance', 1, 'status', NULL, NULL, 20, 'Сильно повышает атаку'),
|
||||||
|
('Recover', 1, 'status', NULL, NULL, 25, 'Восстанавливает половину HP'),
|
||||||
|
('Rest', 11, 'status', NULL, NULL, 5, 'Полностью восстанавливает HP и засыпает'),
|
||||||
|
('Surf', 3, 'special', 90, 100, 15, 'Большая волна, бьющая всех вокруг');
|
||||||
|
|
||||||
|
INSERT INTO pokemon (pokemon_national_dex_number, pokemon_name, pokemon_species, pokemon_height, pokemon_weight, pokemon_base_hp, pokemon_base_attack, pokemon_base_defense,
|
||||||
|
pokemon_base_sp_attack, pokemon_base_sp_defense, pokemon_base_speed, pokemon_is_legendary, pokemon_is_mythical, region_id, pokemon_description) VALUES
|
||||||
|
(1, 'Bulbasaur', 'Seed Pokémon', 0.70, 6.90, 45, 49, 49, 65, 65, 45, false, false, 1, 'На спине носит семечко, которое растёт вместе с ним'),
|
||||||
|
(2, 'Ivysaur', 'Seed Pokémon', 1.00, 13.00, 60, 62, 63, 80, 80, 60, false, false, 1, 'Бутон на спине готовится расцвести'),
|
||||||
|
(3, 'Venusaur', 'Seed Pokémon', 2.00, 100.00, 80, 82, 83, 100, 100, 80, false, false, 1, 'Цветок на спине испускает приятный аромат'),
|
||||||
|
(4, 'Charmander', 'Lizard Pokémon', 0.60, 8.50, 39, 52, 43, 60, 50, 65, false, false, 1, 'Огонь на хвосте гаснет, если покемон слаб'),
|
||||||
|
(5, 'Charmeleon', 'Flame Pokémon', 1.10, 19.00, 58, 64, 58, 80, 65, 80, false, false, 1, 'Жестокий покемон, любит сражения'),
|
||||||
|
(6, 'Charizard', 'Flame Pokémon', 1.70, 90.50, 78, 84, 78, 109, 85, 100, false, false, 1, 'Летающий дракон, дышащий огнём'),
|
||||||
|
(7, 'Squirtle', 'Tiny Turtle Pokémon', 0.50, 9.00, 44, 48, 65, 50, 64, 43, false, false, 1, 'Прячется в панцирь при опасности'),
|
||||||
|
(8, 'Wartortle', 'Turtle Pokémon', 1.00, 22.50, 59, 63, 80, 65, 80, 58, false, false, 1, 'Символ долголетия, хвост покрыт мехом'),
|
||||||
|
(9, 'Blastoise', 'Shellfish Pokémon', 1.60, 85.50, 79, 83, 100, 85, 105, 78, false, false, 1, 'Струи воды из пушек на панцире пробивают сталь'),
|
||||||
|
(10, 'Caterpie', 'Worm Pokémon', 0.30, 2.90, 45, 30, 35, 20, 20, 45, false, false, 1, 'Выделяет нить для ловли врагов'),
|
||||||
|
(12, 'Butterfree', 'Butterfly Pokémon', 1.10, 32.00, 60, 45, 50, 90, 80, 70, false, false, 1, 'Крылья покрыты водоотталкивающей пыльцой'),
|
||||||
|
(25, 'Pikachu', 'Mouse Pokémon', 0.40, 6.00, 35, 55, 40, 50, 50, 90, false, false, 1, 'Накапливает электричество в щеках'),
|
||||||
|
(26, 'Raichu', 'Mouse Pokémon', 0.80, 30.00, 60, 90, 55, 90, 80, 110, false, false, 1, 'Хвост служит заземлением'),
|
||||||
|
(133, 'Eevee', 'Evolution Pokémon', 0.30, 6.50, 55, 55, 50, 45, 65, 55, false, false, 1, 'Нестабильная генетика позволяет много эволюций'),
|
||||||
|
(134, 'Vaporeon', 'Bubble Jet Pokémon', 1.00, 29.00, 130, 65, 60, 110, 95, 65, false, false, 1, 'Клетки тела похожи на воду'),
|
||||||
|
(135, 'Jolteon', 'Lightning Pokémon', 0.80, 24.50, 65, 65, 60, 110, 95, 130, false, false, 1, 'Шерсть накапливает электричество'),
|
||||||
|
(136, 'Flareon', 'Flame Pokémon', 0.90, 25.00, 65, 130, 60, 95, 110, 65, false, false, 1, 'Температура тела достигает 900 °C'),
|
||||||
|
(143, 'Snorlax', 'Sleeping Pokémon', 2.10, 460.00, 160, 110, 65, 65, 110, 30, false, false, 1, 'Ест и спит почти всё время'),
|
||||||
|
(150, 'Mewtwo', 'Genetic Pokémon', 2.00, 122.00, 106, 110, 90, 154, 90, 130, true, false, 1, 'Создан из ДНК Мью, обладает огромной силой'),
|
||||||
|
(151, 'Mew', 'New Species Pokémon', 0.40, 4.00, 100, 100, 100, 100, 100, 100, false, true, 1, 'Считается предком всех покемонов'),
|
||||||
|
(152, 'Chikorita', 'Leaf Pokémon', 0.90, 6.40, 45, 49, 65, 49, 65, 45, false, false, 2, 'Лист на голове определяет настроение'),
|
||||||
|
(155, 'Cyndaquil', 'Fire Mouse Pokémon', 0.50, 7.90, 39, 52, 43, 60, 50, 65, false, false, 2, 'Выпускает огонь из спины при угрозе'),
|
||||||
|
(158, 'Totodile', 'Big Jaw Pokémon', 0.60, 9.50, 50, 65, 64, 44, 48, 43, false, false, 2, 'Мощные челюсти способны перекусить всё'),
|
||||||
|
(249, 'Lugia', 'Diving Pokémon', 5.20, 216.00, 106, 90, 130, 90, 154, 110, true, false, 2, 'Страж морей, живёт в глубоких впадинах'),
|
||||||
|
(252, 'Treecko', 'Wood Gecko Pokémon', 0.50, 5.00, 40, 45, 35, 65, 55, 70, false, false, 3, 'Лазает по стенам благодаря клейким лапам'),
|
||||||
|
(255, 'Torchic', 'Chick Pokémon', 0.40, 2.50, 45, 60, 40, 70, 50, 45, false, false, 3, 'Плюётся огнём, внутри пылает пламя'),
|
||||||
|
(258, 'Mudkip', 'Mud Fish Pokémon', 0.40, 7.60, 50, 70, 50, 50, 50, 40, false, false, 3, 'Плавник на голове чувствует движение воды'),
|
||||||
|
(384, 'Rayquaza', 'Sky High Pokémon', 7.00, 206.50, 105, 150, 90, 150, 90, 95, true, false, 3, 'Живёт в озоновом слое и управляет погодой'),
|
||||||
|
(387, 'Turtwig', 'Tiny Leaf Pokémon', 0.40, 10.20, 55, 68, 64, 45, 55, 31, false, false, 4, 'Панцирь из земли, пьёт воду кожей'),
|
||||||
|
(390, 'Chimchar', 'Chimp Pokémon', 0.50, 6.20, 44, 58, 44, 58, 44, 61, false, false, 4, 'Огонь на хвосте горит постоянно'),
|
||||||
|
(393, 'Piplup', 'Penguin Pokémon', 0.40, 5.20, 53, 51, 53, 61, 56, 40, false, false, 4, 'Гордый покемон, не любит принимать еду'),
|
||||||
|
(493, 'Arceus', 'Alpha Pokémon', 3.20, 320.00, 120, 120, 120, 120, 120, 120, false, true, 4, 'Считается создателем вселенной покемонов');
|
||||||
|
|
||||||
|
INSERT INTO region (region_name, region_generation, region_description) VALUES
|
||||||
|
('Kanto', 1, 'Первый регион, где началась история покемонов'),
|
||||||
|
('Johto', 2, 'Регион с богатой историей и традициями'),
|
||||||
|
('Hoenn', 3, 'Тропический регион с большим количеством воды'),
|
||||||
|
('Sinnoh', 4, 'Холодный северный регион с горами'),
|
||||||
|
('Unova', 5, 'Регион, вдохновлённый Нью-Йорком'),
|
||||||
|
('Kalos', 6, 'Регион, вдохновлённый Францией'),
|
||||||
|
('Alola', 7, 'Тропический архипелаг из четырёх островов'),
|
||||||
|
('Galar', 8, 'Регион, вдохновлённый Великобританией'),
|
||||||
|
('Paldea', 9, 'Пиренейский регион с открытым миром');
|
||||||
|
|
||||||
|
INSERT INTO type (type_name, type_color_hex) VALUES
|
||||||
|
('Normal', '#A8A77A'),
|
||||||
|
('Fire', '#EE8130'),
|
||||||
|
('Water', '#6390F0'),
|
||||||
|
('Electric', '#F7D02C'),
|
||||||
|
('Grass', '#7AC74C'),
|
||||||
|
('Ice', '#96D9D6'),
|
||||||
|
('Fighting', '#C22E28'),
|
||||||
|
('Poison', '#A33EA1'),
|
||||||
|
('Ground', '#E2BF65'),
|
||||||
|
('Flying', '#A98FF3'),
|
||||||
|
('Psychic', '#F95587'),
|
||||||
|
('Bug', '#A6B91A'),
|
||||||
|
('Rock', '#86A136'),
|
||||||
|
('Ghost', '#735797'),
|
||||||
|
('Dragon', '#6F35FC'),
|
||||||
|
('Dark', '#705746'),
|
||||||
|
('Steel', '#B7B7CE'),
|
||||||
|
('Fairy', '#D685AD');
|
||||||
|
|
||||||
|
SELECT * FROM type
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
PS Z:\> Get-Service -Name postgresql*
|
|
||||||
PS Z:\> Start-Service -Name postgresql-x64-14 26.1.5
|
|
||||||
Start-Service : Не удается найти позиционный параметр, принимающий аргумент "26.1.5".
|
|
||||||
строка:1 знак:1
|
|
||||||
+ Start-Service -Name postgresql-x64-14 26.1.5
|
|
||||||
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
+ CategoryInfo : InvalidArgument: (:) [Start-Service], ParameterBindingException
|
|
||||||
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.StartServiceCommand
|
|
||||||
|
|
||||||
PS Z:\> docker ps
|
|
||||||
failed to connect to the docker API at npipe:////./pipe/dockerDesktopLinuxEngine; check if the path is correct and if the daemon is running: open //./pipe/dockerDesktopLinuxEngine: The system cannot find the file specified.
|
|
||||||
PS Z:\> docker ps -a
|
|
||||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
|
||||||
a9d7eff4a438 postgres "docker-entrypoint.s…" 6 weeks ago Exited (1) 6 weeks ago test
|
|
||||||
PS Z:\> docker start postgres
|
|
||||||
Error response from daemon: No such container: postgres
|
|
||||||
failed to start containers: postgres
|
|
||||||
PS Z:\> docker start test
|
|
||||||
test
|
|
||||||
PS Z:\> docker ps
|
|
||||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
|
||||||
PS Z:\> docker logs test
|
|
||||||
Error: Database is uninitialized and superuser password is not specified.
|
|
||||||
You must specify POSTGRES_PASSWORD to a non-empty value for the
|
|
||||||
superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
|
|
||||||
|
|
||||||
You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
|
|
||||||
connections without a password. This is *not* recommended.
|
|
||||||
|
|
||||||
See PostgreSQL documentation about "trust":
|
|
||||||
https://www.postgresql.org/docs/current/auth-trust.html
|
|
||||||
Error: Database is uninitialized and superuser password is not specified.
|
|
||||||
You must specify POSTGRES_PASSWORD to a non-empty value for the
|
|
||||||
superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
|
|
||||||
|
|
||||||
You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
|
|
||||||
connections without a password. This is *not* recommended.
|
|
||||||
|
|
||||||
See PostgreSQL documentation about "trust":
|
|
||||||
https://www.postgresql.org/docs/current/auth-trust.html
|
|
||||||
Error: Database is uninitialized and superuser password is not specified.
|
|
||||||
You must specify POSTGRES_PASSWORD to a non-empty value for the
|
|
||||||
superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
|
|
||||||
|
|
||||||
PS Z:\> docker rm test
|
|
||||||
test
|
|
||||||
PS Z:\> docker run --name test -p 5432:5432 -e POSTGRES_PASSWORD=pokedex_pass -d postgres
|
|
||||||
37830188239ba74b3fb1bdaaee83681304754f815f2ffeae507900b85f82b2d8
|
|
||||||
PS Z:\> docker ps
|
|
||||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
|
||||||
37830188239b postgres "docker-entrypoint.s…" 18 seconds ago Up 17 seconds 0.0.0.0:5432->5432/tcp, [::]:5432->5432/tcp test
|
|
||||||
PS Z:\>
|
|
||||||
Reference in New Issue
Block a user