rs_calendar_api_log.go 936 B

12345678910111213141516171819202122232425262728293031323334
  1. package roadshow
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type RsCalendarApiLog struct {
  7. Id int `orm:"column(id);pk"`
  8. Url string `description:"链接"`
  9. Body string `description:"请求参数"`
  10. Result string `description:"返回参数"`
  11. CreateTime time.Time `description:"创建时间"`
  12. Remark string `description:"备注说明"`
  13. RsCalendarResearcherId int `description:"表rs_calendar 主键ID"`
  14. }
  15. // 添加日志记录
  16. func AddRsCalendarApiLog(item *RsCalendarApiLog) (lastId int64, err error) {
  17. o := orm.NewOrm()
  18. lastId, err = o.Insert(item)
  19. return
  20. }
  21. // 批量添加
  22. func AddRsCalendarApiLogList(items []*RsCalendarApiLog) (lastId int64, err error) {
  23. lenitems := len(items)
  24. if lenitems == 0 {
  25. return
  26. }
  27. o := orm.NewOrm()
  28. _, err = o.InsertMulti(lenitems, items)
  29. return
  30. }