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
8cff0dd0
Commit
8cff0dd0
authored
Jan 10, 2020
by
ligaishun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增反馈数据表
parent
e619e1e2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
0 deletions
+54
-0
raspFeedBack.go
models/raspFeedBack.go
+54
-0
No files found.
models/raspFeedBack.go
0 → 100644
View file @
8cff0dd0
package
models
import
(
"log"
)
type
RaspFeedback
struct
{
Id
string
`json:"id" gorm:"PRIMARY_KEY"`
Description
string
`json:"description"`
Complete
bool
`json:"complete"`
}
func
IsComplete
(
id
string
)
bool
{
var
feedback
RaspFeedback
err
:=
db
.
Model
(
&
RaspFeedback
{})
.
Where
(
"id=?"
,
id
)
.
First
(
&
feedback
)
.
Error
if
err
!=
nil
{
log
.
Println
(
err
)
return
true
}
//fmt.Println(feedback)
if
feedback
==
(
RaspFeedback
{}){
return
true
}
return
feedback
.
Complete
}
func
AddFeedBack
(
fd
RaspFeedback
)
bool
{
err
:=
db
.
Create
(
&
fd
)
if
err
!=
nil
{
db
.
Save
(
&
fd
)
log
.
Println
(
err
)
return
false
}
return
true
}
func
DelFeedBack
(
id
string
){
err
:=
db
.
Delete
(
&
RaspFeedback
{})
.
Where
(
"id=?"
,
id
)
.
Error
if
err
!=
nil
{
log
.
Println
(
err
)
}
}
func
DropFeedBack
(){
db
.
DropTable
(
&
RaspFeedback
{})
}
func
Complete
(
fd
RaspFeedback
){
db
.
Model
(
&
fd
)
.
Update
(
"Complete"
,
true
)
}
\ No newline at end of file
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