新增azure推送

This commit is contained in:
杨毅 2024-11-03 00:08:34 +08:00
parent f03c17173b
commit ca62863f00
7 changed files with 1330 additions and 12 deletions

View File

@ -113,7 +113,7 @@ namespace asg_form.Controllers
[Route("api/v1/com/")]
[HttpDelete]
[Authorize]
public async Task<ActionResult<string>> com_del(long gameid)
public async Task<ActionResult<string>> com_del(long gameid,string Cancellation_Reason )
{
string id = this.User.FindFirst(ClaimTypes.NameIdentifier)!.Value;
var user = await userManager.FindByIdAsync(id);
@ -141,7 +141,7 @@ namespace asg_form.Controllers
await testDb.SaveChangesAsync();
try
{
var message = new MessageBuilder().Add(new AtSegment(user.qqnumber ?? "2667210109")).Text($"解说:\r\n{chinaname}\r\n取消了比赛:\r\n{teamgame.team1_name} VS {teamgame.team2_name}").Build();
var message = new MessageBuilder().Add(new AtSegment(user.qqnumber ?? "2667210109")).Text($"解说:\r\n{chinaname}\r\n取消了比赛:\r\n{teamgame.team1_name} VS {teamgame.team2_name}\r\n原因:{Cancellation_Reason}").Build();
await runbot.runbotr.SendMessageAsync(MessageEnvironment.Channel, "925510646", null, message, "925510646");

View File

@ -133,7 +133,7 @@ namespace asg_form.Controllers
}
else
{
return BadRequest(new error_mb { code = 400, message = "没P管理员隔着装尼玛呢" });
return BadRequest(new error_mb { code = 400, message = "没管理员就别调用,嘻嘻" });
}
}

View File

@ -406,6 +406,7 @@ namespace asg_form.Controllers
/// 裁判的名字
/// </summary>
public string referee { get; set; }
public int? referee_Id { get; set; }
/// <summary>
/// bilibili录屏路径
/// </summary>
@ -416,6 +417,8 @@ namespace asg_form.Controllers
public List<schedule_log> logs { get; set; } = new List<schedule_log>();
public string? judge { get; set; }
public int? judge_Id { get; set; }
public int com_limit { get; set; } = 2;
public string? person_type { get; set; }
public string? final_score { get; set; }

View File

