Commit 81256c61 authored by shajiaiming's avatar shajiaiming

fix

parent a4da67e5
......@@ -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),
......
......@@ -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,
......
......@@ -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,
......
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment