Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bwallet
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
0
Merge Requests
0
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
Go
bwallet
Commits
81256c61
Commit
81256c61
authored
Mar 25, 2021
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
a4da67e5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
3 deletions
+11
-3
wallet.go
models/wallet.go
+2
-0
wallet.go
routers/api/backend/wallet.go
+2
-0
wallet.go
service/wallet_service/wallet.go
+3
-0
wallet.go
validate_service/wallet.go
+4
-3
No files found.
models/wallet.go
View file @
81256c61
...
...
@@ -11,6 +11,7 @@ type Wallet struct {
Name
string
`gorm:"size:255;not null;" json:"name"`
DownloadUrl
string
`gorm:"not null;" json:"download_url"`
Introduce
string
`gorm:"not null;" json:"introduce"`
Summary
string
`gorm:"not null;" json:"summary"`
ChainId
int
`gorm:"default:0" json:"chain_id,omitempty"`
IssueCharge
float32
`gorm:"default:0.00" json:"issue_charge"`
ChargeUnit
string
`gorm:"default:BTY" json:"charge_unit"`
...
...
@@ -73,6 +74,7 @@ func AddWallet(data map[string]interface{}) (error) {
Name
:
data
[
"name"
]
.
(
string
),
DownloadUrl
:
data
[
"download_url"
]
.
(
string
),
Introduce
:
data
[
"introduce"
]
.
(
string
),
Summary
:
data
[
"summary"
]
.
(
string
),
ChargeUnit
:
data
[
"charge_unit"
]
.
(
string
),
IssueCharge
:
data
[
"issue_charge"
]
.
(
float32
),
ChainId
:
data
[
"chain_id"
]
.
(
int
),
...
...
routers/api/backend/wallet.go
View file @
81256c61
...
...
@@ -182,6 +182,7 @@ func AddWallet(c *gin.Context) {
Name
:
wallet
.
Name
,
DownloadUrl
:
wallet
.
DownloadUrl
,
Introduce
:
wallet
.
Introduce
,
Summary
:
wallet
.
Summary
,
ChainId
:
wallet
.
ChainId
,
IssueCharge
:
wallet
.
IssueCharge
,
ChargeUnit
:
wallet
.
ChargeUnit
,
...
...
@@ -212,6 +213,7 @@ func EditWallet(c *gin.Context) {
Name
:
wallet
.
Name
,
DownloadUrl
:
wallet
.
DownloadUrl
,
Introduce
:
wallet
.
Introduce
,
Summary
:
wallet
.
Summary
,
//ChainId: wallet.ChainId,
//IssueCharge: wallet.IssueCharge,
//ChargeUnit: wallet.ChargeUnit,
...
...
service/wallet_service/wallet.go
View file @
81256c61
...
...
@@ -9,6 +9,7 @@ type Wallet struct {
Name
string
DownloadUrl
string
Introduce
string
Summary
string
ChainId
int
IssueCharge
float32
ChargeUnit
string
...
...
@@ -43,6 +44,7 @@ func (w *Wallet) Add() error {
"name"
:
w
.
Name
,
"download_url"
:
w
.
DownloadUrl
,
"introduce"
:
w
.
Introduce
,
"summary"
:
w
.
Summary
,
"chain_id"
:
w
.
ChainId
,
"charge_unit"
:
w
.
ChargeUnit
,
"issue_charge"
:
w
.
IssueCharge
,
...
...
@@ -60,6 +62,7 @@ func (w *Wallet) Edit() error {
"name"
:
w
.
Name
,
"download_url"
:
w
.
DownloadUrl
,
"introduce"
:
w
.
Introduce
,
"summary"
:
w
.
Summary
,
"chain_id"
:
w
.
ChainId
,
"issue_charge"
:
w
.
IssueCharge
,
"charge_unit"
:
w
.
ChargeUnit
,
...
...
validate_service/wallet.go
View file @
81256c61
...
...
@@ -4,9 +4,10 @@ type Wallet struct {
Name
string
`json:"name" validate:"required"`
DownloadUrl
string
`json:"download_url" validate:"required,url"`
Introduce
string
`json:"introduce" validate:"required"`
ChainId
int
`json:"chain_id ,omitempty"`
IssueCharge
float32
`json:"issue_charge ,omitempty"`
ChargeUnit
string
`json:"charge_unit ,omitempty"`
Summary
string
`json:"summary, omitempty"`
ChainId
int
`json:"chain_id, omitempty"`
IssueCharge
float32
`json:"issue_charge, omitempty"`
ChargeUnit
string
`json:"charge_unit, omitempty"`
}
type
EditWallet
struct
{
...
...
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