stock_detail.go 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package model
  2. import (
  3. "time"
  4. "ulink-admin/pkg/base"
  5. )
  6. type StockDetail struct {
  7. Id int64 `excel:"name= " xorm:"pk autoincr notnull comment('')" json:"id" binding:"required"` //
  8. StockId int64 `excel:"name=股票id " xorm:"bigint(20) notnull comment('股票id')" json:"stockId" binding:"required"` //股票id
  9. Site30 int `excel:"name=30走势 ,format=1=下降低位,2=上升低位,3=下降高位,4=上升高位,5=上升中位,6=下降中位" xorm:"int(1) notnull default(2) comment('30走势')" json:"site30" binding:"required,oneof=1 2 3 4 5 6 "` //30走势(1下降低位 2上升低位 3下降高位 4上升高位 5上升中位 6下降中位)
  10. Site60 int `excel:"name=60走势 ,format=1=下降低位,2=上升低位,3=下降高位,4=上升高位,5=上升中位,6=下降中位" xorm:"int(1) notnull default(2) comment('60走势')" json:"site60" binding:"required,oneof=1 2 3 4 5 6 "` //60走势(1下降低位 2上升低位 3下降高位 4上升高位 5上升中位 6下降中位)
  11. SiteDate int `excel:"name=日线走势 ,format=1=下降低位,2=上升低位,3=下降高位,4=上升高位,5=上升中位,6=下降中位" xorm:"int(1) notnull default(2) comment('日线走势')" json:"siteDate" binding:"required,oneof=1 2 3 4 5 6 "` //日线走势(1下降低位 2上升低位 3下降高位 4上升高位 5上升中位 6下降中位)
  12. Target int `excel:"name=指标公式 ,format=1=波论,2=顶底" xorm:"int(1) notnull default(2) comment('指标公式')" json:"target" binding:"required,oneof=1 2 "` //指标公式(1波论 2顶底)
  13. CreateTime time.Time `excel:"name=创建时间 " xorm:"datetime comment('创建时间')" json:"createTime" ` //创建时间
  14. CreateBy string `excel:"name=创建人 " xorm:"varchar(255) comment('创建人')" json:"createBy" ` //创建人
  15. UpdateTime time.Time `excel:"name=更新时间 " xorm:"datetime comment('更新时间')" json:"updateTime" ` //更新时间
  16. UpdateBy string `excel:"name=更新人 " xorm:"varchar(255) comment('更新人')" json:"updateBy" ` //更新人
  17. }
  18. func (this StockDetail) TableName() string {
  19. return "stock_detail"
  20. }
  21. func (this *StockDetail) Key() int64 {
  22. return this.Id
  23. }
  24. func (this *StockDetail) Model() interface{} {
  25. return this
  26. }
  27. func (this *StockDetail) BeforeUpdate() {
  28. user := base.GetCurUser()
  29. if user != nil {
  30. this.UpdateBy = user.Name
  31. }
  32. }
  33. func (this *StockDetail) BeforeInsert() {
  34. user := base.GetCurUser()
  35. if user != nil {
  36. this.CreateBy = user.Name
  37. this.UpdateBy = user.Name
  38. }
  39. }