提交 5a1bb822 编写于 作者: 麦壳饼's avatar 麦壳饼

修改拼写问题。 修改 租户查询 客户查询

上级 fecec1c6
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IoTSharp.Data.MySql.Migrations
{
public partial class ModifyEmailSpell : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "EMail",
table: "Tenant",
newName: "Email");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "Email",
table: "Tenant",
newName: "EMail");
}
}
}
......@@ -1864,7 +1864,7 @@ namespace IoTSharp.Data.MySql.Migrations
b.Property<bool>("Deleted")
.HasColumnType("tinyint(1)");
b.Property<string>("EMail")
b.Property<string>("Email")
.HasColumnType("longtext");
b.Property<string>("Name")
......
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IoTSharp.Migrations
{
public partial class ModifyEmailSpell : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "EMail",
table: "Tenant",
newName: "Email");
migrationBuilder.AddColumn<string>(
name: "FlowClass",
table: "Flows",
type: "text",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "FlowIcon",
table: "Flows",
type: "text",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "FlowNameSpace",
table: "Flows",
type: "text",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "FlowShapeType",
table: "Flows",
type: "text",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "FlowTag",
table: "Flows",
type: "text",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Left",
table: "Flows",
type: "text",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Top",
table: "Flows",
type: "text",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "FlowClass",
table: "Flows");
migrationBuilder.DropColumn(
name: "FlowIcon",
table: "Flows");
migrationBuilder.DropColumn(
name: "FlowNameSpace",
table: "Flows");
migrationBuilder.DropColumn(
name: "FlowShapeType",
table: "Flows");
migrationBuilder.DropColumn(
name: "FlowTag",
table: "Flows");
migrationBuilder.DropColumn(
name: "Left",
table: "Flows");
migrationBuilder.DropColumn(
name: "Top",
table: "Flows");
migrationBuilder.RenameColumn(
name: "Email",
table: "Tenant",
newName: "EMail");
}
}
}
......@@ -1256,12 +1256,27 @@ namespace IoTSharp.Migrations
b.Property<Guid?>("ExecutorId")
.HasColumnType("uuid");
b.Property<string>("FlowClass")
.HasColumnType("text");
b.Property<string>("FlowIcon")
.HasColumnType("text");
b.Property<string>("FlowNameSpace")
.HasColumnType("text");
b.Property<Guid?>("FlowRuleRuleId")
.HasColumnType("uuid");
b.Property<string>("FlowShapeType")
.HasColumnType("text");
b.Property<int>("FlowStatus")
.HasColumnType("integer");
b.Property<string>("FlowTag")
.HasColumnType("text");
b.Property<string>("FlowType")
.HasColumnType("text");
......@@ -1274,6 +1289,9 @@ namespace IoTSharp.Migrations
b.Property<string>("Incoming")
.HasColumnType("text");
b.Property<string>("Left")
.HasColumnType("text");
b.Property<string>("NodeProcessClass")
.HasColumnType("text");
......@@ -1316,6 +1334,9 @@ namespace IoTSharp.Migrations
b.Property<DateTime>("TesterDateTime")
.HasColumnType("timestamp with time zone");
b.Property<string>("Top")
.HasColumnType("text");
b.Property<string>("bpmnid")
.HasColumnType("text");
......@@ -1858,7 +1879,7 @@ namespace IoTSharp.Migrations
b.Property<bool>("Deleted")
.HasColumnType("boolean");
b.Property<string>("EMail")
b.Property<string>("Email")
.HasColumnType("text");
b.Property<string>("Name")
......
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IoTSharp.Data.SqlServer.Migrations
{
public partial class ModifyEmailSpell : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "EMail",
table: "Tenant",
newName: "Email");
migrationBuilder.AddColumn<string>(
name: "FlowClass",
table: "Flows",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "FlowIcon",
table: "Flows",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "FlowNameSpace",
table: "Flows",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "FlowShapeType",
table: "Flows",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "FlowTag",
table: "Flows",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Left",
table: "Flows",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Top",
table: "Flows",
type: "nvarchar(max)",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "FlowClass",
table: "Flows");
migrationBuilder.DropColumn(
name: "FlowIcon",
table: "Flows");
migrationBuilder.DropColumn(
name: "FlowNameSpace",
table: "Flows");
migrationBuilder.DropColumn(
name: "FlowShapeType",
table: "Flows");
migrationBuilder.DropColumn(
name: "FlowTag",
table: "Flows");
migrationBuilder.DropColumn(
name: "Left",
table: "Flows");
migrationBuilder.DropColumn(
name: "Top",
table: "Flows");
migrationBuilder.RenameColumn(
name: "Email",
table: "Tenant",
newName: "EMail");
}
}
}
......@@ -1256,12 +1256,27 @@ namespace IoTSharp.Data.SqlServer.Migrations
b.Property<Guid?>("ExecutorId")
.HasColumnType("uniqueidentifier");
b.Property<string>("FlowClass")
.HasColumnType("nvarchar(max)");
b.Property<string>("FlowIcon")
.HasColumnType("nvarchar(max)");
b.Property<string>("FlowNameSpace")
.HasColumnType("nvarchar(max)");
b.Property<Guid?>("FlowRuleRuleId")
.HasColumnType("uniqueidentifier");
b.Property<string>("FlowShapeType")
.HasColumnType("nvarchar(max)");
b.Property<int>("FlowStatus")
.HasColumnType("int");
b.Property<string>("FlowTag")
.HasColumnType("nvarchar(max)");
b.Property<string>("FlowType")
.HasColumnType("nvarchar(max)");
......@@ -1274,6 +1289,9 @@ namespace IoTSharp.Data.SqlServer.Migrations
b.Property<string>("Incoming")
.HasColumnType("nvarchar(max)");
b.Property<string>("Left")
.HasColumnType("nvarchar(max)");
b.Property<string>("NodeProcessClass")
.HasColumnType("nvarchar(max)");
......@@ -1316,6 +1334,9 @@ namespace IoTSharp.Data.SqlServer.Migrations
b.Property<DateTime>("TesterDateTime")
.HasColumnType("datetime2");
b.Property<string>("Top")
.HasColumnType("nvarchar(max)");
b.Property<string>("bpmnid")
.HasColumnType("nvarchar(max)");
......@@ -1858,7 +1879,7 @@ namespace IoTSharp.Data.SqlServer.Migrations
b.Property<bool>("Deleted")
.HasColumnType("bit");
b.Property<string>("EMail")
b.Property<string>("Email")
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
......
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IoTSharp.Data.Sqlite.Migrations
{
public partial class ModifyEmailSpell : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "EMail",
table: "Tenant",
newName: "Email");
migrationBuilder.AddColumn<string>(
name: "FlowClass",
table: "Flows",
type: "TEXT",
nullable: true,
collation: "NOCASE");
migrationBuilder.AddColumn<string>(
name: "FlowIcon",
table: "Flows",
type: "TEXT",
nullable: true,
collation: "NOCASE");
migrationBuilder.AddColumn<string>(
name: "FlowNameSpace",
table: "Flows",
type: "TEXT",
nullable: true,
collation: "NOCASE");
migrationBuilder.AddColumn<string>(
name: "FlowShapeType",
table: "Flows",
type: "TEXT",
nullable: true,
collation: "NOCASE");
migrationBuilder.AddColumn<string>(
name: "FlowTag",
table: "Flows",
type: "TEXT",
nullable: true,
collation: "NOCASE");
migrationBuilder.AddColumn<string>(
name: "Left",
table: "Flows",
type: "TEXT",
nullable: true,
collation: "NOCASE");
migrationBuilder.AddColumn<string>(
name: "Top",
table: "Flows",
type: "TEXT",
nullable: true,
collation: "NOCASE");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "FlowClass",
table: "Flows");
migrationBuilder.DropColumn(
name: "FlowIcon",
table: "Flows");
migrationBuilder.DropColumn(
name: "FlowNameSpace",
table: "Flows");
migrationBuilder.DropColumn(
name: "FlowShapeType",
table: "Flows");
migrationBuilder.DropColumn(
name: "FlowTag",
table: "Flows");
migrationBuilder.DropColumn(
name: "Left",
table: "Flows");
migrationBuilder.DropColumn(
name: "Top",
table: "Flows");
migrationBuilder.RenameColumn(
name: "Email",
table: "Tenant",
newName: "EMail");
}
}
}
......@@ -1376,12 +1376,32 @@ namespace IoTSharp.Data.Sqlite.Migrations
b.Property<Guid?>("ExecutorId")
.HasColumnType("TEXT");
b.Property<string>("FlowClass")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("FlowIcon")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("FlowNameSpace")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<Guid?>("FlowRuleRuleId")
.HasColumnType("TEXT");
b.Property<string>("FlowShapeType")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<int>("FlowStatus")
.HasColumnType("INTEGER");
b.Property<string>("FlowTag")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("FlowType")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
......@@ -1398,6 +1418,10 @@ namespace IoTSharp.Data.Sqlite.Migrations
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("Left")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("NodeProcessClass")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
......@@ -1450,6 +1474,10 @@ namespace IoTSharp.Data.Sqlite.Migrations
b.Property<DateTime>("TesterDateTime")
.HasColumnType("TEXT");
b.Property<string>("Top")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
b.Property<string>("bpmnid")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
......@@ -2052,7 +2080,7 @@ namespace IoTSharp.Data.Sqlite.Migrations
b.Property<bool>("Deleted")
.HasColumnType("INTEGER");
b.Property<string>("EMail")
b.Property<string>("Email")
.HasColumnType("TEXT")
.UseCollation("NOCASE");
......
Subproject commit 125abf54d592240cd16697f515d8cbae199d47f5
Subproject commit fd17300d6f7fbba2698c85eddde0f03d0153b34e
......@@ -356,11 +356,11 @@ namespace IoTSharp.Controllers
public async Task<ApiResult<LoginResult>> Create([FromBody] InstallDto model)
{
var tenant = _context.Tenant.FirstOrDefault(t => t.EMail == model.TenantEMail && t.Deleted==false);
var tenant = _context.Tenant.FirstOrDefault(t => t.Email == model.TenantEMail && t.Deleted==false);
var customer = _context.Customer.FirstOrDefault(t => t.Email == model.CustomerEMail && t.Deleted == false);
if (tenant == null && customer == null)
{
tenant = new Tenant() { Id = Guid.NewGuid(), Name = model.TenantName, EMail = model.TenantEMail };
tenant = new Tenant() { Id = Guid.NewGuid(), Name = model.TenantName, Email = model.TenantEMail };
customer = new Customer() { Id = Guid.NewGuid(), Name = model.CustomerName, Email = model.CustomerEMail };
customer.Tenant = tenant;
tenant.Customers = new List<Customer>();
......@@ -664,7 +664,7 @@ namespace IoTSharp.Controllers
switch (type)
{
case 1:
return new ApiResult<bool>(ApiCode.Success, "OK", _context.Tenant.Any(c => c.EMail.ToLower() == email.ToLower() && c.Deleted==false));
return new ApiResult<bool>(ApiCode.Success, "OK", _context.Tenant.Any(c => c.Email.ToLower() == email.ToLower() && c.Deleted==false));
case 2:
return new ApiResult<bool>(ApiCode.Success, "OK", _context.Customer.Any(c => c.Email.ToLower() == email.ToLower() && c.Deleted==false));
case 3:
......
......@@ -51,7 +51,7 @@ namespace IoTSharp.Controllers
/// 获取指定租户下的所有客户
/// </summary>
/// <returns></returns>
[HttpPost("Tenant/{tenantId}")]
[HttpPost("Tenant")]
[Authorize(Roles = nameof(UserRole.NormalUser))]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ApiResult), StatusCodes.Status404NotFound)]
......@@ -59,12 +59,9 @@ namespace IoTSharp.Controllers
public async Task<ApiResult<PagedData<Customer>>> GetCustomers([FromBody] CustomerParam m)
{
var profile = this.GetUserProfile();
Expression<Func<Customer, bool>> condition = x => x.Tenant.Id == profile.Tenant && x.Deleted==false;
return new ApiResult<PagedData<Customer>>(ApiCode.Success, "OK", new PagedData<Customer>
{
total = await _context.Customer.CountAsync(condition),
rows = await _context.Customer.OrderByDescending(c => c.Id).Where(condition).Skip((m.Offset) * m.Limit).Take(m.Limit).ToListAsync()
});
var querym = _context.Customer.Where(c => c.Deleted == false);
var data = await m.Query(querym, c => c.Name);
return new ApiResult<PagedData<Customer>>(ApiCode.Success, "OK", data);
}
/// <summary>
......
......@@ -119,7 +119,7 @@ namespace IoTSharp.Controllers
if (!fx.Directory.Exists) fx.Directory.Create();
var ca = _uri.CreateCA(option.CACertificateFile, option.CAPrivateKeyFile);
ca.CreateBrokerTlsCert(_uri.Host, Dns.GetHostAddresses(_uri.Host).FirstOrDefault(),
option.CertificateFile, option.PrivateKeyFile, ten.EMail);
option.CertificateFile, option.PrivateKeyFile, ten.Email);
ca.LoadCAToRoot();
result = new ApiResult(ApiCode.Success, ca.Thumbprint);
}
......
......@@ -491,11 +491,11 @@ namespace IoTSharp.Data
public async Task SeedUserAsync(InstallDto model)
{
var tenant = _context.Tenant.FirstOrDefault(t => t.EMail == model.TenantEMail && t.Deleted==false);
var tenant = _context.Tenant.FirstOrDefault(t => t.Email == model.TenantEMail && t.Deleted==false);
var customer = _context.Customer.FirstOrDefault(t => t.Email == model.CustomerEMail && t.Deleted==false);
if (tenant == null && customer == null)
{
tenant = new Tenant() { Id = Guid.NewGuid(), Name = model.TenantName, EMail = model.TenantEMail };
tenant = new Tenant() { Id = Guid.NewGuid(), Name = model.TenantName, Email = model.TenantEMail };
customer = new Customer() { Id = Guid.NewGuid(), Name = model.CustomerName, Email = model.CustomerEMail };
customer.Tenant = tenant;
tenant.Customers = new List<Customer>();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册