Switch awardtypeid to int + fix /at help

This commit is contained in:
Nikolay Kochulin 2019-11-17 13:41:25 +00:00
parent b0632cf3b7
commit 3942b17c64
7 changed files with 8 additions and 8 deletions

View File

@ -91,7 +91,7 @@ namespace JetKarmaBot.Commands
var text = args.Message.Text;
string awardTypeAcc, awardTypeSym;
sbyte? awardTypeId;
int? awardTypeId;
if (awardTypeText == null || awardTypeText == "star")
{
awardTypeAcc = currentLocale["jetkarmabot.star.accusative"];

View File

@ -30,7 +30,7 @@ namespace JetKarmaBot.Commands
VerbRouter.Add(C.GetInstance<AwardTypeManage.CreateCommand>());
VerbRouter.Add(C.GetInstance<AwardTypeManage.RemoveCommand>());
VerbRouter.Add(C.GetInstance<AwardTypeManage.SetParameterCommand>());
VerbRouter.Add(C.GetInstance<HelpCommand>());
VerbRouter.Add(C.ResolveObject(new HelpCommand()));
}
public IReadOnlyCollection<ChatCommandArgument> Arguments => new[] {

View File

@ -28,7 +28,7 @@ namespace JetKarmaBot.Commands
string response;
string awardTypeSym;
sbyte? awardTypeId;
int? awardTypeId;
if (string.IsNullOrWhiteSpace(awardTypeName) || awardTypeName == "star")
{
awardTypeId = null;

View File

@ -54,7 +54,7 @@ namespace JetKarmaBot.Commands
}
else
{
sbyte? awardTypeId;
int? awardTypeId;
string awardTypeSym;
if (awardTypeName == "star")
{

View File

@ -10,7 +10,7 @@ namespace JetKarmaBot.Models
public long ChatId { get; set; }
public int FromId { get; set; }
public int ToId { get; set; }
public sbyte? AwardTypeId { get; set; }
public int? AwardTypeId { get; set; }
public sbyte Amount { get; set; }
public DateTime Date { get; set; }
[ForeignKey("AwardTypeId")]

View File

@ -11,7 +11,7 @@ namespace JetKarmaBot.Models
Awards = new HashSet<Award>();
}
public sbyte AwardTypeId { get; set; }
public int AwardTypeId { get; set; }
public string CommandName { get; set; }
public long ChatId { get; set; }
public string NominativeName { get; set; }

View File

@ -60,7 +60,7 @@ namespace JetKarmaBot.Models
entity.Property(e => e.AwardTypeId)
.HasColumnName("awardtypeid")
.HasColumnType("tinyint(3)");
.HasColumnType("int(11)");
entity.Property(e => e.ChatId)
.HasColumnName("chatid")
@ -118,7 +118,7 @@ namespace JetKarmaBot.Models
entity.Property(e => e.AwardTypeId)
.HasColumnName("awardtypeid")
.HasColumnType("tinyint(3)");
.HasColumnType("int(11)");
entity.Property(e => e.CommandName)
.IsRequired()