@ -1,9 +1,13 @@
using Manganese.Text;
using Flandre.Core.Common;
using Flandre.Core.Messaging.Segments;
using Flandre.Core.Messaging;
using Manganese.Text;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
using NLog;
using RestSharp;
using System.Diagnostics;
using static asg_form.Controllers.InviteReferee;
namespace asg_form.Controllers
{
@ -34,8 +38,48 @@ namespace asg_form.Controllers
{
return Ok("ok");
}
}
[Route("api/v1/Codepush/")]
[HttpPost]
public async Task<object> Codepush([FromBody]dynamic date)
{
try {
var message = new MessageBuilder().Text($"后端推送了新的代码库\r\n详细信息{date.messages.text}").Build();
await runbot.runbotr.SendMessageAsync(MessageEnvironment.Channel, "931217544", null, message, "931217544");
}
catch
{
}
return "ok";
}
[Route("api/v1/issueadd/")]
[HttpPost]
public async Task<object> issueadd([FromBody] dynamic date)
{
try
{
var message = new MessageBuilder().Text($"后端有新bug被提交请及时解决\r\n详细信息{date.messages.text}").Build();
await runbot.runbotr.SendMessageAsync(MessageEnvironment.Channel, "931217544", null, message, "931217544");
}
catch
{
}
return "ok";
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,162 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace asg_form.Migrations
{
/// <inheritdoc />
public partial class sh1 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_AspNetUsers_F_Team_myteamId",
table: "AspNetUsers");
migrationBuilder.AlterColumn<string>(
name: "opentime",
table: "F_game",
type: "text",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AddColumn<string>(
name: "final_score",
table: "F_game",
type: "text",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "judge_Id",
table: "F_game",
type: "integer",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "referee_Id",
table: "F_game",
type: "integer",
nullable: true);
migrationBuilder.AlterColumn<int>(
name: "point",
table: "AspNetUsers",
type: "integer",
nullable: true,
oldClrType: typeof(int),
oldType: "integer");
migrationBuilder.AlterColumn<long>(
name: "myteamId",
table: "AspNetUsers",
type: "bigint",
nullable: true,
oldClrType: typeof(long),
oldType: "bigint");
migrationBuilder.AddColumn<string>(
name: "roleListCode",
table: "AspNetUsers",
type: "text",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "roleListName",
table: "AspNetUsers",
type: "text",
nullable: true);
migrationBuilder.AlterColumn<string>(
name: "msg",
table: "AspNetRoles",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AddForeignKey(
name: "FK_AspNetUsers_F_Team_myteamId",
table: "AspNetUsers",
column: "myteamId",
principalTable: "F_Team",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_AspNetUsers_F_Team_myteamId",
table: "AspNetUsers");
migrationBuilder.DropColumn(
name: "final_score",
table: "F_game");
migrationBuilder.DropColumn(
name: "judge_Id",
table: "F_game");
migrationBuilder.DropColumn(
name: "referee_Id",
table: "F_game");
migrationBuilder.DropColumn(
name: "roleListCode",
table: "AspNetUsers");
migrationBuilder.DropColumn(
name: "roleListName",
table: "AspNetUsers");
migrationBuilder.AlterColumn<DateTime>(
name: "opentime",
table: "F_game",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<int>(
name: "point",
table: "AspNetUsers",
type: "integer",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "integer",
oldNullable: true);
migrationBuilder.AlterColumn<long>(
name: "myteamId",
table: "AspNetUsers",
type: "bigint",
nullable: false,
defaultValue: 0L,
oldClrType: typeof(long),
oldType: "bigint",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "msg",
table: "AspNetRoles",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AddForeignKey(
name: "FK_AspNetUsers_F_Team_myteamId",
table: "AspNetUsers",
column: "myteamId",
principalTable: "F_Team",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

View File

@ -696,11 +696,18 @@ namespace asg_form.Migrations
.IsRequired()
.HasColumnType("text");
b.Property<string>("final_score")
.HasColumnType("text");
b.Property<string>("judge")
.HasColumnType("text");
b.Property<DateTime>("opentime")
.HasColumnType("timestamp with time zone");
b.Property<int?>("judge_Id")
.HasColumnType("integer");
b.Property<string>("opentime")
.IsRequired()
.HasColumnType("text");
b.Property<string>("person_type")
.HasColumnType("text");
@ -709,6 +716,9 @@ namespace asg_form.Migrations
.IsRequired()
.HasColumnType("text");
b.Property<int?>("referee_Id")
.HasColumnType("integer");
b.Property<string>("tag")
.HasColumnType("text");
@ -755,7 +765,6 @@ namespace asg_form.Migrations
.HasColumnType("character varying(256)");
b.Property<string>("msg")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
@ -837,18 +846,24 @@ namespace asg_form.Migrations
b.Property<bool?>("isbooking")
.HasColumnType("boolean");
b.Property<long>("myteamId")
b.Property<long?>("myteamId")
.HasColumnType("bigint");
b.Property<string>("officium")
.HasColumnType("text");
b.Property<int>("point")
b.Property<int?>("point")
.HasColumnType("integer");
b.Property<string>("qqnumber")
.HasColumnType("text");
b.Property<string>("roleListCode")
.HasColumnType("text");
b.Property<string>("roleListName")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
@ -1041,9 +1056,7 @@ namespace asg_form.Migrations
b.HasOne("asg_form.Controllers.Team.T_Team", "myteam")
.WithMany()
.HasForeignKey("myteamId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
.HasForeignKey("myteamId");
b.Navigation("haveform");