17 changed files with 325 additions and 77 deletions
@ -0,0 +1,91 @@
|
||||
// ==========================================================================
|
||||
// Code generated by GoFrame CLI tool. DO NOT EDIT.
|
||||
// ==========================================================================
|
||||
|
||||
package internal |
||||
|
||||
import ( |
||||
"context" |
||||
|
||||
"github.com/gogf/gf/v2/database/gdb" |
||||
"github.com/gogf/gf/v2/frame/g" |
||||
) |
||||
|
||||
// ItemRecordsTwoDao is the data access object for table item_records_two.
|
||||
type ItemRecordsTwoDao struct { |
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns ItemRecordsTwoColumns // columns contains all the column names of Table for convenient usage.
|
||||
} |
||||
|
||||
// ItemRecordsTwoColumns defines and stores column names for table item_records_two.
|
||||
type ItemRecordsTwoColumns struct { |
||||
Id string // 唯一
|
||||
Uid string // 账号
|
||||
ItemId string // 物品Id
|
||||
Num string // 数量
|
||||
Way string // 消耗途径
|
||||
State string // 1:消耗,2:增加
|
||||
AddTime string // 添加时间
|
||||
CTime string // 创建记录时间
|
||||
Server string // 区服
|
||||
OldTotal string //
|
||||
} |
||||
|
||||
// itemRecordsTwoColumns holds the columns for table item_records_two.
|
||||
var itemRecordsTwoColumns = ItemRecordsTwoColumns{ |
||||
Id: "id", |
||||
Uid: "uid", |
||||
ItemId: "item_id", |
||||
Num: "num", |
||||
Way: "way", |
||||
State: "state", |
||||
AddTime: "add_time", |
||||
CTime: "c_time", |
||||
Server: "server", |
||||
OldTotal: "old_total", |
||||
} |
||||
|
||||
// NewItemRecordsTwoDao creates and returns a new DAO object for table data access.
|
||||
func NewItemRecordsTwoDao() *ItemRecordsTwoDao { |
||||
return &ItemRecordsTwoDao{ |
||||
group: "default", |
||||
table: "item_records_two", |
||||
columns: itemRecordsTwoColumns, |
||||
} |
||||
} |
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
func (dao *ItemRecordsTwoDao) DB() gdb.DB { |
||||
return g.DB(dao.group) |
||||
} |
||||
|
||||
// Table returns the table name of current dao.
|
||||
func (dao *ItemRecordsTwoDao) Table() string { |
||||
return dao.table |
||||
} |
||||
|
||||
// Columns returns all column names of current dao.
|
||||
func (dao *ItemRecordsTwoDao) Columns() ItemRecordsTwoColumns { |
||||
return dao.columns |
||||
} |
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
func (dao *ItemRecordsTwoDao) Group() string { |
||||
return dao.group |
||||
} |
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
func (dao *ItemRecordsTwoDao) Ctx(ctx context.Context) *gdb.Model { |
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx) |
||||
} |
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *ItemRecordsTwoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) { |
||||
return dao.Ctx(ctx).Transaction(ctx, f) |
||||
} |
@ -0,0 +1,27 @@
|
||||
// =================================================================================
|
||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
||||
// =================================================================================
|
||||
|
||||
package dao |
||||
|
||||
import ( |
||||
"tyj_admin/internal/dao/internal" |
||||
) |
||||
|
||||
// internalItemRecordsTwoDao is internal type for wrapping internal DAO implements.
|
||||
type internalItemRecordsTwoDao = *internal.ItemRecordsTwoDao |
||||
|
||||
// itemRecordsTwoDao is the data access object for table item_records_two.
|
||||
// You can define custom methods on it to extend its functionality as you wish.
|
||||
type itemRecordsTwoDao struct { |
||||
internalItemRecordsTwoDao |
||||
} |
||||
|
||||
var ( |
||||
// ItemRecordsTwo is globally public accessible object for table item_records_two operations.
|
||||
ItemRecordsTwo = itemRecordsTwoDao{ |
||||
internal.NewItemRecordsTwoDao(), |
||||
} |
||||
) |
||||
|
||||
// Fill with you ideas below.
|
@ -0,0 +1,25 @@
|
||||
// =================================================================================
|
||||
// Code generated by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package do |
||||
|
||||
import ( |
||||
"github.com/gogf/gf/v2/frame/g" |
||||
"github.com/gogf/gf/v2/os/gtime" |
||||
) |
||||
|
||||
// ItemRecordsTwo is the golang structure of table item_records_two for DAO operations like Where/Data.
|
||||
type ItemRecordsTwo struct { |
||||
g.Meta `orm:"table:item_records_two, do:true"` |
||||
Id interface{} // 唯一
|
||||
Uid interface{} // 账号
|
||||
ItemId interface{} // 物品Id
|
||||
Num interface{} // 数量
|
||||
Way interface{} // 消耗途径
|
||||
State interface{} // 1:消耗,2:增加
|
||||
AddTime interface{} // 添加时间
|
||||
CTime *gtime.Time // 创建记录时间
|
||||
Server interface{} // 区服
|
||||
OldTotal interface{} //
|
||||
} |
@ -0,0 +1,23 @@
|
||||
// =================================================================================
|
||||
// Code generated by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package entity |
||||
|
||||
import ( |
||||
"github.com/gogf/gf/v2/os/gtime" |
||||
) |
||||
|
||||
// ItemRecordsTwo is the golang structure for table item_records_two.
|
||||
type ItemRecordsTwo struct { |
||||
Id int64 `json:"id" description:"唯一"` |
||||
Uid int64 `json:"uid" description:"账号"` |
||||
ItemId int `json:"itemId" description:"物品Id"` |
||||
Num int64 `json:"num" description:"数量"` |
||||
Way string `json:"way" description:"消耗途径"` |
||||
State int `json:"state" description:"1:消耗,2:增加"` |
||||
AddTime int64 `json:"addTime" description:"添加时间"` |
||||
CTime *gtime.Time `json:"cTime" description:"创建记录时间"` |
||||
Server int `json:"server" description:"区服"` |
||||
OldTotal int64 `json:"oldTotal" description:""` |
||||
} |
Loading…
Reference in new issue