|
@@ -1,6 +1,7 @@
|
|
|
package service
|
|
|
|
|
|
import (
|
|
|
+ . "api"
|
|
|
"config"
|
|
|
"encoding/json"
|
|
|
"entity"
|
|
@@ -21,6 +22,7 @@ type ResourcePack struct {
|
|
|
*xweb.Action
|
|
|
tes xweb.Mapper `xweb:"/tes"` //测试
|
|
|
createOrder xweb.Mapper `xweb:"/resourcePack/createOrder"` //线上自助数据包充值-创建订单
|
|
|
+ account xweb.Mapper `xweb:"/resourcePack/account"` //个人账户
|
|
|
}
|
|
|
|
|
|
const (
|
|
@@ -132,3 +134,35 @@ func (this *ResourcePack) CreateOrder() {
|
|
|
return
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+// @Summary 账户信息
|
|
|
+// @Param product产品类型【dataExportPack、attachmentDownPack】
|
|
|
+// @Success"{"status":1,"order_code":123456789,"msg":"创建成功"}"
|
|
|
+// @Router /jypay/resourcePack/account [post]
|
|
|
+func (this *ResourcePack) Account() {
|
|
|
+ defer qu.Catch()
|
|
|
+ if this.Method() != METHOD {
|
|
|
+ this.ServeJson(Result{Error_msg: "请求方式有误"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ userId, _ := this.GetSession("userId").(string)
|
|
|
+ if userId == "" {
|
|
|
+ this.ServeJson(Result{Error_msg: "未登录"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ product := this.GetString("product")
|
|
|
+ if config.ResConf.Product[product] == "" {
|
|
|
+ this.ServeJson(Result{Error_msg: "参数错误"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ dbs := &entity.FindBalanceStruct{
|
|
|
+ AccountId: userId,
|
|
|
+ ResourceType: config.ResConf.Product[product],
|
|
|
+ }
|
|
|
+ data, err := dbs.FindBalance()
|
|
|
+ if err != nil {
|
|
|
+ this.ServeJson(Result{Error_msg: "获取失败"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.ServeJson(Result{Data: data})
|
|
|
+}
|