소스 검색

added live cast search.

master
Patrick Peng Sun 8 년 전
부모
커밋
552c1d3fd9
1개의 변경된 파일14개의 추가작업 그리고 1개의 파일을 삭제
  1. +14
    -1
      crmEntity.go

+ 14
- 1
crmEntity.go 파일 보기

@@ -2,6 +2,7 @@ package main

import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"log"
@@ -189,6 +190,12 @@ func crmSearchEntity(entityType string, filters []crmdSearchFilter) (result crmd
}

func crmFindEntityByID(entityType string, id string) (entity interface{}, err error) {
id = strings.TrimSpace(id)
if id == "" {
err = errors.New("empty ID not accepted")
return
}

filters := []crmdSearchFilter{
{"id", "equals", id},
}
@@ -211,7 +218,13 @@ func crmFindEntityByID(entityType string, id string) (entity interface{}, err er
entity = e[0]
case "Account":
return

case "Livecast":
e := []crmdLiveCast{}
err = json.Unmarshal(*cs.List, &e)
if (err != nil) || (len(e) != cs.Total) {
return
}
entity = e[0]
}
return
}

Loading…
취소
저장