-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvip.go
67 lines (55 loc) · 1.91 KB
/
vip.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package component_shipinlv
import (
"errors"
"fmt"
//component_shipinlv_lib "component_shipinlv/lib"
component_shipinlv_lib "github.com/tangwenru/go-component-shipinlv/lib"
)
type Vip struct {
}
type VipList struct {
Id int64 `json:"id"`
DealerId int64 `json:"dealerId"`
Title string `json:"title"`
Price float64 `json:"price"`
Month float64 `json:"month"`
ProductType string `json:"productType"`
ProductTypeOrderIndex int64 `json:"productTypeOrderIndex"`
MonthTitle string `json:"monthTitle"`
MarketPrice float64 `json:"marketPrice"`
RatioDownPercent1 float64 `json:"ratioDownPercent1"`
RatioDownPercent2 float64 `json:"ratioDownPercent2"`
Alt string `json:"alt"`
VipLevel int64 `json:"vipLevel"`
PropertyAmount string `json:"propertyAmount"` // 最大值
Recommend int64 `json:"recommend"`
ShowContent string `json:"showContent"`
CanBuy bool `json:"canBuy"`
Enabled bool `json:"enabled"`
}
type VipDetailQuery struct {
ProductType string `json:"productType"`
Domain string `json:"domain"`
}
type VipListResult struct {
Success bool `json:"success"`
Message string `json:"message"`
Data []VipList `json:"data"`
}
func init() {
}
func (this *Vip) ListByProductType(userId int64, productType string, domain string) (error, *[]VipList) {
query := VipDetailQuery{
ProductType: productType,
Domain: domain,
}
vipListResult := VipListResult{}
bytesResult, err := component_shipinlv_lib.MainSystem(userId, "vip/listByProductType", &query, &vipListResult)
if err != nil {
fmt.Println("Vip List By Product Type err:", string(bytesResult), err)
}
if !vipListResult.Success {
return errors.New(vipListResult.Message), nil
}
return err, &vipListResult.Data
}