| 12345678910111213141516171819202122232425262728293031323334353637 |
- package log
- import (
- "go.uber.org/zap"
- "log-server/global"
- "time"
- )
- /*
- ip库
- */
- type IpLib struct {
- Id uint `json:"id"`
- Ip string `json:"ip"` //模拟器ip
- GameId int `json:"game_id"` //游戏id
- Status uint8 `json:"status"` //1表示可用,2表示不可用
- CreateTime time.Time `json:"create_time"` // 创建时间
- UpdateTime time.Time `json:"update_time"` // 更新时间
- }
- func (IpLib) TableName() string {
- return "ip_lib"
- }
- func (s *IpLib) AddIpLog(gameId int, ip string, status uint8) {
- if gameId != 5001 {
- return
- }
- s.GameId = gameId
- s.Ip = ip
- s.Status = status
- err := global.GVA_DB.Omit("create_time", "update_time").Create(&s).Error
- if err != nil {
- global.GVA_LOG.Error("create LogScanningCode fail", zap.Error(err))
- }
- }
|