Advertisement
Guest User

Untitled

a guest
Jan 17th, 2020
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. (defclass |actions| ()
  2. ((|actionId| :col-type (or db-null integer) :initarg :action-id
  3. :reader |action-actionId|)
  4. (|userId| :col-type (or db-null integer) :initarg :user-id
  5. :reader |action-userId|)
  6. (|shopUserId| :col-type (or db-null integer) :initarg :shop-user-id
  7. :reader |action-shopUserId|)
  8. (|shopTransactionId| :col-type (or db-null integer) :initarg :shop-transaction-id
  9. :reader |action-shopTransactionId|)
  10. (|visitorId| :col-type (or db-null integer) :initarg :visitor-id
  11. :accessor |action-visitorId|)
  12. (|productId| :col-type (or db-null integer) :initarg :product-id
  13. :accessor |action-productId|)
  14. (|visitorIp| :col-type string :initarg :visitor-ip
  15. :accessor |action-visitorIp|)
  16. (|referer| :col-type string :initarg :referer
  17. :accessor |action-referer|)
  18. (|actionType| :col-type string :initarg :action-type
  19. :accessor |action-actionType|)
  20. (|createdAt| :col-type timestamp :initform (format-timestring nil (now))
  21. :accessor |action-createdAt|)
  22. (|updatedAt| :col-type timestamp :initform (format-timestring nil (now))
  23. :accessor |action-updatedAt|))
  24. (:metaclass dao-class)
  25. (:keys |actionId|))
  26.  
  27. and then
  28.  
  29. (with-db
  30. (insert-dao
  31. (make-instance '|actions|
  32. :user-id user-id
  33. :shop-user-id shop-user-id
  34. :shop-transaction-id (getf item-as-list :shop-transaction-id)
  35. :visitor-id (or redis-id :null)
  36. :visitor-ip (getf item-as-list :ip)
  37. :referer (or (getf item-as-list :referer) "direct")
  38. :action-type (if sale-in-ttl
  39. "conversion"
  40. "conversion-ttl-expired")
  41. :product-id :null)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement