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
5edde7af
Commit
5edde7af
authored
Mar 17, 2020
by
szh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加反馈历史接口
parent
213d0b62
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
2 deletions
+46
-2
README.md
README.md
+28
-0
raspFeedBackList.go
models/raspFeedBackList.go
+9
-1
pai.go
routers/api/v1/pai.go
+9
-1
No files found.
README.md
View file @
5edde7af
...
@@ -19,5 +19,32 @@ response
...
@@ -19,5 +19,32 @@ response
}
}
```
```
### 获取程序最新版本
URL /pai/getfeedlist
请求方法 post json
|参数|类型|是否必填|说明|
|-|-|-|-|
|addr|string|是|用户地址|
|page|int|否|页|
|pagesize|int|否|页大小|
```
response
{
"code": 200,
"msg": "ok",
"data": [
"list": [{
"id": 1,
"addr": "",
"description": "",
"addtime": 0,
}],
"count": 1
]
}
```
## 统计服务
## 统计服务
由php端统计矿机数据
由php端统计矿机数据
\ No newline at end of file
models/raspFeedBackList.go
View file @
5edde7af
...
@@ -32,11 +32,18 @@ func AddFeedBackList(fd RaspFeedbackList)bool{
...
@@ -32,11 +32,18 @@ func AddFeedBackList(fd RaspFeedbackList)bool{
func
GetAddrFeedBackList
(
req
*
ReqRaspFeedbackList
)
([]
*
RaspFeedbackList
,
error
)
{
func
GetAddrFeedBackList
(
req
*
ReqRaspFeedbackList
)
([]
*
RaspFeedbackList
,
error
)
{
var
txs
[]
*
RaspFeedbackList
var
txs
[]
*
RaspFeedbackList
maps
:=
map
[
string
]
interface
{}{
"
return_
addr"
:
req
.
Addr
}
maps
:=
map
[
string
]
interface
{}{
"addr"
:
req
.
Addr
}
err
:=
db
.
Where
(
maps
)
.
Order
(
"id "
+
"desc"
)
.
Offset
((
req
.
Page
-
1
)
*
req
.
Pagesize
)
.
Limit
(
req
.
Pagesize
)
.
Find
(
&
txs
)
.
Error
err
:=
db
.
Where
(
maps
)
.
Order
(
"id "
+
"desc"
)
.
Offset
((
req
.
Page
-
1
)
*
req
.
Pagesize
)
.
Limit
(
req
.
Pagesize
)
.
Find
(
&
txs
)
.
Error
if
err
!=
nil
&&
err
!=
gorm
.
ErrRecordNotFound
{
if
err
!=
nil
&&
err
!=
gorm
.
ErrRecordNotFound
{
return
nil
,
err
return
nil
,
err
}
}
return
txs
,
nil
return
txs
,
nil
}
func
GetAddrFeedBackCount
(
addr
string
)
int64
{
maps
:=
map
[
string
]
interface
{}{
"addr"
:
addr
}
var
count
int64
db
.
Where
(
maps
)
.
Count
(
&
count
)
return
count
}
}
\ No newline at end of file
routers/api/v1/pai.go
View file @
5edde7af
...
@@ -186,5 +186,13 @@ func GetFeedList(c *gin.Context){
...
@@ -186,5 +186,13 @@ func GetFeedList(c *gin.Context){
appG
.
Response
(
http
.
StatusOK
,
e
.
ERROR
,
nil
)
appG
.
Response
(
http
.
StatusOK
,
e
.
ERROR
,
nil
)
return
return
}
}
appG
.
Response
(
http
.
StatusOK
,
e
.
SUCCESS
,
list
)
count
:=
models
.
GetAddrFeedBackCount
(
req
.
Addr
)
var
h
gin
.
H
h
[
"list"
]
=
list
h
[
"count"
]
=
count
if
err
!=
nil
{
appG
.
Response
(
http
.
StatusOK
,
e
.
ERROR
,
nil
)
return
}
appG
.
Response
(
http
.
StatusOK
,
e
.
SUCCESS
,
h
)
}
}
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