Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
chain33-pai
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
szh
chain33-pai
Commits
2540541b
Commit
2540541b
authored
Apr 07, 2020
by
szh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add info
parent
ba900833
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
raspberry.sql
docs/sql/raspberry.sql
+2
-0
raspDevVersion.go
models/raspDevVersion.go
+2
-1
No files found.
docs/sql/raspberry.sql
View file @
2540541b
...
...
@@ -137,6 +137,7 @@ CREATE TABLE `rasp_dev_version` (
`Id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
`addr`
varchar
(
255
)
NOT
NULL
DEFAULT
''
,
`version`
varchar
(
255
)
NOT
NULL
DEFAULT
''
,
`info`
text
NULL
COMMENT
'其他基本信息'
,
PRIMARY
KEY
(
`Id`
),
KEY
`addr`
(
`addr`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'设备版本统计表'
;
\ No newline at end of file
models/raspDevVersion.go
View file @
2540541b
...
...
@@ -5,12 +5,13 @@ type RaspDevVersion struct {
Id
int64
`json:"id" gorm:"PRIMARY_KEY"`
Version
string
`json:"version"`
Addr
string
`json:"addr"`
Info
string
`json:"info"`
}
//
func
UpdateDevVersion
(
params
map
[
string
]
string
)
error
{
var
version
RaspDevVersion
err
:=
db
.
Where
(
RaspDevVersion
{
Addr
:
params
[
"addr"
]})
.
Assign
(
RaspDevVersion
{
Version
:
params
[
"version"
]})
.
FirstOrCreate
(
&
version
)
.
Error
err
:=
db
.
Where
(
RaspDevVersion
{
Addr
:
params
[
"addr"
]})
.
Assign
(
RaspDevVersion
{
Version
:
params
[
"version"
]
,
Info
:
params
[
"info"
]
})
.
FirstOrCreate
(
&
version
)
.
Error
if
err
!=
nil
{
return
err
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment