package test import ( "encoding/json" "fmt" "time" "kpt.xdmy/apiserver/model" ) func UpdateOrAddVideo() { mv := &model.McsVideo{ DeviceId: "apptest2", EmpId: 25, UpkeepId: 4657, NewCreatedAt: time.Now(), } e := s.UpdateOrAddVideo(mv) if e != nil { fmt.Printf("UpdateOrAddVideo error: %v", e) } } func GetFileList() { mv := &model.McsVideo{ DeviceId: "apptest2", EmpId: 25, UpkeepId: 4657, } s.McsGetFiles(mv) } func ControlRecord(method string) { mcsReq := new(model.McsPostDataReq) param := `{ "method": "` + method + `", "data": { "devId": "apptest3", "peopleNo": 2443, "workNo": 497, "storType": 0 } }` e := json.Unmarshal([]byte(param), &mcsReq) if e != nil { fmt.Printf("json.Unmarshal error: %v", e) return } resp, err := s.McsPostHttp(mcsReq) if err != nil { fmt.Printf("McsPostHttp error: %v", err) return } fmt.Printf("McsPostHttp response: %v", resp) }