|
|
@@ -267,6 +267,65 @@ func BankActivity(c *gin.Context) { |
|
|
|
e.OutSuc(c, list, nil) |
|
|
|
return |
|
|
|
} |
|
|
|
func BankCardDetail(c *gin.Context) { |
|
|
|
var arg map[string]string |
|
|
|
if err := c.ShouldBindJSON(&arg); err != nil { |
|
|
|
e.OutErr(c, e.ERR_INVALID_ARGS, err) |
|
|
|
return |
|
|
|
} |
|
|
|
detail := db.GetCardDetail(MasterDb(c), arg) |
|
|
|
if detail == nil { |
|
|
|
e.OutErr(c, 400, e.NewErr(400, "记录不存在")) |
|
|
|
return |
|
|
|
} |
|
|
|
tmp := map[string]string{ |
|
|
|
"id": utils.IntToStr(detail.Id), |
|
|
|
"title": detail.Title, |
|
|
|
"first_tip": detail.FirstTip, |
|
|
|
"second_tip": detail.SecondTip, |
|
|
|
"time_str": "", |
|
|
|
"content": detail.Content, |
|
|
|
"type": "0", |
|
|
|
} |
|
|
|
if tmp["time_str"] != "" { |
|
|
|
tmp["type"] = "1" |
|
|
|
} |
|
|
|
if detail.IsUse == 0 { |
|
|
|
tmp["type"] = "2" |
|
|
|
} |
|
|
|
e.OutSuc(c, tmp, nil) |
|
|
|
return |
|
|
|
} |
|
|
|
func BankCard(c *gin.Context) { |
|
|
|
var arg map[string]string |
|
|
|
if err := c.ShouldBindJSON(&arg); err != nil { |
|
|
|
e.OutErr(c, e.ERR_INVALID_ARGS, err) |
|
|
|
return |
|
|
|
} |
|
|
|
list := make([]map[string]string, 0) |
|
|
|
data := db.GetCard(MasterDb(c), arg) |
|
|
|
if data != nil { |
|
|
|
for _, v := range *data { |
|
|
|
tmp := map[string]string{ |
|
|
|
"id": utils.IntToStr(v.Id), |
|
|
|
"title": v.Title, |
|
|
|
"first_tip": v.FirstTip, |
|
|
|
"second_tip": v.SecondTip, |
|
|
|
"time_str": "", |
|
|
|
"type": "0", |
|
|
|
} |
|
|
|
if tmp["time_str"] != "" { |
|
|
|
tmp["type"] = "1" |
|
|
|
} |
|
|
|
if v.IsUse == 0 { |
|
|
|
tmp["type"] = "2" |
|
|
|
} |
|
|
|
list = append(list, tmp) |
|
|
|
} |
|
|
|
} |
|
|
|
e.OutSuc(c, list, nil) |
|
|
|
return |
|
|
|
} |
|
|
|
func NewStore(c *gin.Context) { |
|
|
|
var arg map[string]string |
|
|
|
if err := c.ShouldBindJSON(&arg); err != nil { |
|
|
|