Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
IoTSharp
提交
fd242d02
I
IoTSharp
项目概览
jobily
/
IoTSharp
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
IoTSharp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fd242d02
编写于
3月 13, 2023
作者:
麦壳饼
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改租户ID的问题
上级
94340855
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
4 addition
and
10 deletion
+4
-10
IoTSharp.Data/Customer.cs
IoTSharp.Data/Customer.cs
+0
-1
IoTSharp.sln
IoTSharp.sln
+0
-4
IoTSharp/Controllers/CustomersController.cs
IoTSharp/Controllers/CustomersController.cs
+4
-5
未找到文件。
IoTSharp.Data/Customer.cs
浏览文件 @
fd242d02
...
...
@@ -20,7 +20,6 @@ namespace IoTSharp.Data
public
string
Street
{
get
;
set
;
}
public
string
Address
{
get
;
set
;
}
public
int
ZipCode
{
get
;
set
;
}
public
Guid
?
TenantId
{
get
;
set
;
}
[
System
.
Text
.
Json
.
Serialization
.
JsonIgnore
]
[
Newtonsoft
.
Json
.
JsonIgnore
]
...
...
IoTSharp.sln
浏览文件 @
fd242d02
...
...
@@ -59,8 +59,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IoTSharp.Interpreter", "IoT
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IoTSharp.Data.InMemory", "IoTSharp.Data.Storage\IoTSharp.Data.InMemory\IoTSharp.Data.InMemory.csproj", "{A57917E3-6F60-4D0E-8F13-36E5088DEFCE}"
EndProject
Project("{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}") = "IoTSharp.Docs", "docs\IoTSharp.Docs.njsproj", "{F5644BA6-2A0C-49A5-9C9B-3CECD6DB2D1F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IoTSharp.Data.Cassandra", "IoTSharp.Data.Storage\IoTSharp.Data.Cassandra\IoTSharp.Data.Cassandra.csproj", "{9C6FA709-3334-4C39-922D-6FF5ADB8C683}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2.workflows", "2.workflows", "{59A51D63-F292-46F0-A4BF-975C98966DAA}"
...
...
@@ -161,8 +159,6 @@ Global
{A57917E3-6F60-4D0E-8F13-36E5088DEFCE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A57917E3-6F60-4D0E-8F13-36E5088DEFCE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A57917E3-6F60-4D0E-8F13-36E5088DEFCE}.Release|Any CPU.Build.0 = Release|Any CPU
{F5644BA6-2A0C-49A5-9C9B-3CECD6DB2D1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F5644BA6-2A0C-49A5-9C9B-3CECD6DB2D1F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9C6FA709-3334-4C39-922D-6FF5ADB8C683}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9C6FA709-3334-4C39-922D-6FF5ADB8C683}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9C6FA709-3334-4C39-922D-6FF5ADB8C683}.Release|Any CPU.ActiveCfg = Release|Any CPU
...
...
IoTSharp/Controllers/CustomersController.cs
浏览文件 @
fd242d02
...
...
@@ -52,7 +52,7 @@ namespace IoTSharp.Controllers
/// </summary>
/// <returns></returns>
[
HttpPost
(
"Tenant"
)]
[
Authorize
(
Roles
=
nameof
(
UserRole
.
NormalUser
))]
[
Authorize
(
Roles
=
nameof
(
UserRole
.
TenantAdmin
))]
[
ProducesResponseType
(
StatusCodes
.
Status200OK
)]
[
ProducesResponseType
(
typeof
(
ApiResult
),
StatusCodes
.
Status404NotFound
)]
[
ProducesDefaultResponseType
]
...
...
@@ -61,15 +61,14 @@ namespace IoTSharp.Controllers
var
profile
=
this
.
GetUserProfile
();
if
(
m
.
tenantId
!=
Guid
.
Empty
)
{
var
querym
=
_context
.
Customer
.
Where
(
c
=>
c
.
Deleted
==
false
&&
c
.
TenantId
==
m
.
tenantId
);
var
querym
=
_context
.
Customer
.
Include
(
c
=>
c
.
Tenant
).
Where
(
c
=>
!
c
.
Deleted
&&
c
.
Tenant
.
Id
==
m
.
tenantId
);
var
data
=
await
m
.
Query
(
querym
,
c
=>
c
.
Name
);
return
new
ApiResult
<
PagedData
<
Customer
>>(
ApiCode
.
Success
,
"OK"
,
data
);
}
else
{
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
);
return
new
ApiResult
<
PagedData
<
Customer
>>(
ApiCode
.
NotFoundCustomer
,
"没有指定客户ID"
,
new
PagedData
<
Customer
>
());
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录