Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
rudern
物联大师
提交
43f2b17d
物
物联大师
项目概览
rudern
/
物联大师
通知
4
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
物
物联大师
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
43f2b17d
编写于
10月 20, 2020
作者:
J
Jason
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化
上级
edc369b6
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
48 addition
and
35 deletion
+48
-35
models/project.go
models/project.go
+41
-17
models/template.go
models/template.go
+7
-18
未找到文件。
models/project.go
浏览文件 @
43f2b17d
...
...
@@ -18,13 +18,16 @@ type ProjectBase struct {
Id
int64
`json:"id"`
ProjectId
int64
`json:"project_id"`
Name
string
`json:"name"`
Description
string
`json:"description"`
//Description string
`json:"description"`
Created
time
.
Time
`json:"created" xorm:"created"`
Updated
time
.
Time
`json:"updated" xorm:"updated"`
}
type
ProjectAdapter
struct
{
ProjectBase
`xorm:"extends"`
Id
int64
`json:"id"`
ProjectId
int64
`json:"project_id"`
Name
string
`json:"name"`
//Description string `json:"description"`
ProtocolName
string
`json:"protocol_name"`
ProtocolOpts
string
`json:"protocol_opts"`
...
...
@@ -32,13 +35,20 @@ type ProjectAdapter struct {
PollingEnable
bool
`json:"polling_enable"`
//轮询
PollingInterval
int
`json:"polling_interval"`
//轮询间隔 ms
PollingCycle
int
`json:"polling_cycle"`
//轮询周期 s
Created
time
.
Time
`json:"created" xorm:"created"`
Updated
time
.
Time
`json:"updated" xorm:"updated"`
}
type
ProjectVariable
struct
{
ProjectBase
`xorm:"extends"`
Id
int64
`json:"id"`
ProjectId
int64
`json:"project_id"`
Address
`xorm:"extends"`
Name
string
`json:"name"`
Alias
string
`json:"alias"`
Type
string
`json:"type"`
Unit
string
`json:"unit"`
//单位
...
...
@@ -50,30 +60,44 @@ type ProjectVariable struct {
Cron
string
`json:"cron"`
PollingEnable
bool
`json:"polling_enable"`
//轮询
PollingTimes
int
`json:"polling_times"`
Created
time
.
Time
`json:"created" xorm:"created"`
Updated
time
.
Time
`json:"updated" xorm:"updated"`
}
type
ProjectBatch
struct
{
ProjectBase
`xorm:"extends"`
Id
int64
`json:"id"`
ProjectId
int64
`json:"project_id"`
Address
`xorm:"extends"`
Size
int
`json:"size"`
//采样:无、定时、轮询
Cron
string
`json:"cron"`
PollingEnable
bool
`json:"polling_enable"`
//轮询
PollingTimes
int
`json:"polling_times"`
Created
time
.
Time
`json:"created" xorm:"created"`
Updated
time
.
Time
`json:"updated" xorm:"updated"`
}
type
ProjectJob
struct
{
ProjectBase
`xorm:"extends"`
Id
int64
`json:"id"`
ProjectId
int64
`json:"project_id"`
Name
string
`json:"name"`
Cron
string
`json:"cron"`
Script
string
`json:"script"`
//javascript
Created
time
.
Time
`json:"created" xorm:"created"`
Updated
time
.
Time
`json:"updated" xorm:"updated"`
}
type
ProjectStrategy
struct
{
ProjectBase
`xorm:"extends"`
Id
int64
`json:"id"`
ProjectId
int64
`json:"project_id"`
Name
string
`json:"name"`
Script
string
`json:"script"`
//javascript
Created
time
.
Time
`json:"created" xorm:"created"`
Updated
time
.
Time
`json:"updated" xorm:"updated"`
}
models/template.go
浏览文件 @
43f2b17d
...
...
@@ -12,13 +12,8 @@ type Template struct {
Strategies
[]
TemplateStrategy
`json:"strategies"`
}
type
TemplateBase
struct
{
Name
string
`json:"name"`
Description
string
`json:"description"`
}
type
TemplateAdapter
struct
{
TemplateBase
`xorm:"extends
"`
Name
string
`json:"name
"`
ProtocolName
string
`json:"protocol_name"`
ProtocolOpts
string
`json:"protocol_opts"`
...
...
@@ -29,10 +24,10 @@ type TemplateAdapter struct {
}
type
TemplateVariable
struct
{
TemplateBase
`xorm:"extends"`
Address
`xorm:"extends"`
Name
string
`json:"name"`
Alias
string
`json:"alias"`
Type
string
`json:"type"`
Unit
string
`json:"unit"`
//单位
...
...
@@ -47,12 +42,9 @@ type TemplateVariable struct {
}
type
TemplateBatch
struct
{
TemplateBase
`xorm:"extends"`
Address
`xorm:"extends"`
Size
int
`json:"size"`
//采样:无、定时、轮询
Cron
string
`json:"cron"`
PollingEnable
bool
`json:"polling_enable"`
//轮询
...
...
@@ -60,15 +52,12 @@ type TemplateBatch struct {
}
type
TemplateJob
struct
{
TemplateBase
`xorm:"extends"`
Name
string
`json:"name"`
Cron
string
`json:"cron"`
Script
string
`json:"script"`
//javascript
}
type
TemplateStrategy
struct
{
TemplateBase
`xorm:"extends"`
Name
string
`json:"name"`
Script
string
`json:"script"`
//javascript
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录