price_driven.go 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. package yb
  2. import (
  3. "eta/eta_api/global"
  4. "eta/eta_api/utils"
  5. "time"
  6. )
  7. // PriceDriven 价格驱动表
  8. type PriceDriven struct {
  9. PriceDrivenId int `orm:"column(price_driven_id);pk" gorm:"primaryKey" description:"价格驱动ID"`
  10. //ChartPermissionId int `json:"chart_permission_id" description:"品种权限ID"`
  11. VarietyTagId int `json:"variety_tag_id" description:"标签ID"`
  12. VarietyTagName string `json:"variety_tag_name" description:"标签名称"`
  13. MainVariable string `json:"main_variable" description:"关键变量"`
  14. CoreDrivenType int `json:"core_driven_type" description:"核心驱动类型 0-多 1-空"`
  15. CoreDrivenContent string `json:"core_driven_content" description:"核心驱动内容"`
  16. CoreContent string `json:"core_content" description:"核心内容"`
  17. LastUpdateAdminId int `json:"last_update_admin_id" description:"最后更新人ID"`
  18. LastUpdateAdminName string `json:"last_update_admin_name" description:"最后更新人名称"`
  19. ThsMsgState int `json:"ths_msg_state" description:"同花顺推送状态:0-未推送 1-已推送"`
  20. TemplateMsgState int `json:"template_msg_state" description:"模板消息推送状态:0-未推送 1-已推送"`
  21. PublishState int `json:"publish_state" description:"发布状态:0-未发布 1-已发布"`
  22. SendThsMsgTime time.Time `json:"last_ths_msg_time" description:"最后推送同花顺客群消息时间"`
  23. SendTemplateMsgTime time.Time `json:"last_template_msg_time" description:"最后推送模板消息时间"`
  24. CreateTime time.Time `json:"create_time" description:"创建时间"`
  25. ModifyTime time.Time `json:"modify_time" description:"更新时间"`
  26. }
  27. // TableName 表名变更
  28. func (priceDrivenInfo *PriceDriven) TableName() string {
  29. return "yb_price_driven"
  30. }
  31. // Add 新增
  32. func (priceDrivenInfo *PriceDriven) Add() (err error) {
  33. o := global.DbMap[utils.DbNameWeekly]
  34. err = o.Create(priceDrivenInfo).Error
  35. return
  36. }
  37. // Update 更新
  38. func (priceDrivenInfo *PriceDriven) Update(cols []string) (err error) {
  39. o := global.DbMap[utils.DbNameWeekly]
  40. err = o.Select(cols).Updates(priceDrivenInfo).Error
  41. return
  42. }
  43. // PriceDrivenSaveLog 价格驱动保存记录表
  44. type PriceDrivenSaveLog struct {
  45. Id int `orm:"column(id);pk" gorm:"primaryKey"`
  46. PriceDrivenId int `json:"price_driven_id" description:"价格驱动ID"`
  47. //ChartPermissionId int `json:"chart_permission_id" description:"品种权限ID"`
  48. VarietyTagId int `json:"variety_tag_id" description:"标签ID"`
  49. MainVariable string `json:"main_variable" description:"关键变量"`
  50. CoreDrivenType int `json:"core_driven_type" description:"核心驱动类型 0-多 1-空"`
  51. CoreDrivenContent string `json:"core_driven_content" description:"核心驱动内容"`
  52. CoreContent string `json:"core_content" description:"核心内容"`
  53. AdminId int `json:"admin_id" description:"更新人ID"`
  54. AdminName string `json:"admin_name" description:"更新人名称"`
  55. CreateTime time.Time `json:"create_time" description:"创建时间"`
  56. }
  57. // TableName 表名变更
  58. func (priceDrivenSaveLogInfo *PriceDrivenSaveLog) TableName() string {
  59. return "yb_price_driven_save_log"
  60. }
  61. // Add 新增保存记录
  62. func (priceDrivenSaveLogInfo *PriceDrivenSaveLog) Add() (err error) {
  63. o := global.DbMap[utils.DbNameWeekly]
  64. err = o.Create(priceDrivenSaveLogInfo).Error
  65. return
  66. }