新增azure推送
This commit is contained in:
parent
f03c17173b
commit
ca62863f00
@ -113,7 +113,7 @@ namespace asg_form.Controllers
|
|||||||
[Route("api/v1/com/")]
|
[Route("api/v1/com/")]
|
||||||
[HttpDelete]
|
[HttpDelete]
|
||||||
[Authorize]
|
[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;
|
string id = this.User.FindFirst(ClaimTypes.NameIdentifier)!.Value;
|
||||||
var user = await userManager.FindByIdAsync(id);
|
var user = await userManager.FindByIdAsync(id);
|
||||||
@ -141,7 +141,7 @@ namespace asg_form.Controllers
|
|||||||
await testDb.SaveChangesAsync();
|
await testDb.SaveChangesAsync();
|
||||||
try
|
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");
|
await runbot.runbotr.SendMessageAsync(MessageEnvironment.Channel, "925510646", null, message, "925510646");
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ namespace asg_form.Controllers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return BadRequest(new error_mb { code = 400, message = "没P管理员隔着装尼玛呢" });
|
return BadRequest(new error_mb { code = 400, message = "没管理员就别调用,嘻嘻" });
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -406,6 +406,7 @@ namespace asg_form.Controllers
|
|||||||
/// 裁判的名字
|
/// 裁判的名字
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string referee { get; set; }
|
public string referee { get; set; }
|
||||||
|
public int? referee_Id { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// bilibili录屏路径
|
/// bilibili录屏路径
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -416,6 +417,8 @@ namespace asg_form.Controllers
|
|||||||
public List<schedule_log> logs { get; set; } = new List<schedule_log>();
|
public List<schedule_log> logs { get; set; } = new List<schedule_log>();
|
||||||
|
|
||||||
public string? judge { get; set; }
|
public string? judge { get; set; }
|
||||||
|
|
||||||
|
public int? judge_Id { get; set; }
|
||||||
public int com_limit { get; set; } = 2;
|
public int com_limit { get; set; } = 2;
|
||||||
public string? person_type { get; set; }
|
public string? person_type { get; set; }
|
||||||
public string? final_score { get; set; }
|
public string? final_score { get; set; }
|
||||||
|
@ -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 Microsoft.AspNetCore.Mvc;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using NLog;
|
using NLog;
|
||||||
using RestSharp;
|
using RestSharp;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using static asg_form.Controllers.InviteReferee;
|
||||||
|
|
||||||
namespace asg_form.Controllers
|
namespace asg_form.Controllers
|
||||||
{
|
{
|
||||||
@ -34,8 +38,48 @@ namespace asg_form.Controllers
|
|||||||
{
|
{
|
||||||
return Ok("ok");
|
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";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
1096
asg_form/Migrations/20241102154730_sh1.Designer.cs
generated
Normal file
1096
asg_form/Migrations/20241102154730_sh1.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
162
asg_form/Migrations/20241102154730_sh1.cs
Normal file
162
asg_form/Migrations/20241102154730_sh1.cs
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -696,11 +696,18 @@ namespace asg_form.Migrations
|
|||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("final_score")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("judge")
|
b.Property<string>("judge")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<DateTime>("opentime")
|
b.Property<int?>("judge_Id")
|
||||||
.HasColumnType("timestamp with time zone");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("opentime")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("person_type")
|
b.Property<string>("person_type")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
@ -709,6 +716,9 @@ namespace asg_form.Migrations
|
|||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<int?>("referee_Id")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.Property<string>("tag")
|
b.Property<string>("tag")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
@ -755,7 +765,6 @@ namespace asg_form.Migrations
|
|||||||
.HasColumnType("character varying(256)");
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
b.Property<string>("msg")
|
b.Property<string>("msg")
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
@ -837,18 +846,24 @@ namespace asg_form.Migrations
|
|||||||
b.Property<bool?>("isbooking")
|
b.Property<bool?>("isbooking")
|
||||||
.HasColumnType("boolean");
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
b.Property<long>("myteamId")
|
b.Property<long?>("myteamId")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
b.Property<string>("officium")
|
b.Property<string>("officium")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<int>("point")
|
b.Property<int?>("point")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.Property<string>("qqnumber")
|
b.Property<string>("qqnumber")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("roleListCode")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("roleListName")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("NormalizedEmail")
|
b.HasIndex("NormalizedEmail")
|
||||||
@ -1041,9 +1056,7 @@ namespace asg_form.Migrations
|
|||||||
|
|
||||||
b.HasOne("asg_form.Controllers.Team.T_Team", "myteam")
|
b.HasOne("asg_form.Controllers.Team.T_Team", "myteam")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("myteamId")
|
.HasForeignKey("myteamId");
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("haveform");
|
b.Navigation("haveform");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user