Browse Source

短剧短视频观看数量

master
huangjiajun 10 hours ago
parent
commit
f0ac655b8b
6 changed files with 96 additions and 0 deletions
  1. +7
    -0
      src/dao/playlet_total_dao.go
  2. +7
    -0
      src/dao/video_total_dao.go
  3. +28
    -0
      src/implement/playlet_total_implement.go
  4. +28
    -0
      src/implement/video_total_implement.go
  5. +13
    -0
      src/model/playlet_total.go
  6. +13
    -0
      src/model/video_total.go

+ 7
- 0
src/dao/playlet_total_dao.go View File

@@ -0,0 +1,7 @@
package dao

import "code.fnuoos.com/EggPlanet/egg_models.git/src/model"

type PlayletTotalDao interface {
GetPlayletTotal(uid, date string) (m *model.PlayletTotal, err error)
}

+ 7
- 0
src/dao/video_total_dao.go View File

@@ -0,0 +1,7 @@
package dao

import "code.fnuoos.com/EggPlanet/egg_models.git/src/model"

type VideoTotalDao interface {
GetVideoTotal(uid, date string) (m *model.VideoTotal, err error)
}

+ 28
- 0
src/implement/playlet_total_implement.go View File

@@ -0,0 +1,28 @@
package implement

import (
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao"
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx"
"xorm.io/xorm"
)

func NewPlayletTotalDb(engine *xorm.Engine) dao.PlayletTotalDao {
return &PlayletTotalDb{Db: engine}
}

type PlayletTotalDb struct {
Db *xorm.Engine
}

func (p PlayletTotalDb) GetPlayletTotal(uid, date string) (m *model.PlayletTotal, err error) {
m = new(model.PlayletTotal)
has, err := p.Db.Where("uid=? and date=?", uid, date).Get(m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return m, nil
}

+ 28
- 0
src/implement/video_total_implement.go View File

@@ -0,0 +1,28 @@
package implement

import (
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao"
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx"
"xorm.io/xorm"
)

func NewVideoTotalDb(engine *xorm.Engine) dao.VideoTotalDao {
return &VideoTotalDb{Db: engine}
}

type VideoTotalDb struct {
Db *xorm.Engine
}

func (v VideoTotalDb) GetVideoTotal(uid, date string) (m *model.VideoTotal, err error) {
m = new(model.VideoTotal)
has, err := v.Db.Where("uid=? and date=?", uid, date).Get(m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return m, nil
}

+ 13
- 0
src/model/playlet_total.go View File

@@ -0,0 +1,13 @@
package model

import (
"time"
)

type PlayletTotal struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
Uid int `json:"uid" xorm:"INT(11)"`
Date int `json:"date" xorm:"default 0 INT(11)"`
Time time.Time `json:"time" xorm:"DATETIME"`
Total int `json:"total" xorm:"default 0 INT(11)"`
}

+ 13
- 0
src/model/video_total.go View File

@@ -0,0 +1,13 @@
package model

import (
"time"
)

type VideoTotal struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
Uid int `json:"uid" xorm:"INT(11)"`
Date int `json:"date" xorm:"default 0 INT(11)"`
Time time.Time `json:"time" xorm:"DATETIME"`
Total int `json:"total" xorm:"default 0 INT(11)"`
}

Loading…
Cancel
Save