|
@@ -7,27 +7,41 @@ import (
|
|
|
"eta/eta_chart_lib/utils"
|
|
|
)
|
|
|
|
|
|
+type MyChartIsCollect struct {
|
|
|
+ IsCollect bool
|
|
|
+}
|
|
|
+
|
|
|
+type BaseResponse struct {
|
|
|
+ Ret int
|
|
|
+ Msg string
|
|
|
+ ErrMsg string
|
|
|
+ ErrCode string
|
|
|
+ Data MyChartIsCollect
|
|
|
+}
|
|
|
+
|
|
|
+type MyChartIsCollectReq struct {
|
|
|
+ UniqueCode string
|
|
|
+}
|
|
|
+
|
|
|
+type MyChartCollectReq struct {
|
|
|
+ UniqueCode string
|
|
|
+ ChartName string
|
|
|
+ ChartImage string
|
|
|
+ ChartInfoId int
|
|
|
+}
|
|
|
+
|
|
|
+type MyChartCollectCancelReq struct {
|
|
|
+ UniqueCode string
|
|
|
+}
|
|
|
+
|
|
|
func GetMyChartIsCollect(token string, uniqueCode string) (isCollect bool, err error) {
|
|
|
url := utils.ETA_MINI_URL + "mychart/isCollect"
|
|
|
- type MyChartIsCollectReq struct {
|
|
|
- UniqueCode string
|
|
|
- }
|
|
|
req := MyChartIsCollectReq{UniqueCode: uniqueCode}
|
|
|
reqBody, _ := json.Marshal(req)
|
|
|
result, err := HttpPost(url, string(reqBody), token)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
- type MyChartIsCollect struct {
|
|
|
- IsCollect bool
|
|
|
- }
|
|
|
- type BaseResponse struct {
|
|
|
- Ret int
|
|
|
- Msg string
|
|
|
- ErrMsg string
|
|
|
- ErrCode string
|
|
|
- Data MyChartIsCollect
|
|
|
- }
|
|
|
var resp BaseResponse
|
|
|
if err = json.Unmarshal(result, &resp); err != nil {
|
|
|
return
|
|
@@ -42,12 +56,6 @@ func GetMyChartIsCollect(token string, uniqueCode string) (isCollect bool, err e
|
|
|
|
|
|
func MyChartCollect(token, uniqueCode, chartName, chartImage string, chartInfoId int) (resp *models.BaseResponse, err error) {
|
|
|
url := utils.ETA_MINI_URL + "mychart/collect"
|
|
|
- type MyChartCollectReq struct {
|
|
|
- UniqueCode string
|
|
|
- ChartName string
|
|
|
- ChartImage string
|
|
|
- ChartInfoId int
|
|
|
- }
|
|
|
req := MyChartCollectReq{
|
|
|
UniqueCode: uniqueCode,
|
|
|
ChartName: chartName,
|
|
@@ -70,9 +78,6 @@ func MyChartCollect(token, uniqueCode, chartName, chartImage string, chartInfoId
|
|
|
|
|
|
func MyChartCollectCancel(token string, uniqueCode string) (resp *models.BaseResponse, err error) {
|
|
|
url := utils.ETA_MINI_URL + "mychart/collectCancel"
|
|
|
- type MyChartCollectCancelReq struct {
|
|
|
- UniqueCode string
|
|
|
- }
|
|
|
req := MyChartCollectCancelReq{UniqueCode: uniqueCode}
|
|
|
reqBody, _ := json.Marshal(req)
|
|
|
result, err := HttpPost(url, string(reqBody), token)
|