Browse Source

added live cast search.

master
Patrick Peng Sun 8 years ago
parent
commit
552c1d3fd9
1 changed files with 14 additions and 1 deletions
  1. +14
    -1
      crmEntity.go

+ 14
- 1
crmEntity.go View File

@@ -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…
Cancel
Save