Skip to content

Commit

Permalink
Merge pull request #39 from Atralupus/fix/bugs
Browse files Browse the repository at this point in the history
Fix/bugs
  • Loading branch information
Atralupus authored Dec 26, 2024
2 parents 286585a + 9b9479a commit 8cae5ba
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/ArenaService/bin/Debug/net9.0/ArenaService.dll",
"program": "${workspaceFolder}/ArenaService/bin/Debug/net8.0/ArenaService.dll",
"cwd": "${workspaceFolder}/ArenaService",
"stopAtEntry": false,
"env": {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ protected override void Up(MigrationBuilder migrationBuilder)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
start_block_index = table.Column<long>(type: "bigint", nullable: false),
end_block_index = table.Column<long>(type: "bigint", nullable: false),
ticket_refill_interval = table.Column<int>(type: "integer", nullable: false)
ticket_refill_interval = table.Column<int>(type: "integer", nullable: false),
is_activated = table.Column<bool>(type: "boolean", nullable: false)
},
constraints: table =>
{
Expand All @@ -35,7 +36,6 @@ protected override void Up(MigrationBuilder migrationBuilder)
avatar_address = table.Column<string>(type: "text", nullable: false),
name_with_hash = table.Column<string>(type: "text", nullable: false),
season_id = table.Column<int>(type: "integer", nullable: false),
cp = table.Column<int>(type: "integer", nullable: false),
portrait_id = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
Expand Down Expand Up @@ -86,10 +86,11 @@ protected override void Up(MigrationBuilder migrationBuilder)
participant_id = table.Column<int>(type: "integer", nullable: false),
opponent_id = table.Column<int>(type: "integer", nullable: false),
season_id = table.Column<int>(type: "integer", nullable: false),
battle_block_index = table.Column<long>(type: "bigint", nullable: false),
is_victory = table.Column<bool>(type: "boolean", nullable: false),
participant_score_change = table.Column<int>(type: "integer", nullable: false),
opponent_score_change = table.Column<int>(type: "integer", nullable: false)
token = table.Column<string>(type: "text", nullable: false),
is_victory = table.Column<bool>(type: "boolean", nullable: true),
participant_score_change = table.Column<int>(type: "integer", nullable: true),
opponent_score_change = table.Column<int>(type: "integer", nullable: true),
battle_block_index = table.Column<long>(type: "bigint", nullable: true)
},
constraints: table =>
{
Expand Down
24 changes: 15 additions & 9 deletions ArenaService/Migrations/ArenaDbContextModelSnapshot.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// <auto-generated />
using System;
using ArenaService.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
Expand All @@ -16,7 +17,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.0")
.HasAnnotation("ProductVersion", "8.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 63);

NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
Expand Down Expand Up @@ -67,34 +68,39 @@ protected override void BuildModel(ModelBuilder modelBuilder)

NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

b.Property<long>("BattleBlockIndex")
b.Property<long?>("BattleBlockIndex")
.HasColumnType("bigint")
.HasColumnName("battle_block_index");

b.Property<bool>("IsVictory")
b.Property<bool?>("IsVictory")
.HasColumnType("boolean")
.HasColumnName("is_victory");

b.Property<int>("OpponentId")
.HasColumnType("integer")
.HasColumnName("opponent_id");

b.Property<int>("OpponentScoreChange")
b.Property<int?>("OpponentScoreChange")
.HasColumnType("integer")
.HasColumnName("opponent_score_change");

b.Property<int>("ParticipantId")
.HasColumnType("integer")
.HasColumnName("participant_id");

b.Property<int>("ParticipantScoreChange")
b.Property<int?>("ParticipantScoreChange")
.HasColumnType("integer")
.HasColumnName("participant_score_change");

b.Property<int>("SeasonId")
.HasColumnType("integer")
.HasColumnName("season_id");

b.Property<string>("Token")
.IsRequired()
.HasColumnType("text")
.HasColumnName("token");

b.HasKey("Id")
.HasName("pk_battle_logs");

Expand Down Expand Up @@ -161,10 +167,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnType("text")
.HasColumnName("avatar_address");

b.Property<int>("Cp")
.HasColumnType("integer")
.HasColumnName("cp");

b.Property<string>("NameWithHash")
.IsRequired()
.HasColumnType("text")
Expand Down Expand Up @@ -203,6 +205,10 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnType("bigint")
.HasColumnName("end_block_index");

b.Property<bool>("IsActivated")
.HasColumnType("boolean")
.HasColumnName("is_activated");

b.Property<long>("StartBlockIndex")
.HasColumnType("bigint")
.HasColumnName("start_block_index");
Expand Down
8 changes: 8 additions & 0 deletions ArenaService/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using ArenaService.Data;
using ArenaService.Repositories;
using ArenaService.Services;
using Microsoft.EntityFrameworkCore;

var builder = WebApplication.CreateBuilder(args);
Expand All @@ -14,6 +15,13 @@
builder.Services.AddSwaggerGen();

builder.Services.AddScoped<ISeasonRepository, SeasonRepository>();
builder.Services.AddScoped<SeasonService>();
builder.Services.AddScoped<IParticipantRepository, ParticipantRepository>();
builder.Services.AddScoped<ParticipantService>();
builder.Services.AddScoped<IAvailableOpponentRepository, AvailableOpponentRepository>();
builder.Services.AddScoped<AvailableOpponentService>();
builder.Services.AddScoped<IBattleLogRepository, BattleLogRepository>();
builder.Services.AddScoped<ILeaderboardRepository, LeaderboardRepository>();

builder.Services.AddCors(options =>
{
Expand Down

0 comments on commit 8cae5ba

Please sign in to comment.