mcs.go 950 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package test
  2. import (
  3. "encoding/json"
  4. "fmt"
  5. "time"
  6. "kpt.xdmy/apiserver/model"
  7. )
  8. func UpdateOrAddVideo() {
  9. mv := &model.McsVideo{
  10. DeviceId: "apptest2",
  11. EmpId: 25,
  12. UpkeepId: 4657,
  13. NewCreatedAt: time.Now(),
  14. }
  15. e := s.UpdateOrAddVideo(mv)
  16. if e != nil {
  17. fmt.Printf("UpdateOrAddVideo error: %v", e)
  18. }
  19. }
  20. func GetFileList() {
  21. mv := &model.McsVideo{
  22. DeviceId: "apptest2",
  23. EmpId: 25,
  24. UpkeepId: 4657,
  25. }
  26. s.McsGetFiles(mv)
  27. }
  28. func ControlRecord(method string) {
  29. mcsReq := new(model.McsPostDataReq)
  30. param := `{
  31. "method": "` + method + `",
  32. "data": {
  33. "devId": "apptest3",
  34. "peopleNo": 2443,
  35. "workNo": 497,
  36. "storType": 0
  37. }
  38. }`
  39. e := json.Unmarshal([]byte(param), &mcsReq)
  40. if e != nil {
  41. fmt.Printf("json.Unmarshal error: %v", e)
  42. return
  43. }
  44. resp, err := s.McsPostHttp(mcsReq)
  45. if err != nil {
  46. fmt.Printf("McsPostHttp error: %v", err)
  47. return
  48. }
  49. fmt.Printf("McsPostHttp response: %v", resp)
  50. }