|
@@ -27,26 +27,28 @@ type PushResp struct {
|
|
|
ExpiresIn int `json:"expires_in"`
|
|
|
}
|
|
|
|
|
|
-type PushDataReq struct {
|
|
|
- In0 In0 `json:"in0"`
|
|
|
- Parameters PushDataParamReq `json:"parameters" description:"业务报文"`
|
|
|
+// PushIndexReq
|
|
|
+// @Description: 指标推送请求
|
|
|
+type PushIndexReq struct {
|
|
|
+ In0 In0 `json:"in0"`
|
|
|
+ Parameters PushIndexParamReq `json:"parameters" description:"业务报文"`
|
|
|
}
|
|
|
|
|
|
-// PushDataParamReq
|
|
|
+// PushIndexParamReq
|
|
|
// @Description: 业务报文
|
|
|
-type PushDataParamReq struct {
|
|
|
- SerialID string `json:"serialID" description:"流水号"`
|
|
|
- TableCode string `json:"tableCode" description:"数据表编码"`
|
|
|
- Total int `json:"total" description:"本次落表数据总数"`
|
|
|
- IsEmailWarn int `json:"isEmailWarn" description:"是否发送预警邮件,(1-是 0-否)"`
|
|
|
- Data []PushDataParamDataReq `json:"data" description:"报文体,指标数据列表"`
|
|
|
+type PushIndexParamReq struct {
|
|
|
+ SerialID string `json:"serialID" description:"流水号"`
|
|
|
+ TableCode string `json:"tableCode" description:"数据表编码"`
|
|
|
+ Total int `json:"total" description:"本次落表数据总数"`
|
|
|
+ IsEmailWarn int `json:"isEmailWarn" description:"是否发送预警邮件,(1-是 0-否)"`
|
|
|
+ Data []PushIndexItemReq `json:"data" description:"报文体,指标数据列表"`
|
|
|
}
|
|
|
|
|
|
-// PushDataParamDataReq
|
|
|
+// PushIndexItemReq
|
|
|
// @Description: 指标数据结构
|
|
|
-type PushDataParamDataReq struct {
|
|
|
+type PushIndexItemReq struct {
|
|
|
SourceIndexCode string `json:"source_index_code" description:"上游来源指标ID"`
|
|
|
- IndexCode string `json:"Index_code" description:""`
|
|
|
+ IndexCode string `json:"index_code" description:""`
|
|
|
IndexName string `json:"index_name" description:""`
|
|
|
IndexShortName string `json:"index_short_name" description:""`
|
|
|
FrequenceName string `json:"frequence_name" description:""`
|
|
@@ -82,7 +84,7 @@ type PushDataParamDataReq struct {
|
|
|
Status int `json:"status" description:""`
|
|
|
}
|
|
|
|
|
|
-type PushDataResp struct {
|
|
|
+type PushIndexDataResp struct {
|
|
|
Out struct {
|
|
|
ReturnCode string `json:"returnCode"`
|
|
|
ReturnMsg string `json:"returnMsg"`
|
|
@@ -90,16 +92,169 @@ type PushDataResp struct {
|
|
|
} `json:"out"`
|
|
|
}
|
|
|
|
|
|
-// GetToken
|
|
|
+// PushIndexData
|
|
|
+// @Description: 指标信息推送
|
|
|
+// @author: Roc
|
|
|
+// @datetime 2024-02-28 17:45:03
|
|
|
+// @param data PushIndexParamReq
|
|
|
+// @return resp *PushDataResp
|
|
|
+// @return err error
|
|
|
+func PushIndexData(data PushBaseParamReq) (resp *PushIndexDataResp, err error) {
|
|
|
+ urlPath := `/DAQ/CY/ProxyServices/pushMarketPricePS`
|
|
|
+ req := PushBaseReq{
|
|
|
+ In0: In0{
|
|
|
+ PageTotal: "",
|
|
|
+ PageNo: "",
|
|
|
+ DocType: "pushMarketPricePS",
|
|
|
+ Property: "",
|
|
|
+ //DocCode: getDocCode(),
|
|
|
+ Source: global.CONFIG.Xiangyu.SystemCode,
|
|
|
+ Target: global.CONFIG.Xiangyu.IndexSyncTarget,
|
|
|
+ },
|
|
|
+ Parameters: data,
|
|
|
+ }
|
|
|
+
|
|
|
+ postData, err := json.Marshal(req)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ result, err := HttpPostIndex(urlPath, string(postData))
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 解析响应结果
|
|
|
+ err = json.Unmarshal(result, &resp)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if resp.Out.ReturnCode != "S" {
|
|
|
+ err = errors.New(fmt.Sprintf("响应代码:%s,错误信息:%s", resp.Out.ReturnCode, resp.Out.ReturnMsg))
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+// PushIndexValueReq
|
|
|
+// @Description: 指标日期值推送请求
|
|
|
+type PushIndexValueReq struct {
|
|
|
+ In0 In0 `json:"in0"`
|
|
|
+ Parameters PushIndexValueParamReq `json:"parameters" description:"业务报文"`
|
|
|
+}
|
|
|
+
|
|
|
+// PushIndexValueParamReq
|
|
|
+// @Description: 业务报文
|
|
|
+type PushIndexValueParamReq struct {
|
|
|
+ SerialID string `json:"serialID" description:"流水号"`
|
|
|
+ TableCode string `json:"tableCode" description:"数据表编码"`
|
|
|
+ Total int `json:"total" description:"本次落表数据总数"`
|
|
|
+ IsEmailWarn int `json:"isEmailWarn" description:"是否发送预警邮件,(1-是 0-否)"`
|
|
|
+ Data []PushIndexValueItemReq `json:"data" description:"报文体,指标日期值数据列表"`
|
|
|
+}
|
|
|
+
|
|
|
+// PushIndexValueItemReq
|
|
|
+// @Description: 指标日期值数据结构
|
|
|
+type PushIndexValueItemReq struct {
|
|
|
+ Id string `json:"id"`
|
|
|
+ IndexCode string `json:"index_code" description:"指标代码"`
|
|
|
+ Value string `json:"value" description:"数值"`
|
|
|
+ BusinessDate string `json:"business_date" description:"业务日期(数据日期)"`
|
|
|
+ CreateTime string `json:"create_time" description:"数据进入ETA的时间"`
|
|
|
+ UpdateTime string `json:"update_time" description:"eta库中修改数据的时间"`
|
|
|
+ Status string `json:"status" description:"逻辑删除使用,0-禁用,1-启用"`
|
|
|
+}
|
|
|
+
|
|
|
+// PushEdbValue
|
|
|
// @Description: 获取token信息
|
|
|
// @author: Roc
|
|
|
// @datetime 2024-01-23 15:40:56
|
|
|
// @param code string
|
|
|
// @return resp *GetTokenResp
|
|
|
// @return err error
|
|
|
-func PushData(data PushDataParamReq) (resp *PushDataResp, err error) {
|
|
|
+func PushEdbValue(data PushBaseParamReq) (resp *PushIndexDataResp, err error) {
|
|
|
+ urlPath := `/DAQ/CY/ProxyServices/pushMarketPricePS`
|
|
|
+ req := PushBaseReq{
|
|
|
+ In0: In0{
|
|
|
+ PageTotal: "",
|
|
|
+ PageNo: "",
|
|
|
+ DocType: "pushMarketPricePS",
|
|
|
+ Property: "",
|
|
|
+ //DocCode: getDocCode(),
|
|
|
+ Source: global.CONFIG.Xiangyu.SystemCode,
|
|
|
+ Target: global.CONFIG.Xiangyu.IndexSyncTarget,
|
|
|
+ },
|
|
|
+ Parameters: data,
|
|
|
+ }
|
|
|
+
|
|
|
+ postData, err := json.Marshal(req)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ result, err := HttpPostIndex(urlPath, string(postData))
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 解析响应结果
|
|
|
+ err = json.Unmarshal(result, &resp)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if resp.Out.ReturnCode != "S" {
|
|
|
+ err = errors.New(fmt.Sprintf("响应代码:%s,错误信息:%s", resp.Out.ReturnCode, resp.Out.ReturnMsg))
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+// PushBaseReq
|
|
|
+// @Description: 基础请求
|
|
|
+type PushBaseReq struct {
|
|
|
+ In0 In0 `json:"in0"`
|
|
|
+ Parameters PushBaseParamReq `json:"parameters" description:"业务报文"`
|
|
|
+}
|
|
|
+
|
|
|
+// PushBaseParamReq
|
|
|
+// @Description: 基础业务报文
|
|
|
+type PushBaseParamReq struct {
|
|
|
+ SerialID string `json:"serialID" description:"流水号"`
|
|
|
+ TableCode string `json:"tableCode" description:"数据表编码"`
|
|
|
+ Total int `json:"total" description:"本次落表数据总数"`
|
|
|
+ IsEmailWarn int `json:"isEmailWarn" description:"是否发送预警邮件,(1-是 0-否)"`
|
|
|
+ Data interface{} `json:"data" description:"报文体,指标日期值数据列表"`
|
|
|
+}
|
|
|
+
|
|
|
+// PushClassifyItemReq
|
|
|
+// @Description: 指标分类数据结构
|
|
|
+type PushClassifyItemReq struct {
|
|
|
+ ClassifyId int `json:"classify_id" description:"自增id"`
|
|
|
+ ClassifyType int `json:"classify_type" description:"分类类型,0:普通指标分类,1:预测指标分类"`
|
|
|
+ ClassifyName string `json:"classify_name" description:"分类名称"`
|
|
|
+ ParentId int `json:"parent_id" description:"父级id"`
|
|
|
+ HasData int `json:"has_data" description:"是否存在指标数据,1:有,2:无"`
|
|
|
+ CreateTime string `json:"create_time" description:"创建时间"`
|
|
|
+ UpdateTime string `json:"update_time" description:"修改时间"`
|
|
|
+ SysUserId int `json:"sys_user_id" description:"创建人id"`
|
|
|
+ SysUserRealName string `json:"sys_user_real_name" description:"创建人姓名"`
|
|
|
+ Level int `json:"level" description:"层级"`
|
|
|
+ UniqueCode string `json:"unique_code" description:"唯一编码"`
|
|
|
+ SortColumn int `json:"sort_column" description:"排序字段,越小越靠前,默认值:10"`
|
|
|
+}
|
|
|
+
|
|
|
+// PushClassify
|
|
|
+// @Description: 推送指标分类
|
|
|
+// @author: Roc
|
|
|
+// @datetime 2024-01-23 15:40:56
|
|
|
+// @param code string
|
|
|
+// @return resp *GetTokenResp
|
|
|
+// @return err error
|
|
|
+func PushClassify(data PushBaseParamReq) (resp *PushIndexDataResp, err error) {
|
|
|
urlPath := `/DAQ/CY/ProxyServices/pushMarketPricePS`
|
|
|
- req := PushDataReq{
|
|
|
+ req := PushBaseReq{
|
|
|
In0: In0{
|
|
|
PageTotal: "",
|
|
|
PageNo: "",
|
|
@@ -107,7 +262,7 @@ func PushData(data PushDataParamReq) (resp *PushDataResp, err error) {
|
|
|
Property: "",
|
|
|
//DocCode: getDocCode(),
|
|
|
Source: global.CONFIG.Xiangyu.SystemCode,
|
|
|
- Target: global.CONFIG.Xiangyu.UserSyncTarget,
|
|
|
+ Target: global.CONFIG.Xiangyu.IndexSyncTarget,
|
|
|
},
|
|
|
Parameters: data,
|
|
|
}
|
|
@@ -135,6 +290,63 @@ func PushData(data PushDataParamReq) (resp *PushDataResp, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+// PushBase
|
|
|
+// @Description: 基础推送接口
|
|
|
+// @author: Roc
|
|
|
+// @datetime 2024-01-23 15:40:56
|
|
|
+// @param code string
|
|
|
+// @return resp *GetTokenResp
|
|
|
+// @return err error
|
|
|
+func PushBase(data PushBaseParamReq) (resp *PushIndexDataResp, err error) {
|
|
|
+ urlPath := `/DAQ/CY/ProxyServices/pushMarketPricePS`
|
|
|
+ req := PushBaseReq{
|
|
|
+ In0: In0{
|
|
|
+ PageTotal: "",
|
|
|
+ PageNo: "",
|
|
|
+ DocType: "pushMarketPricePS",
|
|
|
+ Property: "",
|
|
|
+ //DocCode: getDocCode(),
|
|
|
+ Source: global.CONFIG.Xiangyu.SystemCode,
|
|
|
+ Target: global.CONFIG.Xiangyu.IndexSyncTarget,
|
|
|
+ },
|
|
|
+ Parameters: data,
|
|
|
+ }
|
|
|
+
|
|
|
+ postData, err := json.Marshal(req)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ result, err := HttpPostIndex(urlPath, string(postData))
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 解析响应结果
|
|
|
+ err = json.Unmarshal(result, &resp)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if resp.Out.ReturnCode != "S" {
|
|
|
+ err = errors.New(fmt.Sprintf("响应代码:%s,错误信息:%s", resp.Out.ReturnCode, resp.Out.ReturnMsg))
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+// PushEdbClassifyItemReq
|
|
|
+// @Description: 指标与目录的关系请求结构
|
|
|
+type PushEdbClassifyItemReq struct {
|
|
|
+ Id string `json:"id" description:"唯一主键"`
|
|
|
+ ClassifyId int `json:"classify_id" description:"目录分类ID"`
|
|
|
+ IndexCode string `json:"index_code" description:"指标ID"`
|
|
|
+ CreateTime string `json:"create_time" description:"创建时间"`
|
|
|
+ CreateUser string `json:"create_user" description:"创建人"`
|
|
|
+ UpdateTime string `json:"update_time" description:"修改时间"`
|
|
|
+ UpdateUser string `json:"update_user" description:"修改人"`
|
|
|
+}
|
|
|
+
|
|
|
// HttpPostIndex
|
|
|
// @Description: post请求
|
|
|
// @author: Roc
|