Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
IoTSharp
IoTSharp
提交
495ffad9
IoTSharp
项目概览
IoTSharp
/
IoTSharp
大约 1 年 前同步成功
通知
15
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
IoTSharp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
495ffad9
编写于
12月 21, 2021
作者:
W
wq1234wq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
设备超时设置
上级
49d59915
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
13 addition
and
5 deletion
+13
-5
IoTSharp/ClientApp/src/app/routes/device/deviceform/deviceform.component.html
...rc/app/routes/device/deviceform/deviceform.component.html
+3
-1
IoTSharp/ClientApp/src/app/routes/device/deviceform/deviceform.component.ts
.../src/app/routes/device/deviceform/deviceform.component.ts
+1
-0
IoTSharp/Controllers/DevicesController.cs
IoTSharp/Controllers/DevicesController.cs
+4
-2
IoTSharp/Dtos/DevicePostDto.cs
IoTSharp/Dtos/DevicePostDto.cs
+3
-1
IoTSharp/Dtos/DevicePutDto.cs
IoTSharp/Dtos/DevicePutDto.cs
+2
-1
未找到文件。
IoTSharp/ClientApp/src/app/routes/device/deviceform/deviceform.component.html
浏览文件 @
495ffad9
...
...
@@ -12,7 +12,9 @@
</nz-select>
</se>
<se
label=
"超时"
error=
"超时"
required
>
<input
nz-input
formControlName=
"timeout"
placeholder=
"名称"
/>
</se>
<se
label=
"设备型号"
error=
"设备型号"
>
<nz-select
formControlName=
"deviceModelId"
placeholder=
"设备型号"
>
<nz-option
*ngFor=
"let o of devicemodel"
[nzValue]=
"o.deviceModelId"
[nzLabel]=
"o.modelName"
></nz-option>
...
...
IoTSharp/ClientApp/src/app/routes/device/deviceform/deviceform.component.ts
浏览文件 @
495ffad9
...
...
@@ -55,6 +55,7 @@ export class DeviceformComponent implements OnInit {
deviceType
:
[
null
,
[
Validators
.
required
]],
customerId
:
[
null
,
[]],
deviceModelId
:
[
null
,
[]],
timeout
:
[
300
,
[]],
id
:
[
Guid
.
EMPTY
,
[]],
identityType
:
[
Guid
.
EMPTY
,
[]],
});
...
...
IoTSharp/Controllers/DevicesController.cs
浏览文件 @
495ffad9
...
...
@@ -577,6 +577,7 @@ namespace IoTSharp.Controllers
dev
.
DeviceModel
=
_context
.
DeviceModels
.
FirstOrDefault
(
c
=>
c
.
DeviceModelId
==
device
.
DeviceModelId
);
dev
.
Name
=
device
.
Name
;
dev
.
Timeout
=
device
.
Timeout
;
try
{
await
_context
.
SaveChangesAsync
();
...
...
@@ -621,7 +622,7 @@ namespace IoTSharp.Controllers
{
var
cid
=
User
.
Claims
.
First
(
c
=>
c
.
Type
==
IoTSharpClaimTypes
.
Customer
);
var
tid
=
User
.
Claims
.
First
(
c
=>
c
.
Type
==
IoTSharpClaimTypes
.
Tenant
);
var
devvalue
=
new
Device
()
{
Name
=
device
.
Name
,
DeviceType
=
device
.
DeviceType
,
Timeout
=
300
,
LastActive
=
DateTime
.
Now
,
Status
=
1
,
var
devvalue
=
new
Device
()
{
Name
=
device
.
Name
,
DeviceType
=
device
.
DeviceType
,
Timeout
=
device
.
Timeout
,
LastActive
=
DateTime
.
Now
,
Status
=
1
,
DeviceModel
=
_context
.
DeviceModels
.
FirstOrDefault
(
c
=>
c
.
DeviceModelId
==
device
.
DeviceModelId
),
//CreateDate = DateTime.Today,
//CreateMonth =DateTime.Now.ToString("yyyy-MM"),
...
...
@@ -629,8 +630,9 @@ namespace IoTSharp.Controllers
};
devvalue
.
Tenant
=
_context
.
Tenant
.
Find
(
new
Guid
(
tid
.
Value
));
devvalue
.
Customer
=
_context
.
Customer
.
Find
(
new
Guid
(
cid
.
Value
));
if
(
devvalue
.
Tenant
==
null
||
devvalue
.
Customer
==
null
)
{
return
new
ApiResult
<
Device
>(
ApiCode
.
NotFoundTenantOrCustomer
,
"Not found Tenant or Customer"
,
null
);
...
...
IoTSharp/Dtos/DevicePostDto.cs
浏览文件 @
495ffad9
...
...
@@ -10,7 +10,9 @@ namespace IoTSharp.Dtos
{
public
string
Name
{
get
;
set
;
}
public
DeviceType
DeviceType
{
get
;
set
;
}
public
Guid
DeviceModelId
{
get
;
set
;
}
public
Guid
?
DeviceModelId
{
get
;
set
;
}
public
int
Timeout
{
get
;
set
;
}
public
IdentityType
IdentityType
{
get
;
set
;
}
}
}
IoTSharp/Dtos/DevicePutDto.cs
浏览文件 @
495ffad9
...
...
@@ -11,7 +11,8 @@ namespace IoTSharp.Dtos
public
Guid
Id
{
get
;
set
;
}
public
string
Name
{
get
;
set
;
}
public
Guid
DeviceModelId
{
get
;
set
;
}
public
int
Timeout
{
get
;
set
;
}
public
Guid
?
DeviceModelId
{
get
;
set
;
}
public
IdentityType
IdentityType
{
get
;
set
;
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录