|
@@ -763,3 +763,52 @@ func (this *BaseFromLyController) AddBatchLyEdbData() {
|
|
|
br.Success = true
|
|
|
br.Msg = "处理成功"
|
|
|
}
|
|
|
+
|
|
|
+// CheckLyIndexRecordIsExist
|
|
|
+// @Title 校验当前页是否有指标读取到指标库
|
|
|
+// @Description 校验当前页是否有指标读取到指标库
|
|
|
+// @Success 200 string "处理成功"
|
|
|
+// @router /check/ly/index/record/is/exist [post]
|
|
|
+func (this *BaseFromLyController) CheckLyIndexRecordIsExist() {
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
+ var cacheKey string
|
|
|
+ defer func() {
|
|
|
+ if br.ErrMsg == "" {
|
|
|
+ br.IsSendEmail = false
|
|
|
+ }
|
|
|
+ _ = utils.Rc.Delete(cacheKey)
|
|
|
+ this.Data["json"] = br
|
|
|
+ this.ServeJSON()
|
|
|
+ }()
|
|
|
+
|
|
|
+ var req struct {
|
|
|
+ UrlList []string `json:"UrlList"`
|
|
|
+ }
|
|
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "参数解析异常!"
|
|
|
+ br.ErrMsg = "参数解析失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ var condition string
|
|
|
+ var params []interface{}
|
|
|
+
|
|
|
+ condition += ` and url in (` + utils.GetOrmInReplace(len(req.UrlList)) + `)`
|
|
|
+ for _, url := range req.UrlList {
|
|
|
+ params = append(params, url)
|
|
|
+ }
|
|
|
+ count, err := models.GetLyIndexRecordByCondition(condition, params)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if count > 0 {
|
|
|
+ br.Data = true
|
|
|
+ } else {
|
|
|
+ br.Data = false
|
|
|
+ }
|
|
|
+
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "处理成功"
|
|
|
+}
|