diff --git a/app/api/collect/collect.go b/app/api/collect/collect.go new file mode 100644 index 0000000..dba2101 --- /dev/null +++ b/app/api/collect/collect.go @@ -0,0 +1,20 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package collect + +import ( + "context" + + "xgit.pub/module/cms/app/api/collect/v1" +) + +type ICollectV1 interface { + GetList(ctx context.Context, req *v1.GetListReq) (res *v1.GetListRes, err error) + Create(ctx context.Context, req *v1.CreateReq) (res *v1.CreateRes, err error) + Update(ctx context.Context, req *v1.UpdateReq) (res *v1.UpdateRes, err error) + Delete(ctx context.Context, req *v1.DeleteReq) (res *v1.DeleteRes, err error) + BatchDelete(ctx context.Context, req *v1.BatchDeleteReq) (res *v1.BatchDeleteRes, err error) + Get(ctx context.Context, req *v1.GetReq) (res *v1.GetRes, err error) +} diff --git a/app/api/collect/v1/collect.go b/app/api/collect/v1/collect.go new file mode 100644 index 0000000..38b27e4 --- /dev/null +++ b/app/api/collect/v1/collect.go @@ -0,0 +1,80 @@ +package v1 + +import ( + "github.com/gogf/gf/v2/frame/g" + "xgit.pub/st52/xcore/dto" +) + +// GetListReq 获取列表请求参数 +type GetListReq struct { + g.Meta `path:"/collect/list" method:"post" summary:"获取列表" tags:"采集"` + Key string `json:"key"` + dto.PageReq +} + +// GetListRes 获取列表返回参数 +type GetListRes struct { + dto.PageRes +} + +// CreateReq 创建请求参数 +type CreateReq struct { + g.Meta `path:"/collect/create" method:"post" summary:"创建" tags:"采集"` + Name string `json:"name" ` // 资源名 + Url string `json:"url" ` // + Param string `json:"param" ` // 参数 + Model uint `json:"model" ` // 类型 + Opt uint `json:"opt" ` // 操作方式 + Filter int `json:"filter" ` // 过滤模式 + FilterForm string `json:"filter_form" ` // + SyncPic uint `json:"sync_pic" ` // 同步图片 全局 2 开启 1 关闭0 + Class string `json:"class" ` // 扩展分类 逗号,分隔 +} + +// CreateRes 创建返回参数 +type CreateRes struct{} + +// UpdateReq 更新请求参数 +type UpdateReq struct { + g.Meta `path:"/collect/update" method:"post" summary:"更新" tags:"采集"` + Id uint `json:"id" ` // + Name string `json:"name" ` // 资源名 + Url string `json:"url" ` // + Param string `json:"param" ` // 参数 + Model uint `json:"model" ` // 类型 + Opt uint `json:"opt" ` // 操作方式 + Filter int `json:"filter" ` // 过滤模式 + FilterForm string `json:"filter_form" ` // + SyncPic uint `json:"sync_pic" ` // 同步图片 全局 2 开启 1 关闭0 + Class string `json:"class" ` // 扩展分类 逗号,分隔 +} + +// UpdateRes 更新请求返回参数 +type UpdateRes struct{} + +// DeleteReq 删除请求参数 +type DeleteReq struct { + g.Meta `path:"/collect/delete" method:"post" summary:"删除" tags:"采集"` + Id uint `json:"id"` +} + +// DeleteRes 删除返回参数 +type DeleteRes struct{} + +// BatchDeleteReq 批量删除请求参数 +type BatchDeleteReq struct { + g.Meta `path:"/collect/delete/batch" method:"post" summary:"批量删除" tags:"采集"` + Ids []uint `json:"ids"` +} + +// BatchDeleteRes 批量删除返回参数 +type BatchDeleteRes struct{} + +// GetReq 获取请求参数 +type GetReq struct { + g.Meta `path:"/collect/get" method:"post" summary:"获取" tags:"采集"` + Id uint `json:"id"` +} + +// GetRes 获取返回参数 +type GetRes struct{} diff --git a/app/controller/collect/collect.go b/app/controller/collect/collect.go new file mode 100644 index 0000000..24d71f5 --- /dev/null +++ b/app/controller/collect/collect.go @@ -0,0 +1,5 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package collect diff --git a/app/controller/collect/collect_new.go b/app/controller/collect/collect_new.go new file mode 100644 index 0000000..3b4e43c --- /dev/null +++ b/app/controller/collect/collect_new.go @@ -0,0 +1,15 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package collect + +import ( + "xgit.pub/module/cms/app/api/collect" +) + +type ControllerV1 struct{} + +func NewV1() collect.ICollectV1 { + return &ControllerV1{} +} diff --git a/app/controller/collect/collect_v1_batch_delete.go b/app/controller/collect/collect_v1_batch_delete.go new file mode 100644 index 0000000..6b5919c --- /dev/null +++ b/app/controller/collect/collect_v1_batch_delete.go @@ -0,0 +1,13 @@ +package collect + +import ( + "context" + "xgit.pub/module/cms/app/service" + + "xgit.pub/module/cms/app/api/collect/v1" +) + +func (c *ControllerV1) BatchDelete(ctx context.Context, req *v1.BatchDeleteReq) (res *v1.BatchDeleteRes, err error) { + res, err = service.Collect().BatchDelete(ctx, req) + return +} diff --git a/app/controller/collect/collect_v1_create.go b/app/controller/collect/collect_v1_create.go new file mode 100644 index 0000000..5e7984d --- /dev/null +++ b/app/controller/collect/collect_v1_create.go @@ -0,0 +1,13 @@ +package collect + +import ( + "context" + "xgit.pub/module/cms/app/service" + + "xgit.pub/module/cms/app/api/collect/v1" +) + +func (c *ControllerV1) Create(ctx context.Context, req *v1.CreateReq) (res *v1.CreateRes, err error) { + res, err = service.Collect().Create(ctx, req) + return +} diff --git a/app/controller/collect/collect_v1_delete.go b/app/controller/collect/collect_v1_delete.go new file mode 100644 index 0000000..bd0a546 --- /dev/null +++ b/app/controller/collect/collect_v1_delete.go @@ -0,0 +1,13 @@ +package collect + +import ( + "context" + "xgit.pub/module/cms/app/service" + + "xgit.pub/module/cms/app/api/collect/v1" +) + +func (c *ControllerV1) Delete(ctx context.Context, req *v1.DeleteReq) (res *v1.DeleteRes, err error) { + res, err = service.Collect().Delete(ctx, req) + return +} diff --git a/app/controller/collect/collect_v1_get.go b/app/controller/collect/collect_v1_get.go new file mode 100644 index 0000000..2fb5412 --- /dev/null +++ b/app/controller/collect/collect_v1_get.go @@ -0,0 +1,13 @@ +package collect + +import ( + "context" + "xgit.pub/module/cms/app/service" + + "xgit.pub/module/cms/app/api/collect/v1" +) + +func (c *ControllerV1) Get(ctx context.Context, req *v1.GetReq) (res *v1.GetRes, err error) { + res, err = service.Collect().Get(ctx, req) + return +} diff --git a/app/controller/collect/collect_v1_get_list.go b/app/controller/collect/collect_v1_get_list.go new file mode 100644 index 0000000..9eaf742 --- /dev/null +++ b/app/controller/collect/collect_v1_get_list.go @@ -0,0 +1,13 @@ +package collect + +import ( + "context" + "xgit.pub/module/cms/app/service" + + "xgit.pub/module/cms/app/api/collect/v1" +) + +func (c *ControllerV1) GetList(ctx context.Context, req *v1.GetListReq) (res *v1.GetListRes, err error) { + res, err = service.Collect().GetList(ctx, req) + return +} diff --git a/app/controller/collect/collect_v1_update.go b/app/controller/collect/collect_v1_update.go new file mode 100644 index 0000000..5f2b0dd --- /dev/null +++ b/app/controller/collect/collect_v1_update.go @@ -0,0 +1,13 @@ +package collect + +import ( + "context" + "xgit.pub/module/cms/app/service" + + "xgit.pub/module/cms/app/api/collect/v1" +) + +func (c *ControllerV1) Update(ctx context.Context, req *v1.UpdateReq) (res *v1.UpdateRes, err error) { + res, err = service.Collect().Update(ctx, req) + return +} diff --git a/app/dao/category.go b/app/dao/category.go new file mode 100644 index 0000000..844841a --- /dev/null +++ b/app/dao/category.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package dao + +import ( + "xgit.pub/module/cms/app/dao/internal" +) + +// internalCategoryDao is internal type for wrapping internal DAO implements. +type internalCategoryDao = *internal.CategoryDao + +// categoryDao is the data access object for table cms_category. +// You can define custom methods on it to extend its functionality as you wish. +type categoryDao struct { + internalCategoryDao +} + +var ( + // Category is globally public accessible object for table cms_category operations. + Category = categoryDao{ + internal.NewCategoryDao(), + } +) + +// Fill with you ideas below. diff --git a/app/dao/collect.go b/app/dao/collect.go new file mode 100644 index 0000000..87e1657 --- /dev/null +++ b/app/dao/collect.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package dao + +import ( + "xgit.pub/module/cms/app/dao/internal" +) + +// internalCollectDao is internal type for wrapping internal DAO implements. +type internalCollectDao = *internal.CollectDao + +// collectDao is the data access object for table cms_collect. +// You can define custom methods on it to extend its functionality as you wish. +type collectDao struct { + internalCollectDao +} + +var ( + // Collect is globally public accessible object for table cms_collect operations. + Collect = collectDao{ + internal.NewCollectDao(), + } +) + +// Fill with you ideas below. diff --git a/app/dao/collect_bind.go b/app/dao/collect_bind.go new file mode 100644 index 0000000..269df19 --- /dev/null +++ b/app/dao/collect_bind.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package dao + +import ( + "xgit.pub/module/cms/app/dao/internal" +) + +// internalCollectBindDao is internal type for wrapping internal DAO implements. +type internalCollectBindDao = *internal.CollectBindDao + +// collectBindDao is the data access object for table cms_collect_bind. +// You can define custom methods on it to extend its functionality as you wish. +type collectBindDao struct { + internalCollectBindDao +} + +var ( + // CollectBind is globally public accessible object for table cms_collect_bind operations. + CollectBind = collectBindDao{ + internal.NewCollectBindDao(), + } +) + +// Fill with you ideas below. diff --git a/app/dao/collect_task.go b/app/dao/collect_task.go new file mode 100644 index 0000000..9a83348 --- /dev/null +++ b/app/dao/collect_task.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package dao + +import ( + "xgit.pub/module/cms/app/dao/internal" +) + +// internalCollectTaskDao is internal type for wrapping internal DAO implements. +type internalCollectTaskDao = *internal.CollectTaskDao + +// collectTaskDao is the data access object for table cms_collect_task. +// You can define custom methods on it to extend its functionality as you wish. +type collectTaskDao struct { + internalCollectTaskDao +} + +var ( + // CollectTask is globally public accessible object for table cms_collect_task operations. + CollectTask = collectTaskDao{ + internal.NewCollectTaskDao(), + } +) + +// Fill with you ideas below. diff --git a/app/dao/config.go b/app/dao/config.go new file mode 100644 index 0000000..717ac7e --- /dev/null +++ b/app/dao/config.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package dao + +import ( + "xgit.pub/module/cms/app/dao/internal" +) + +// internalConfigDao is internal type for wrapping internal DAO implements. +type internalConfigDao = *internal.ConfigDao + +// configDao is the data access object for table cms_config. +// You can define custom methods on it to extend its functionality as you wish. +type configDao struct { + internalConfigDao +} + +var ( + // Config is globally public accessible object for table cms_config operations. + Config = configDao{ + internal.NewConfigDao(), + } +) + +// Fill with you ideas below. diff --git a/app/dao/favorite.go b/app/dao/favorite.go new file mode 100644 index 0000000..5d00afe --- /dev/null +++ b/app/dao/favorite.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package dao + +import ( + "xgit.pub/module/cms/app/dao/internal" +) + +// internalFavoriteDao is internal type for wrapping internal DAO implements. +type internalFavoriteDao = *internal.FavoriteDao + +// favoriteDao is the data access object for table cms_favorite. +// You can define custom methods on it to extend its functionality as you wish. +type favoriteDao struct { + internalFavoriteDao +} + +var ( + // Favorite is globally public accessible object for table cms_favorite operations. + Favorite = favoriteDao{ + internal.NewFavoriteDao(), + } +) + +// Fill with you ideas below. diff --git a/app/dao/hot_class.go b/app/dao/hot_class.go new file mode 100644 index 0000000..2ac774d --- /dev/null +++ b/app/dao/hot_class.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package dao + +import ( + "xgit.pub/module/cms/app/dao/internal" +) + +// internalHotClassDao is internal type for wrapping internal DAO implements. +type internalHotClassDao = *internal.HotClassDao + +// hotClassDao is the data access object for table cms_hot_class. +// You can define custom methods on it to extend its functionality as you wish. +type hotClassDao struct { + internalHotClassDao +} + +var ( + // HotClass is globally public accessible object for table cms_hot_class operations. + HotClass = hotClassDao{ + internal.NewHotClassDao(), + } +) + +// Fill with you ideas below. diff --git a/app/dao/hot_video.go b/app/dao/hot_video.go new file mode 100644 index 0000000..3fb2e6e --- /dev/null +++ b/app/dao/hot_video.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package dao + +import ( + "xgit.pub/module/cms/app/dao/internal" +) + +// internalHotVideoDao is internal type for wrapping internal DAO implements. +type internalHotVideoDao = *internal.HotVideoDao + +// hotVideoDao is the data access object for table cms_hot_video. +// You can define custom methods on it to extend its functionality as you wish. +type hotVideoDao struct { + internalHotVideoDao +} + +var ( + // HotVideo is globally public accessible object for table cms_hot_video operations. + HotVideo = hotVideoDao{ + internal.NewHotVideoDao(), + } +) + +// Fill with you ideas below. diff --git a/app/dao/hotkey.go b/app/dao/hotkey.go new file mode 100644 index 0000000..1fb9f1f --- /dev/null +++ b/app/dao/hotkey.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package dao + +import ( + "xgit.pub/module/cms/app/dao/internal" +) + +// internalHotkeyDao is internal type for wrapping internal DAO implements. +type internalHotkeyDao = *internal.HotkeyDao + +// hotkeyDao is the data access object for table cms_hotkey. +// You can define custom methods on it to extend its functionality as you wish. +type hotkeyDao struct { + internalHotkeyDao +} + +var ( + // Hotkey is globally public accessible object for table cms_hotkey operations. + Hotkey = hotkeyDao{ + internal.NewHotkeyDao(), + } +) + +// Fill with you ideas below. diff --git a/app/dao/internal/category.go b/app/dao/internal/category.go new file mode 100644 index 0000000..9e5ed5c --- /dev/null +++ b/app/dao/internal/category.go @@ -0,0 +1,101 @@ +// ========================================================================== +// Code generated and maintained 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" +) + +// CategoryDao is the data access object for table cms_category. +type CategoryDao 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 CategoryColumns // columns contains all the column names of Table for convenient usage. +} + +// CategoryColumns defines and stores column names for table cms_category. +type CategoryColumns struct { + Id string // + ParentId string // 父节点 + Name string // 分类名字 + Union string // 关联 + Sort string // 排序 + Status string // 状态 + SeoTitle string // + SeoKey string // + SeoDes string // + TplIndex string // Index + TplList string // List + TplDetail string // Detail + TplDown string // Down + TplPlay string // player + Extend string // 扩展属性 集合 +} + +// categoryColumns holds the columns for table cms_category. +var categoryColumns = CategoryColumns{ + Id: "id", + ParentId: "parent_id", + Name: "name", + Union: "union", + Sort: "sort", + Status: "status", + SeoTitle: "seo_title", + SeoKey: "seo_key", + SeoDes: "seo_des", + TplIndex: "tpl_index", + TplList: "tpl_list", + TplDetail: "tpl_detail", + TplDown: "tpl_down", + TplPlay: "tpl_play", + Extend: "extend", +} + +// NewCategoryDao creates and returns a new DAO object for table data access. +func NewCategoryDao() *CategoryDao { + return &CategoryDao{ + group: "cms", + table: "cms_category", + columns: categoryColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *CategoryDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *CategoryDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *CategoryDao) Columns() CategoryColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *CategoryDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *CategoryDao) 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 *CategoryDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/app/dao/internal/collect.go b/app/dao/internal/collect.go new file mode 100644 index 0000000..fe44406 --- /dev/null +++ b/app/dao/internal/collect.go @@ -0,0 +1,91 @@ +// ========================================================================== +// Code generated and maintained 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" +) + +// CollectDao is the data access object for table cms_collect. +type CollectDao 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 CollectColumns // columns contains all the column names of Table for convenient usage. +} + +// CollectColumns defines and stores column names for table cms_collect. +type CollectColumns struct { + Id string // + Name string // 资源名 + Url string // + Param string // 参数 + Model string // 类型 + Opt string // 操作方式 + Filter string // 过滤模式 + FilterForm string // + SyncPic string // 同步图片 全局 2 开启 1 关闭0 + Class string // 扩展分类 逗号,分隔 +} + +// collectColumns holds the columns for table cms_collect. +var collectColumns = CollectColumns{ + Id: "id", + Name: "name", + Url: "url", + Param: "param", + Model: "model", + Opt: "opt", + Filter: "filter", + FilterForm: "filter_form", + SyncPic: "sync_pic", + Class: "class", +} + +// NewCollectDao creates and returns a new DAO object for table data access. +func NewCollectDao() *CollectDao { + return &CollectDao{ + group: "cms", + table: "cms_collect", + columns: collectColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *CollectDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *CollectDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *CollectDao) Columns() CollectColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *CollectDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *CollectDao) 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 *CollectDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/app/dao/internal/collect_bind.go b/app/dao/internal/collect_bind.go new file mode 100644 index 0000000..b3ab418 --- /dev/null +++ b/app/dao/internal/collect_bind.go @@ -0,0 +1,79 @@ +// ========================================================================== +// Code generated and maintained 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" +) + +// CollectBindDao is the data access object for table cms_collect_bind. +type CollectBindDao 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 CollectBindColumns // columns contains all the column names of Table for convenient usage. +} + +// CollectBindColumns defines and stores column names for table cms_collect_bind. +type CollectBindColumns struct { + Id string // + CollectId string // + CategoryId string // + SourceId string // +} + +// collectBindColumns holds the columns for table cms_collect_bind. +var collectBindColumns = CollectBindColumns{ + Id: "id", + CollectId: "collect_id", + CategoryId: "category_id", + SourceId: "source_id", +} + +// NewCollectBindDao creates and returns a new DAO object for table data access. +func NewCollectBindDao() *CollectBindDao { + return &CollectBindDao{ + group: "cms", + table: "cms_collect_bind", + columns: collectBindColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *CollectBindDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *CollectBindDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *CollectBindDao) Columns() CollectBindColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *CollectBindDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *CollectBindDao) 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 *CollectBindDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/app/dao/internal/collect_task.go b/app/dao/internal/collect_task.go new file mode 100644 index 0000000..5386707 --- /dev/null +++ b/app/dao/internal/collect_task.go @@ -0,0 +1,97 @@ +// ========================================================================== +// Code generated and maintained 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" +) + +// CollectTaskDao is the data access object for table cms_collect_task. +type CollectTaskDao 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 CollectTaskColumns // columns contains all the column names of Table for convenient usage. +} + +// CollectTaskColumns defines and stores column names for table cms_collect_task. +type CollectTaskColumns struct { + Id string // + CollectId string // 采集 + Running string // 是否运行中 + Progress string // 进度 + Status string // 状态 + Current string // 当前 + Total string // 总记录 + PageCount string // 总页数 + CurrentPage string // 当前页 + StartTime string // 开始时间 + LastTime string // 最后提交时间 + EndTime string // 结束时间 + UpdateTime string // 采集多少时间内 +} + +// collectTaskColumns holds the columns for table cms_collect_task. +var collectTaskColumns = CollectTaskColumns{ + Id: "id", + CollectId: "collect_id", + Running: "running", + Progress: "progress", + Status: "status", + Current: "current", + Total: "total", + PageCount: "page_count", + CurrentPage: "current_page", + StartTime: "start_time", + LastTime: "last_time", + EndTime: "end_time", + UpdateTime: "update_time", +} + +// NewCollectTaskDao creates and returns a new DAO object for table data access. +func NewCollectTaskDao() *CollectTaskDao { + return &CollectTaskDao{ + group: "cms", + table: "cms_collect_task", + columns: collectTaskColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *CollectTaskDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *CollectTaskDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *CollectTaskDao) Columns() CollectTaskColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *CollectTaskDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *CollectTaskDao) 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 *CollectTaskDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/app/dao/internal/config.go b/app/dao/internal/config.go new file mode 100644 index 0000000..eb4bfb4 --- /dev/null +++ b/app/dao/internal/config.go @@ -0,0 +1,81 @@ +// ========================================================================== +// Code generated and maintained 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" +) + +// ConfigDao is the data access object for table cms_config. +type ConfigDao 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 ConfigColumns // columns contains all the column names of Table for convenient usage. +} + +// ConfigColumns defines and stores column names for table cms_config. +type ConfigColumns struct { + Id string // + Name string // + Value string // + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 +} + +// configColumns holds the columns for table cms_config. +var configColumns = ConfigColumns{ + Id: "id", + Name: "name", + Value: "value", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewConfigDao creates and returns a new DAO object for table data access. +func NewConfigDao() *ConfigDao { + return &ConfigDao{ + group: "cms", + table: "cms_config", + columns: configColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *ConfigDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *ConfigDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *ConfigDao) Columns() ConfigColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *ConfigDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *ConfigDao) 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 *ConfigDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/app/dao/internal/favorite.go b/app/dao/internal/favorite.go new file mode 100644 index 0000000..b1910fb --- /dev/null +++ b/app/dao/internal/favorite.go @@ -0,0 +1,87 @@ +// ========================================================================== +// Code generated and maintained 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" +) + +// FavoriteDao is the data access object for table cms_favorite. +type FavoriteDao 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 FavoriteColumns // columns contains all the column names of Table for convenient usage. +} + +// FavoriteColumns defines and stores column names for table cms_favorite. +type FavoriteColumns struct { + Id string // + VideoId string // + VideoTitle string // + VideoPic string // + UserId string // + RecordId string // + CreatedAt string // + UpdatedAt string // +} + +// favoriteColumns holds the columns for table cms_favorite. +var favoriteColumns = FavoriteColumns{ + Id: "id", + VideoId: "video_id", + VideoTitle: "video_title", + VideoPic: "video_pic", + UserId: "user_id", + RecordId: "record_id", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewFavoriteDao creates and returns a new DAO object for table data access. +func NewFavoriteDao() *FavoriteDao { + return &FavoriteDao{ + group: "cms", + table: "cms_favorite", + columns: favoriteColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *FavoriteDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *FavoriteDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *FavoriteDao) Columns() FavoriteColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *FavoriteDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *FavoriteDao) 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 *FavoriteDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/app/dao/internal/hot_class.go b/app/dao/internal/hot_class.go new file mode 100644 index 0000000..fab957c --- /dev/null +++ b/app/dao/internal/hot_class.go @@ -0,0 +1,83 @@ +// ========================================================================== +// Code generated and maintained 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" +) + +// HotClassDao is the data access object for table cms_hot_class. +type HotClassDao 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 HotClassColumns // columns contains all the column names of Table for convenient usage. +} + +// HotClassColumns defines and stores column names for table cms_hot_class. +type HotClassColumns struct { + Id string // + TypeName string // 名字 + Code string // 代码 + Url string // 地址 + Param string // 参数 + Status string // 状态 +} + +// hotClassColumns holds the columns for table cms_hot_class. +var hotClassColumns = HotClassColumns{ + Id: "id", + TypeName: "type_name", + Code: "code", + Url: "url", + Param: "param", + Status: "status", +} + +// NewHotClassDao creates and returns a new DAO object for table data access. +func NewHotClassDao() *HotClassDao { + return &HotClassDao{ + group: "cms", + table: "cms_hot_class", + columns: hotClassColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *HotClassDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *HotClassDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *HotClassDao) Columns() HotClassColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *HotClassDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *HotClassDao) 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 *HotClassDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/app/dao/internal/hot_video.go b/app/dao/internal/hot_video.go new file mode 100644 index 0000000..c657e5f --- /dev/null +++ b/app/dao/internal/hot_video.go @@ -0,0 +1,89 @@ +// ========================================================================== +// Code generated and maintained 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" +) + +// HotVideoDao is the data access object for table cms_hot_video. +type HotVideoDao 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 HotVideoColumns // columns contains all the column names of Table for convenient usage. +} + +// HotVideoColumns defines and stores column names for table cms_hot_video. +type HotVideoColumns struct { + Id string // + ClassId string // + VodName string // + VodPic string // + VodTime string // + Score string // + CreatedAt string // + UpdatedAt string // + DeletedAt string // +} + +// hotVideoColumns holds the columns for table cms_hot_video. +var hotVideoColumns = HotVideoColumns{ + Id: "id", + ClassId: "class_id", + VodName: "vod_name", + VodPic: "vod_pic", + VodTime: "vod_time", + Score: "score", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + DeletedAt: "deleted_at", +} + +// NewHotVideoDao creates and returns a new DAO object for table data access. +func NewHotVideoDao() *HotVideoDao { + return &HotVideoDao{ + group: "cms", + table: "cms_hot_video", + columns: hotVideoColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *HotVideoDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *HotVideoDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *HotVideoDao) Columns() HotVideoColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *HotVideoDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *HotVideoDao) 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 *HotVideoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/app/dao/internal/hotkey.go b/app/dao/internal/hotkey.go new file mode 100644 index 0000000..62a87a2 --- /dev/null +++ b/app/dao/internal/hotkey.go @@ -0,0 +1,77 @@ +// ========================================================================== +// Code generated and maintained 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" +) + +// HotkeyDao is the data access object for table cms_hotkey. +type HotkeyDao 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 HotkeyColumns // columns contains all the column names of Table for convenient usage. +} + +// HotkeyColumns defines and stores column names for table cms_hotkey. +type HotkeyColumns struct { + Id string // + Keyword string // + Sort string // +} + +// hotkeyColumns holds the columns for table cms_hotkey. +var hotkeyColumns = HotkeyColumns{ + Id: "id", + Keyword: "keyword", + Sort: "sort", +} + +// NewHotkeyDao creates and returns a new DAO object for table data access. +func NewHotkeyDao() *HotkeyDao { + return &HotkeyDao{ + group: "cms", + table: "cms_hotkey", + columns: hotkeyColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *HotkeyDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *HotkeyDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *HotkeyDao) Columns() HotkeyColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *HotkeyDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *HotkeyDao) 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 *HotkeyDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/app/dao/internal/log.go b/app/dao/internal/log.go new file mode 100644 index 0000000..0b2ea40 --- /dev/null +++ b/app/dao/internal/log.go @@ -0,0 +1,91 @@ +// ========================================================================== +// Code generated and maintained 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" +) + +// LogDao is the data access object for table cms_log. +type LogDao 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 LogColumns // columns contains all the column names of Table for convenient usage. +} + +// LogColumns defines and stores column names for table cms_log. +type LogColumns struct { + Id string // + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 + Type string // 日志类别 + Title string // 日志说明 + Error string // 错误信息 + SendStatus string // 发送状态 | 处理状态 + IsView string // 已读 + ViewAt string // 访问时间 + UserId string // 操作员ID +} + +// logColumns holds the columns for table cms_log. +var logColumns = LogColumns{ + Id: "id", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + Type: "type", + Title: "title", + Error: "error", + SendStatus: "send_status", + IsView: "is_view", + ViewAt: "view_at", + UserId: "user_id", +} + +// NewLogDao creates and returns a new DAO object for table data access. +func NewLogDao() *LogDao { + return &LogDao{ + group: "cms", + table: "cms_log", + columns: logColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *LogDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *LogDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *LogDao) Columns() LogColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *LogDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *LogDao) 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 *LogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/app/dao/internal/player.go b/app/dao/internal/player.go new file mode 100644 index 0000000..85593ab --- /dev/null +++ b/app/dao/internal/player.go @@ -0,0 +1,95 @@ +// ========================================================================== +// Code generated and maintained 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" +) + +// PlayerDao is the data access object for table cms_player. +type PlayerDao 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 PlayerColumns // columns contains all the column names of Table for convenient usage. +} + +// PlayerColumns defines and stores column names for table cms_player. +type PlayerColumns struct { + Id string // + Status string // 状态 + From string // 编码格式 + Name string // 名称 + Target string // 目标窗口 + Parse string // 解析状态 + ParseApi string // 解析地址 + Sort string // 排序 + Tip string // 提示 + Filename string // 文件名称 + Code string // 编码 + Remark string // 备注 +} + +// playerColumns holds the columns for table cms_player. +var playerColumns = PlayerColumns{ + Id: "id", + Status: "status", + From: "from", + Name: "name", + Target: "target", + Parse: "parse", + ParseApi: "parse_api", + Sort: "sort", + Tip: "tip", + Filename: "filename", + Code: "code", + Remark: "remark", +} + +// NewPlayerDao creates and returns a new DAO object for table data access. +func NewPlayerDao() *PlayerDao { + return &PlayerDao{ + group: "cms", + table: "cms_player", + columns: playerColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *PlayerDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *PlayerDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *PlayerDao) Columns() PlayerColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *PlayerDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *PlayerDao) 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 *PlayerDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/app/dao/internal/player_record.go b/app/dao/internal/player_record.go new file mode 100644 index 0000000..ae7cdcd --- /dev/null +++ b/app/dao/internal/player_record.go @@ -0,0 +1,91 @@ +// ========================================================================== +// Code generated and maintained 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" +) + +// PlayerRecordDao is the data access object for table cms_player_record. +type PlayerRecordDao 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 PlayerRecordColumns // columns contains all the column names of Table for convenient usage. +} + +// PlayerRecordColumns defines and stores column names for table cms_player_record. +type PlayerRecordColumns struct { + Id string // + VideoId string // 视频编号 + VideoTitle string // + VideoPic string // + UserId string // 用户编号 + LineId string // 线路编号 + PlayId string // 播放编号 + PlayTime string // 播放时间节点 + CreatedAt string // + UpdatedAt string // +} + +// playerRecordColumns holds the columns for table cms_player_record. +var playerRecordColumns = PlayerRecordColumns{ + Id: "id", + VideoId: "video_id", + VideoTitle: "video_title", + VideoPic: "video_pic", + UserId: "user_id", + LineId: "line_id", + PlayId: "play_id", + PlayTime: "play_time", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewPlayerRecordDao creates and returns a new DAO object for table data access. +func NewPlayerRecordDao() *PlayerRecordDao { + return &PlayerRecordDao{ + group: "cms", + table: "cms_player_record", + columns: playerRecordColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *PlayerRecordDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *PlayerRecordDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *PlayerRecordDao) Columns() PlayerRecordColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *PlayerRecordDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *PlayerRecordDao) 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 *PlayerRecordDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/app/dao/internal/search_keyword.go b/app/dao/internal/search_keyword.go new file mode 100644 index 0000000..988888b --- /dev/null +++ b/app/dao/internal/search_keyword.go @@ -0,0 +1,81 @@ +// ========================================================================== +// Code generated and maintained 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" +) + +// SearchKeywordDao is the data access object for table cms_search_keyword. +type SearchKeywordDao 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 SearchKeywordColumns // columns contains all the column names of Table for convenient usage. +} + +// SearchKeywordColumns defines and stores column names for table cms_search_keyword. +type SearchKeywordColumns struct { + Id string // 主键 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 + Keyword string // 搜索关键字 + Total string // 搜索次数 +} + +// searchKeywordColumns holds the columns for table cms_search_keyword. +var searchKeywordColumns = SearchKeywordColumns{ + Id: "id", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + Keyword: "keyword", + Total: "total", +} + +// NewSearchKeywordDao creates and returns a new DAO object for table data access. +func NewSearchKeywordDao() *SearchKeywordDao { + return &SearchKeywordDao{ + group: "cms", + table: "cms_search_keyword", + columns: searchKeywordColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *SearchKeywordDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *SearchKeywordDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *SearchKeywordDao) Columns() SearchKeywordColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *SearchKeywordDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *SearchKeywordDao) 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 *SearchKeywordDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/app/dao/internal/short_chapter.go b/app/dao/internal/short_chapter.go new file mode 100644 index 0000000..2309a85 --- /dev/null +++ b/app/dao/internal/short_chapter.go @@ -0,0 +1,91 @@ +// ========================================================================== +// Code generated and maintained 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" +) + +// ShortChapterDao is the data access object for table cms_short_chapter. +type ShortChapterDao 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 ShortChapterColumns // columns contains all the column names of Table for convenient usage. +} + +// ShortChapterColumns defines and stores column names for table cms_short_chapter. +type ShortChapterColumns struct { + Id string // + ShortVideoId string // 短剧编号 + ChapterNum string // 短剧序号 + Title string // 章节标题 + Subtitles string // 为后期识别字幕做准备 + SourceUrl string // 源地址 + CdnUrl string // CDN 地址 + Chapter string // 章节介绍 + CreatedAt string // + UpdatedAt string // +} + +// shortChapterColumns holds the columns for table cms_short_chapter. +var shortChapterColumns = ShortChapterColumns{ + Id: "id", + ShortVideoId: "short_video_id", + ChapterNum: "chapter_num", + Title: "title", + Subtitles: "subtitles", + SourceUrl: "source_url", + CdnUrl: "cdn_url", + Chapter: "chapter", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewShortChapterDao creates and returns a new DAO object for table data access. +func NewShortChapterDao() *ShortChapterDao { + return &ShortChapterDao{ + group: "cms", + table: "cms_short_chapter", + columns: shortChapterColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *ShortChapterDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *ShortChapterDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *ShortChapterDao) Columns() ShortChapterColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *ShortChapterDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *ShortChapterDao) 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 *ShortChapterDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/app/dao/internal/short_play_urls.go b/app/dao/internal/short_play_urls.go new file mode 100644 index 0000000..258bc0f --- /dev/null +++ b/app/dao/internal/short_play_urls.go @@ -0,0 +1,77 @@ +// ========================================================================== +// Code generated and maintained 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" +) + +// ShortPlayUrlsDao is the data access object for table cms_short_play_urls. +type ShortPlayUrlsDao 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 ShortPlayUrlsColumns // columns contains all the column names of Table for convenient usage. +} + +// ShortPlayUrlsColumns defines and stores column names for table cms_short_play_urls. +type ShortPlayUrlsColumns struct { + Id string // + ShortVideoId string // + Res string // +} + +// shortPlayUrlsColumns holds the columns for table cms_short_play_urls. +var shortPlayUrlsColumns = ShortPlayUrlsColumns{ + Id: "id", + ShortVideoId: "short_video_id", + Res: "res", +} + +// NewShortPlayUrlsDao creates and returns a new DAO object for table data access. +func NewShortPlayUrlsDao() *ShortPlayUrlsDao { + return &ShortPlayUrlsDao{ + group: "cms", + table: "cms_short_play_urls", + columns: shortPlayUrlsColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *ShortPlayUrlsDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *ShortPlayUrlsDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *ShortPlayUrlsDao) Columns() ShortPlayUrlsColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *ShortPlayUrlsDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *ShortPlayUrlsDao) 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 *ShortPlayUrlsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/app/dao/internal/short_player.go b/app/dao/internal/short_player.go new file mode 100644 index 0000000..d3aa84d --- /dev/null +++ b/app/dao/internal/short_player.go @@ -0,0 +1,79 @@ +// ========================================================================== +// Code generated and maintained 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" +) + +// ShortPlayerDao is the data access object for table cms_short_player. +type ShortPlayerDao 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 ShortPlayerColumns // columns contains all the column names of Table for convenient usage. +} + +// ShortPlayerColumns defines and stores column names for table cms_short_player. +type ShortPlayerColumns struct { + Id string // + Name string // + Sort string // + Status string // +} + +// shortPlayerColumns holds the columns for table cms_short_player. +var shortPlayerColumns = ShortPlayerColumns{ + Id: "id", + Name: "name", + Sort: "sort", + Status: "status", +} + +// NewShortPlayerDao creates and returns a new DAO object for table data access. +func NewShortPlayerDao() *ShortPlayerDao { + return &ShortPlayerDao{ + group: "cms", + table: "cms_short_player", + columns: shortPlayerColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *ShortPlayerDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *ShortPlayerDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *ShortPlayerDao) Columns() ShortPlayerColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *ShortPlayerDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *ShortPlayerDao) 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 *ShortPlayerDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/app/dao/internal/short_tags.go b/app/dao/internal/short_tags.go new file mode 100644 index 0000000..5b90a24 --- /dev/null +++ b/app/dao/internal/short_tags.go @@ -0,0 +1,79 @@ +// ========================================================================== +// Code generated and maintained 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" +) + +// ShortTagsDao is the data access object for table cms_short_tags. +type ShortTagsDao 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 ShortTagsColumns // columns contains all the column names of Table for convenient usage. +} + +// ShortTagsColumns defines and stores column names for table cms_short_tags. +type ShortTagsColumns struct { + Id string // + Tag string // + Count string // + Sort string // +} + +// shortTagsColumns holds the columns for table cms_short_tags. +var shortTagsColumns = ShortTagsColumns{ + Id: "id", + Tag: "tag", + Count: "count", + Sort: "sort", +} + +// NewShortTagsDao creates and returns a new DAO object for table data access. +func NewShortTagsDao() *ShortTagsDao { + return &ShortTagsDao{ + group: "cms", + table: "cms_short_tags", + columns: shortTagsColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *ShortTagsDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *ShortTagsDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *ShortTagsDao) Columns() ShortTagsColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *ShortTagsDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *ShortTagsDao) 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 *ShortTagsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/app/dao/internal/short_video.go b/app/dao/internal/short_video.go new file mode 100644 index 0000000..86267d2 --- /dev/null +++ b/app/dao/internal/short_video.go @@ -0,0 +1,109 @@ +// ========================================================================== +// Code generated and maintained 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" +) + +// ShortVideoDao is the data access object for table cms_short_video. +type ShortVideoDao 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 ShortVideoColumns // columns contains all the column names of Table for convenient usage. +} + +// ShortVideoColumns defines and stores column names for table cms_short_video. +type ShortVideoColumns struct { + Id string // + Title string // 标题 + Introduction string // + Tag string // 标签 + Author string // 作者 + Actor string // 演员 + Protagonist string // 主角 + Cover string // 封面 + CoverUrl string // 封面 + ChapterUrls string // 资源地址 + ChapterCount string // 当前章节 + ChapterMax string // 共人章节 + Status string // 状态 0未审核 1更新中 2完结 + Views string // 观看次数 + Stars string // 标星 + CreatedAt string // + UpdatedAt string // + FinishStatus string // + Online string // +} + +// shortVideoColumns holds the columns for table cms_short_video. +var shortVideoColumns = ShortVideoColumns{ + Id: "id", + Title: "title", + Introduction: "introduction", + Tag: "tag", + Author: "author", + Actor: "actor", + Protagonist: "protagonist", + Cover: "cover", + CoverUrl: "cover_url", + ChapterUrls: "chapter_urls", + ChapterCount: "chapter_count", + ChapterMax: "chapter_max", + Status: "status", + Views: "views", + Stars: "stars", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + FinishStatus: "finish_status", + Online: "online", +} + +// NewShortVideoDao creates and returns a new DAO object for table data access. +func NewShortVideoDao() *ShortVideoDao { + return &ShortVideoDao{ + group: "cms", + table: "cms_short_video", + columns: shortVideoColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *ShortVideoDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *ShortVideoDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *ShortVideoDao) Columns() ShortVideoColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *ShortVideoDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *ShortVideoDao) 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 *ShortVideoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/app/dao/internal/site_domain.go b/app/dao/internal/site_domain.go new file mode 100644 index 0000000..2d4f30e --- /dev/null +++ b/app/dao/internal/site_domain.go @@ -0,0 +1,91 @@ +// ========================================================================== +// Code generated and maintained 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" +) + +// SiteDomainDao is the data access object for table cms_site_domain. +type SiteDomainDao 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 SiteDomainColumns // columns contains all the column names of Table for convenient usage. +} + +// SiteDomainColumns defines and stores column names for table cms_site_domain. +type SiteDomainColumns struct { + Id string // 主键 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 + Sort string // 排序 + Name string // 网站名称 + Domain string // 域名 + Extend string // 扩展属性 + GroupId string // 分组id + Remark string // 备注 + Status string // 启用状态 +} + +// siteDomainColumns holds the columns for table cms_site_domain. +var siteDomainColumns = SiteDomainColumns{ + Id: "id", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + Sort: "sort", + Name: "name", + Domain: "domain", + Extend: "extend", + GroupId: "group_id", + Remark: "remark", + Status: "status", +} + +// NewSiteDomainDao creates and returns a new DAO object for table data access. +func NewSiteDomainDao() *SiteDomainDao { + return &SiteDomainDao{ + group: "cms", + table: "cms_site_domain", + columns: siteDomainColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *SiteDomainDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *SiteDomainDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *SiteDomainDao) Columns() SiteDomainColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *SiteDomainDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *SiteDomainDao) 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 *SiteDomainDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/app/dao/internal/site_group.go b/app/dao/internal/site_group.go new file mode 100644 index 0000000..1e60d16 --- /dev/null +++ b/app/dao/internal/site_group.go @@ -0,0 +1,83 @@ +// ========================================================================== +// Code generated and maintained 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" +) + +// SiteGroupDao is the data access object for table cms_site_group. +type SiteGroupDao 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 SiteGroupColumns // columns contains all the column names of Table for convenient usage. +} + +// SiteGroupColumns defines and stores column names for table cms_site_group. +type SiteGroupColumns struct { + Id string // 主键 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 + Name string // 分类名称 + Remark string // 备注 + Sort string // 排序 +} + +// siteGroupColumns holds the columns for table cms_site_group. +var siteGroupColumns = SiteGroupColumns{ + Id: "id", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + Name: "name", + Remark: "remark", + Sort: "sort", +} + +// NewSiteGroupDao creates and returns a new DAO object for table data access. +func NewSiteGroupDao() *SiteGroupDao { + return &SiteGroupDao{ + group: "cms", + table: "cms_site_group", + columns: siteGroupColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *SiteGroupDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *SiteGroupDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *SiteGroupDao) Columns() SiteGroupColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *SiteGroupDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *SiteGroupDao) 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 *SiteGroupDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/app/dao/internal/site_link.go b/app/dao/internal/site_link.go new file mode 100644 index 0000000..669465d --- /dev/null +++ b/app/dao/internal/site_link.go @@ -0,0 +1,89 @@ +// ========================================================================== +// Code generated and maintained 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" +) + +// SiteLinkDao is the data access object for table cms_site_link. +type SiteLinkDao 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 SiteLinkColumns // columns contains all the column names of Table for convenient usage. +} + +// SiteLinkColumns defines and stores column names for table cms_site_link. +type SiteLinkColumns struct { + Id string // 主键 + CreatedAt string // 创建时间 + UpdatedAt string // 更新时间 + Name string // 友链名称 + Link string // 链接 + SiteId string // 站点id + Status string // 启用状态 + Sort string // 排序 + Target string // 打开方式 +} + +// siteLinkColumns holds the columns for table cms_site_link. +var siteLinkColumns = SiteLinkColumns{ + Id: "id", + CreatedAt: "created_at", + UpdatedAt: "updated_at", + Name: "name", + Link: "link", + SiteId: "site_id", + Status: "status", + Sort: "sort", + Target: "target", +} + +// NewSiteLinkDao creates and returns a new DAO object for table data access. +func NewSiteLinkDao() *SiteLinkDao { + return &SiteLinkDao{ + group: "cms", + table: "cms_site_link", + columns: siteLinkColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *SiteLinkDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *SiteLinkDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *SiteLinkDao) Columns() SiteLinkColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *SiteLinkDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *SiteLinkDao) 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 *SiteLinkDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/app/dao/internal/video.go b/app/dao/internal/video.go new file mode 100644 index 0000000..9e63414 --- /dev/null +++ b/app/dao/internal/video.go @@ -0,0 +1,165 @@ +// ========================================================================== +// Code generated and maintained 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" +) + +// VideoDao is the data access object for table cms_video. +type VideoDao 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 VideoColumns // columns contains all the column names of Table for convenient usage. +} + +// VideoColumns defines and stores column names for table cms_video. +type VideoColumns struct { + Id string // + Title string // 标题 + TitleSub string // 副标 + Letter string // 首字母 + Tag string // TAG + Color string // 颜色 + Lock string // 锁定 + Copyright string // 版权 + IsEnd string // 完结 + Status string // 状态 + Class string // 扩展分类 + CategoryId string // 分类 + Pic string // 图片 + PicId string // 图片编号 + PicLocal string // + PicThumb string // 缩略图 + PicSlide string // 轮播 + PicScreenshot string // 截图 + PicStatus string // 图片状态 + Actor string // 演员 + Director string // 导演 + Writer string // 编剧 + Remarks string // 备注 + Pubdate string // 发布时间 + Total string // 总集数 + Serial string // 连载数 + Duration string // 视频时长 + Tv string // 电视频道 + Weekday string // 节目周期 + Area string // 地区 + Lang string // 语言 + Jumpurl string // 跳转URL + Version string // 资源版本 + Year string // 年份 + State string // 资源类别 + DoubanScore string // 豆瓣评分 + DoubanId string // 豆瓣ID + Up string // 顶 + Down string // 踩 + Hits string // 人气 + HitsMonth string // 月人气 + HitsWeek string // 周人气 + HitsDay string // 天人气 + Content string // 内容 + CreatedAt string // + Blurb string // 简要介绍 + UpdatedAt string // +} + +// videoColumns holds the columns for table cms_video. +var videoColumns = VideoColumns{ + Id: "id", + Title: "title", + TitleSub: "title_sub", + Letter: "letter", + Tag: "tag", + Color: "color", + Lock: "lock", + Copyright: "copyright", + IsEnd: "is_end", + Status: "status", + Class: "class", + CategoryId: "category_id", + Pic: "pic", + PicId: "pic_id", + PicLocal: "pic_local", + PicThumb: "pic_thumb", + PicSlide: "pic_slide", + PicScreenshot: "pic_screenshot", + PicStatus: "pic_status", + Actor: "actor", + Director: "director", + Writer: "writer", + Remarks: "remarks", + Pubdate: "pubdate", + Total: "total", + Serial: "serial", + Duration: "duration", + Tv: "tv", + Weekday: "weekday", + Area: "area", + Lang: "lang", + Jumpurl: "jumpurl", + Version: "version", + Year: "year", + State: "state", + DoubanScore: "douban_score", + DoubanId: "douban_id", + Up: "up", + Down: "down", + Hits: "hits", + HitsMonth: "hits_month", + HitsWeek: "hits_week", + HitsDay: "hits_day", + Content: "content", + CreatedAt: "created_at", + Blurb: "blurb", + UpdatedAt: "updated_at", +} + +// NewVideoDao creates and returns a new DAO object for table data access. +func NewVideoDao() *VideoDao { + return &VideoDao{ + group: "cms", + table: "cms_video", + columns: videoColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *VideoDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *VideoDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *VideoDao) Columns() VideoColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *VideoDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *VideoDao) 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 *VideoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/app/dao/internal/video_bind.go b/app/dao/internal/video_bind.go new file mode 100644 index 0000000..58ced52 --- /dev/null +++ b/app/dao/internal/video_bind.go @@ -0,0 +1,83 @@ +// ========================================================================== +// Code generated and maintained 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" +) + +// VideoBindDao is the data access object for table cms_video_bind. +type VideoBindDao 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 VideoBindColumns // columns contains all the column names of Table for convenient usage. +} + +// VideoBindColumns defines and stores column names for table cms_video_bind. +type VideoBindColumns struct { + Id string // + VideoId string // 视频编号 + CollectId string // 资源站编号 + SourceId string // 原始编号 + CreatedAt string // + UpdatedAt string // +} + +// videoBindColumns holds the columns for table cms_video_bind. +var videoBindColumns = VideoBindColumns{ + Id: "id", + VideoId: "video_id", + CollectId: "collect_id", + SourceId: "source_id", + CreatedAt: "created_at", + UpdatedAt: "updated_at", +} + +// NewVideoBindDao creates and returns a new DAO object for table data access. +func NewVideoBindDao() *VideoBindDao { + return &VideoBindDao{ + group: "cms", + table: "cms_video_bind", + columns: videoBindColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *VideoBindDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *VideoBindDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *VideoBindDao) Columns() VideoBindColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *VideoBindDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *VideoBindDao) 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 *VideoBindDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/app/dao/internal/video_url.go b/app/dao/internal/video_url.go new file mode 100644 index 0000000..a43a2b6 --- /dev/null +++ b/app/dao/internal/video_url.go @@ -0,0 +1,77 @@ +// ========================================================================== +// Code generated and maintained 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" +) + +// VideoUrlDao is the data access object for table cms_video_url. +type VideoUrlDao 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 VideoUrlColumns // columns contains all the column names of Table for convenient usage. +} + +// VideoUrlColumns defines and stores column names for table cms_video_url. +type VideoUrlColumns struct { + Id string // + VideoId string // + Info string // +} + +// videoUrlColumns holds the columns for table cms_video_url. +var videoUrlColumns = VideoUrlColumns{ + Id: "id", + VideoId: "video_id", + Info: "info", +} + +// NewVideoUrlDao creates and returns a new DAO object for table data access. +func NewVideoUrlDao() *VideoUrlDao { + return &VideoUrlDao{ + group: "cms", + table: "cms_video_url", + columns: videoUrlColumns, + } +} + +// DB retrieves and returns the underlying raw database management object of current DAO. +func (dao *VideoUrlDao) DB() gdb.DB { + return g.DB(dao.group) +} + +// Table returns the table name of current dao. +func (dao *VideoUrlDao) Table() string { + return dao.table +} + +// Columns returns all column names of current dao. +func (dao *VideoUrlDao) Columns() VideoUrlColumns { + return dao.columns +} + +// Group returns the configuration group name of database of current dao. +func (dao *VideoUrlDao) Group() string { + return dao.group +} + +// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. +func (dao *VideoUrlDao) 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 *VideoUrlDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { + return dao.Ctx(ctx).Transaction(ctx, f) +} diff --git a/app/dao/log.go b/app/dao/log.go new file mode 100644 index 0000000..baead30 --- /dev/null +++ b/app/dao/log.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package dao + +import ( + "xgit.pub/module/cms/app/dao/internal" +) + +// internalLogDao is internal type for wrapping internal DAO implements. +type internalLogDao = *internal.LogDao + +// logDao is the data access object for table cms_log. +// You can define custom methods on it to extend its functionality as you wish. +type logDao struct { + internalLogDao +} + +var ( + // Log is globally public accessible object for table cms_log operations. + Log = logDao{ + internal.NewLogDao(), + } +) + +// Fill with you ideas below. diff --git a/app/dao/player.go b/app/dao/player.go new file mode 100644 index 0000000..63ce372 --- /dev/null +++ b/app/dao/player.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package dao + +import ( + "xgit.pub/module/cms/app/dao/internal" +) + +// internalPlayerDao is internal type for wrapping internal DAO implements. +type internalPlayerDao = *internal.PlayerDao + +// playerDao is the data access object for table cms_player. +// You can define custom methods on it to extend its functionality as you wish. +type playerDao struct { + internalPlayerDao +} + +var ( + // Player is globally public accessible object for table cms_player operations. + Player = playerDao{ + internal.NewPlayerDao(), + } +) + +// Fill with you ideas below. diff --git a/app/dao/player_record.go b/app/dao/player_record.go new file mode 100644 index 0000000..76fedad --- /dev/null +++ b/app/dao/player_record.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package dao + +import ( + "xgit.pub/module/cms/app/dao/internal" +) + +// internalPlayerRecordDao is internal type for wrapping internal DAO implements. +type internalPlayerRecordDao = *internal.PlayerRecordDao + +// playerRecordDao is the data access object for table cms_player_record. +// You can define custom methods on it to extend its functionality as you wish. +type playerRecordDao struct { + internalPlayerRecordDao +} + +var ( + // PlayerRecord is globally public accessible object for table cms_player_record operations. + PlayerRecord = playerRecordDao{ + internal.NewPlayerRecordDao(), + } +) + +// Fill with you ideas below. diff --git a/app/dao/search_keyword.go b/app/dao/search_keyword.go new file mode 100644 index 0000000..8ad6fea --- /dev/null +++ b/app/dao/search_keyword.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package dao + +import ( + "xgit.pub/module/cms/app/dao/internal" +) + +// internalSearchKeywordDao is internal type for wrapping internal DAO implements. +type internalSearchKeywordDao = *internal.SearchKeywordDao + +// searchKeywordDao is the data access object for table cms_search_keyword. +// You can define custom methods on it to extend its functionality as you wish. +type searchKeywordDao struct { + internalSearchKeywordDao +} + +var ( + // SearchKeyword is globally public accessible object for table cms_search_keyword operations. + SearchKeyword = searchKeywordDao{ + internal.NewSearchKeywordDao(), + } +) + +// Fill with you ideas below. diff --git a/app/dao/short_chapter.go b/app/dao/short_chapter.go new file mode 100644 index 0000000..ced3581 --- /dev/null +++ b/app/dao/short_chapter.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package dao + +import ( + "xgit.pub/module/cms/app/dao/internal" +) + +// internalShortChapterDao is internal type for wrapping internal DAO implements. +type internalShortChapterDao = *internal.ShortChapterDao + +// shortChapterDao is the data access object for table cms_short_chapter. +// You can define custom methods on it to extend its functionality as you wish. +type shortChapterDao struct { + internalShortChapterDao +} + +var ( + // ShortChapter is globally public accessible object for table cms_short_chapter operations. + ShortChapter = shortChapterDao{ + internal.NewShortChapterDao(), + } +) + +// Fill with you ideas below. diff --git a/app/dao/short_play_urls.go b/app/dao/short_play_urls.go new file mode 100644 index 0000000..d27d952 --- /dev/null +++ b/app/dao/short_play_urls.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package dao + +import ( + "xgit.pub/module/cms/app/dao/internal" +) + +// internalShortPlayUrlsDao is internal type for wrapping internal DAO implements. +type internalShortPlayUrlsDao = *internal.ShortPlayUrlsDao + +// shortPlayUrlsDao is the data access object for table cms_short_play_urls. +// You can define custom methods on it to extend its functionality as you wish. +type shortPlayUrlsDao struct { + internalShortPlayUrlsDao +} + +var ( + // ShortPlayUrls is globally public accessible object for table cms_short_play_urls operations. + ShortPlayUrls = shortPlayUrlsDao{ + internal.NewShortPlayUrlsDao(), + } +) + +// Fill with you ideas below. diff --git a/app/dao/short_player.go b/app/dao/short_player.go new file mode 100644 index 0000000..fad8156 --- /dev/null +++ b/app/dao/short_player.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package dao + +import ( + "xgit.pub/module/cms/app/dao/internal" +) + +// internalShortPlayerDao is internal type for wrapping internal DAO implements. +type internalShortPlayerDao = *internal.ShortPlayerDao + +// shortPlayerDao is the data access object for table cms_short_player. +// You can define custom methods on it to extend its functionality as you wish. +type shortPlayerDao struct { + internalShortPlayerDao +} + +var ( + // ShortPlayer is globally public accessible object for table cms_short_player operations. + ShortPlayer = shortPlayerDao{ + internal.NewShortPlayerDao(), + } +) + +// Fill with you ideas below. diff --git a/app/dao/short_tags.go b/app/dao/short_tags.go new file mode 100644 index 0000000..5100a3e --- /dev/null +++ b/app/dao/short_tags.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package dao + +import ( + "xgit.pub/module/cms/app/dao/internal" +) + +// internalShortTagsDao is internal type for wrapping internal DAO implements. +type internalShortTagsDao = *internal.ShortTagsDao + +// shortTagsDao is the data access object for table cms_short_tags. +// You can define custom methods on it to extend its functionality as you wish. +type shortTagsDao struct { + internalShortTagsDao +} + +var ( + // ShortTags is globally public accessible object for table cms_short_tags operations. + ShortTags = shortTagsDao{ + internal.NewShortTagsDao(), + } +) + +// Fill with you ideas below. diff --git a/app/dao/short_video.go b/app/dao/short_video.go new file mode 100644 index 0000000..a12ea12 --- /dev/null +++ b/app/dao/short_video.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package dao + +import ( + "xgit.pub/module/cms/app/dao/internal" +) + +// internalShortVideoDao is internal type for wrapping internal DAO implements. +type internalShortVideoDao = *internal.ShortVideoDao + +// shortVideoDao is the data access object for table cms_short_video. +// You can define custom methods on it to extend its functionality as you wish. +type shortVideoDao struct { + internalShortVideoDao +} + +var ( + // ShortVideo is globally public accessible object for table cms_short_video operations. + ShortVideo = shortVideoDao{ + internal.NewShortVideoDao(), + } +) + +// Fill with you ideas below. diff --git a/app/dao/site_domain.go b/app/dao/site_domain.go new file mode 100644 index 0000000..09ff0f6 --- /dev/null +++ b/app/dao/site_domain.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package dao + +import ( + "xgit.pub/module/cms/app/dao/internal" +) + +// internalSiteDomainDao is internal type for wrapping internal DAO implements. +type internalSiteDomainDao = *internal.SiteDomainDao + +// siteDomainDao is the data access object for table cms_site_domain. +// You can define custom methods on it to extend its functionality as you wish. +type siteDomainDao struct { + internalSiteDomainDao +} + +var ( + // SiteDomain is globally public accessible object for table cms_site_domain operations. + SiteDomain = siteDomainDao{ + internal.NewSiteDomainDao(), + } +) + +// Fill with you ideas below. diff --git a/app/dao/site_group.go b/app/dao/site_group.go new file mode 100644 index 0000000..e9263b3 --- /dev/null +++ b/app/dao/site_group.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package dao + +import ( + "xgit.pub/module/cms/app/dao/internal" +) + +// internalSiteGroupDao is internal type for wrapping internal DAO implements. +type internalSiteGroupDao = *internal.SiteGroupDao + +// siteGroupDao is the data access object for table cms_site_group. +// You can define custom methods on it to extend its functionality as you wish. +type siteGroupDao struct { + internalSiteGroupDao +} + +var ( + // SiteGroup is globally public accessible object for table cms_site_group operations. + SiteGroup = siteGroupDao{ + internal.NewSiteGroupDao(), + } +) + +// Fill with you ideas below. diff --git a/app/dao/site_link.go b/app/dao/site_link.go new file mode 100644 index 0000000..3c5f471 --- /dev/null +++ b/app/dao/site_link.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package dao + +import ( + "xgit.pub/module/cms/app/dao/internal" +) + +// internalSiteLinkDao is internal type for wrapping internal DAO implements. +type internalSiteLinkDao = *internal.SiteLinkDao + +// siteLinkDao is the data access object for table cms_site_link. +// You can define custom methods on it to extend its functionality as you wish. +type siteLinkDao struct { + internalSiteLinkDao +} + +var ( + // SiteLink is globally public accessible object for table cms_site_link operations. + SiteLink = siteLinkDao{ + internal.NewSiteLinkDao(), + } +) + +// Fill with you ideas below. diff --git a/app/dao/video.go b/app/dao/video.go new file mode 100644 index 0000000..7b8e026 --- /dev/null +++ b/app/dao/video.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package dao + +import ( + "xgit.pub/module/cms/app/dao/internal" +) + +// internalVideoDao is internal type for wrapping internal DAO implements. +type internalVideoDao = *internal.VideoDao + +// videoDao is the data access object for table cms_video. +// You can define custom methods on it to extend its functionality as you wish. +type videoDao struct { + internalVideoDao +} + +var ( + // Video is globally public accessible object for table cms_video operations. + Video = videoDao{ + internal.NewVideoDao(), + } +) + +// Fill with you ideas below. diff --git a/app/dao/video_bind.go b/app/dao/video_bind.go new file mode 100644 index 0000000..e6651f3 --- /dev/null +++ b/app/dao/video_bind.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package dao + +import ( + "xgit.pub/module/cms/app/dao/internal" +) + +// internalVideoBindDao is internal type for wrapping internal DAO implements. +type internalVideoBindDao = *internal.VideoBindDao + +// videoBindDao is the data access object for table cms_video_bind. +// You can define custom methods on it to extend its functionality as you wish. +type videoBindDao struct { + internalVideoBindDao +} + +var ( + // VideoBind is globally public accessible object for table cms_video_bind operations. + VideoBind = videoBindDao{ + internal.NewVideoBindDao(), + } +) + +// Fill with you ideas below. diff --git a/app/dao/video_url.go b/app/dao/video_url.go new file mode 100644 index 0000000..335c1aa --- /dev/null +++ b/app/dao/video_url.go @@ -0,0 +1,27 @@ +// ================================================================================= +// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. +// ================================================================================= + +package dao + +import ( + "xgit.pub/module/cms/app/dao/internal" +) + +// internalVideoUrlDao is internal type for wrapping internal DAO implements. +type internalVideoUrlDao = *internal.VideoUrlDao + +// videoUrlDao is the data access object for table cms_video_url. +// You can define custom methods on it to extend its functionality as you wish. +type videoUrlDao struct { + internalVideoUrlDao +} + +var ( + // VideoUrl is globally public accessible object for table cms_video_url operations. + VideoUrl = videoUrlDao{ + internal.NewVideoUrlDao(), + } +) + +// Fill with you ideas below. diff --git a/app/logic/collect/collect.go b/app/logic/collect/collect.go new file mode 100644 index 0000000..7f0840c --- /dev/null +++ b/app/logic/collect/collect.go @@ -0,0 +1,49 @@ +package collect + +import ( + "context" + v1 "xgit.pub/module/cms/app/api/collect/v1" + "xgit.pub/module/cms/app/service" +) + +type sCollect struct { +} + +func init() { + Collect := New() + service.RegisterCollect(Collect) +} + +func New() *sCollect { + return &sCollect{} +} + +// GetList 获取列表 +func (s *sCollect) GetList(ctx context.Context, req *v1.GetListReq) (res *v1.GetListRes, err error) { + return +} + +// Get 获取详情 +func (s *sCollect) Get(ctx context.Context, req *v1.GetReq) (res *v1.GetRes, err error) { + return +} + +// Create 创建 +func (s *sCollect) Create(ctx context.Context, req *v1.CreateReq) (res *v1.CreateRes, err error) { + return +} + +// Update 更新 +func (s *sCollect) Update(ctx context.Context, req *v1.UpdateReq) (res *v1.UpdateRes, err error) { + return +} + +// Delete 删除 +func (s *sCollect) Delete(ctx context.Context, req *v1.DeleteReq) (res *v1.DeleteRes, err error) { + return +} + +// BatchDelete 批量删除 +func (s *sCollect) BatchDelete(ctx context.Context, req *v1.BatchDeleteReq) (res *v1.BatchDeleteRes, err error) { + return +} diff --git a/app/logic/logic.go b/app/logic/logic.go new file mode 100644 index 0000000..4c79103 --- /dev/null +++ b/app/logic/logic.go @@ -0,0 +1 @@ +package logic diff --git a/app/model/do/category.go b/app/model/do/category.go new file mode 100644 index 0000000..70fed6a --- /dev/null +++ b/app/model/do/category.go @@ -0,0 +1,29 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" +) + +// Category is the golang structure of table cms_category for DAO operations like Where/Data. +type Category struct { + g.Meta `orm:"table:cms_category, do:true"` + Id interface{} // + ParentId interface{} // 父节点 + Name interface{} // 分类名字 + Union interface{} // 关联 + Sort interface{} // 排序 + Status interface{} // 状态 + SeoTitle interface{} // + SeoKey interface{} // + SeoDes interface{} // + TplIndex interface{} // Index + TplList interface{} // List + TplDetail interface{} // Detail + TplDown interface{} // Down + TplPlay interface{} // player + Extend interface{} // 扩展属性 集合 +} diff --git a/app/model/do/collect.go b/app/model/do/collect.go new file mode 100644 index 0000000..dc39a05 --- /dev/null +++ b/app/model/do/collect.go @@ -0,0 +1,24 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" +) + +// Collect is the golang structure of table cms_collect for DAO operations like Where/Data. +type Collect struct { + g.Meta `orm:"table:cms_collect, do:true"` + Id interface{} // + Name interface{} // 资源名 + Url interface{} // + Param interface{} // 参数 + Model interface{} // 类型 + Opt interface{} // 操作方式 + Filter interface{} // 过滤模式 + FilterForm interface{} // + SyncPic interface{} // 同步图片 全局 2 开启 1 关闭0 + Class interface{} // 扩展分类 逗号,分隔 +} diff --git a/app/model/do/collect_bind.go b/app/model/do/collect_bind.go new file mode 100644 index 0000000..fb13714 --- /dev/null +++ b/app/model/do/collect_bind.go @@ -0,0 +1,18 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" +) + +// CollectBind is the golang structure of table cms_collect_bind for DAO operations like Where/Data. +type CollectBind struct { + g.Meta `orm:"table:cms_collect_bind, do:true"` + Id interface{} // + CollectId interface{} // + CategoryId interface{} // + SourceId interface{} // +} diff --git a/app/model/do/collect_task.go b/app/model/do/collect_task.go new file mode 100644 index 0000000..84bb111 --- /dev/null +++ b/app/model/do/collect_task.go @@ -0,0 +1,28 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" +) + +// CollectTask is the golang structure of table cms_collect_task for DAO operations like Where/Data. +type CollectTask struct { + g.Meta `orm:"table:cms_collect_task, do:true"` + Id interface{} // + CollectId interface{} // 采集 + Running interface{} // 是否运行中 + Progress interface{} // 进度 + Status interface{} // 状态 + Current interface{} // 当前 + Total interface{} // 总记录 + PageCount interface{} // 总页数 + CurrentPage interface{} // 当前页 + StartTime *gtime.Time // 开始时间 + LastTime *gtime.Time // 最后提交时间 + EndTime *gtime.Time // 结束时间 + UpdateTime interface{} // 采集多少时间内 +} diff --git a/app/model/do/config.go b/app/model/do/config.go new file mode 100644 index 0000000..16032b5 --- /dev/null +++ b/app/model/do/config.go @@ -0,0 +1,20 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" +) + +// Config is the golang structure of table cms_config for DAO operations like Where/Data. +type Config struct { + g.Meta `orm:"table:cms_config, do:true"` + Id interface{} // + Name interface{} // + Value interface{} // + CreatedAt *gtime.Time // 创建时间 + UpdatedAt *gtime.Time // 更新时间 +} diff --git a/app/model/do/favorite.go b/app/model/do/favorite.go new file mode 100644 index 0000000..cb45eba --- /dev/null +++ b/app/model/do/favorite.go @@ -0,0 +1,23 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" +) + +// Favorite is the golang structure of table cms_favorite for DAO operations like Where/Data. +type Favorite struct { + g.Meta `orm:"table:cms_favorite, do:true"` + Id interface{} // + VideoId interface{} // + VideoTitle interface{} // + VideoPic interface{} // + UserId interface{} // + RecordId interface{} // + CreatedAt *gtime.Time // + UpdatedAt *gtime.Time // +} diff --git a/app/model/do/hot_class.go b/app/model/do/hot_class.go new file mode 100644 index 0000000..dfe0354 --- /dev/null +++ b/app/model/do/hot_class.go @@ -0,0 +1,20 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" +) + +// HotClass is the golang structure of table cms_hot_class for DAO operations like Where/Data. +type HotClass struct { + g.Meta `orm:"table:cms_hot_class, do:true"` + Id interface{} // + TypeName interface{} // 名字 + Code interface{} // 代码 + Url interface{} // 地址 + Param interface{} // 参数 + Status interface{} // 状态 +} diff --git a/app/model/do/hot_video.go b/app/model/do/hot_video.go new file mode 100644 index 0000000..41f1d7f --- /dev/null +++ b/app/model/do/hot_video.go @@ -0,0 +1,24 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" +) + +// HotVideo is the golang structure of table cms_hot_video for DAO operations like Where/Data. +type HotVideo struct { + g.Meta `orm:"table:cms_hot_video, do:true"` + Id interface{} // + ClassId interface{} // + VodName interface{} // + VodPic interface{} // + VodTime *gtime.Time // + Score interface{} // + CreatedAt *gtime.Time // + UpdatedAt *gtime.Time // + DeletedAt *gtime.Time // +} diff --git a/app/model/do/hotkey.go b/app/model/do/hotkey.go new file mode 100644 index 0000000..33c3b40 --- /dev/null +++ b/app/model/do/hotkey.go @@ -0,0 +1,17 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" +) + +// Hotkey is the golang structure of table cms_hotkey for DAO operations like Where/Data. +type Hotkey struct { + g.Meta `orm:"table:cms_hotkey, do:true"` + Id interface{} // + Keyword interface{} // + Sort interface{} // +} diff --git a/app/model/do/log.go b/app/model/do/log.go new file mode 100644 index 0000000..18b0096 --- /dev/null +++ b/app/model/do/log.go @@ -0,0 +1,25 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" +) + +// Log is the golang structure of table cms_log for DAO operations like Where/Data. +type Log struct { + g.Meta `orm:"table:cms_log, do:true"` + Id interface{} // + CreatedAt *gtime.Time // 创建时间 + UpdatedAt *gtime.Time // 更新时间 + Type interface{} // 日志类别 + Title interface{} // 日志说明 + Error interface{} // 错误信息 + SendStatus interface{} // 发送状态 | 处理状态 + IsView interface{} // 已读 + ViewAt *gtime.Time // 访问时间 + UserId interface{} // 操作员ID +} diff --git a/app/model/do/player.go b/app/model/do/player.go new file mode 100644 index 0000000..58313e9 --- /dev/null +++ b/app/model/do/player.go @@ -0,0 +1,26 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" +) + +// Player is the golang structure of table cms_player for DAO operations like Where/Data. +type Player struct { + g.Meta `orm:"table:cms_player, do:true"` + Id interface{} // + Status interface{} // 状态 + From interface{} // 编码格式 + Name interface{} // 名称 + Target interface{} // 目标窗口 + Parse interface{} // 解析状态 + ParseApi interface{} // 解析地址 + Sort interface{} // 排序 + Tip interface{} // 提示 + Filename interface{} // 文件名称 + Code interface{} // 编码 + Remark interface{} // 备注 +} diff --git a/app/model/do/player_record.go b/app/model/do/player_record.go new file mode 100644 index 0000000..b1b0496 --- /dev/null +++ b/app/model/do/player_record.go @@ -0,0 +1,25 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" +) + +// PlayerRecord is the golang structure of table cms_player_record for DAO operations like Where/Data. +type PlayerRecord struct { + g.Meta `orm:"table:cms_player_record, do:true"` + Id interface{} // + VideoId interface{} // 视频编号 + VideoTitle interface{} // + VideoPic interface{} // + UserId interface{} // 用户编号 + LineId interface{} // 线路编号 + PlayId interface{} // 播放编号 + PlayTime interface{} // 播放时间节点 + CreatedAt *gtime.Time // + UpdatedAt *gtime.Time // +} diff --git a/app/model/do/search_keyword.go b/app/model/do/search_keyword.go new file mode 100644 index 0000000..450b458 --- /dev/null +++ b/app/model/do/search_keyword.go @@ -0,0 +1,20 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" +) + +// SearchKeyword is the golang structure of table cms_search_keyword for DAO operations like Where/Data. +type SearchKeyword struct { + g.Meta `orm:"table:cms_search_keyword, do:true"` + Id interface{} // 主键 + CreatedAt *gtime.Time // 创建时间 + UpdatedAt *gtime.Time // 更新时间 + Keyword interface{} // 搜索关键字 + Total interface{} // 搜索次数 +} diff --git a/app/model/do/short_chapter.go b/app/model/do/short_chapter.go new file mode 100644 index 0000000..e46e3ff --- /dev/null +++ b/app/model/do/short_chapter.go @@ -0,0 +1,25 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" +) + +// ShortChapter is the golang structure of table cms_short_chapter for DAO operations like Where/Data. +type ShortChapter struct { + g.Meta `orm:"table:cms_short_chapter, do:true"` + Id interface{} // + ShortVideoId interface{} // 短剧编号 + ChapterNum interface{} // 短剧序号 + Title interface{} // 章节标题 + Subtitles interface{} // 为后期识别字幕做准备 + SourceUrl interface{} // 源地址 + CdnUrl interface{} // CDN 地址 + Chapter interface{} // 章节介绍 + CreatedAt *gtime.Time // + UpdatedAt *gtime.Time // +} diff --git a/app/model/do/short_play_urls.go b/app/model/do/short_play_urls.go new file mode 100644 index 0000000..c627bf1 --- /dev/null +++ b/app/model/do/short_play_urls.go @@ -0,0 +1,17 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" +) + +// ShortPlayUrls is the golang structure of table cms_short_play_urls for DAO operations like Where/Data. +type ShortPlayUrls struct { + g.Meta `orm:"table:cms_short_play_urls, do:true"` + Id interface{} // + ShortVideoId interface{} // + Res interface{} // +} diff --git a/app/model/do/short_player.go b/app/model/do/short_player.go new file mode 100644 index 0000000..e36183c --- /dev/null +++ b/app/model/do/short_player.go @@ -0,0 +1,18 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" +) + +// ShortPlayer is the golang structure of table cms_short_player for DAO operations like Where/Data. +type ShortPlayer struct { + g.Meta `orm:"table:cms_short_player, do:true"` + Id interface{} // + Name interface{} // + Sort interface{} // + Status interface{} // +} diff --git a/app/model/do/short_tags.go b/app/model/do/short_tags.go new file mode 100644 index 0000000..6bc0c7a --- /dev/null +++ b/app/model/do/short_tags.go @@ -0,0 +1,18 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" +) + +// ShortTags is the golang structure of table cms_short_tags for DAO operations like Where/Data. +type ShortTags struct { + g.Meta `orm:"table:cms_short_tags, do:true"` + Id interface{} // + Tag interface{} // + Count interface{} // + Sort interface{} // +} diff --git a/app/model/do/short_video.go b/app/model/do/short_video.go new file mode 100644 index 0000000..4c807cf --- /dev/null +++ b/app/model/do/short_video.go @@ -0,0 +1,34 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" +) + +// ShortVideo is the golang structure of table cms_short_video for DAO operations like Where/Data. +type ShortVideo struct { + g.Meta `orm:"table:cms_short_video, do:true"` + Id interface{} // + Title interface{} // 标题 + Introduction interface{} // + Tag interface{} // 标签 + Author interface{} // 作者 + Actor interface{} // 演员 + Protagonist interface{} // 主角 + Cover interface{} // 封面 + CoverUrl interface{} // 封面 + ChapterUrls interface{} // 资源地址 + ChapterCount interface{} // 当前章节 + ChapterMax interface{} // 共人章节 + Status interface{} // 状态 0未审核 1更新中 2完结 + Views interface{} // 观看次数 + Stars interface{} // 标星 + CreatedAt *gtime.Time // + UpdatedAt *gtime.Time // + FinishStatus interface{} // + Online interface{} // +} diff --git a/app/model/do/site_domain.go b/app/model/do/site_domain.go new file mode 100644 index 0000000..0f0e65a --- /dev/null +++ b/app/model/do/site_domain.go @@ -0,0 +1,25 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" +) + +// SiteDomain is the golang structure of table cms_site_domain for DAO operations like Where/Data. +type SiteDomain struct { + g.Meta `orm:"table:cms_site_domain, do:true"` + Id interface{} // 主键 + CreatedAt *gtime.Time // 创建时间 + UpdatedAt *gtime.Time // 更新时间 + Sort interface{} // 排序 + Name interface{} // 网站名称 + Domain interface{} // 域名 + Extend interface{} // 扩展属性 + GroupId interface{} // 分组id + Remark interface{} // 备注 + Status interface{} // 启用状态 +} diff --git a/app/model/do/site_group.go b/app/model/do/site_group.go new file mode 100644 index 0000000..8da0cd7 --- /dev/null +++ b/app/model/do/site_group.go @@ -0,0 +1,21 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" +) + +// SiteGroup is the golang structure of table cms_site_group for DAO operations like Where/Data. +type SiteGroup struct { + g.Meta `orm:"table:cms_site_group, do:true"` + Id interface{} // 主键 + CreatedAt *gtime.Time // 创建时间 + UpdatedAt *gtime.Time // 更新时间 + Name interface{} // 分类名称 + Remark interface{} // 备注 + Sort interface{} // 排序 +} diff --git a/app/model/do/site_link.go b/app/model/do/site_link.go new file mode 100644 index 0000000..05699ee --- /dev/null +++ b/app/model/do/site_link.go @@ -0,0 +1,24 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" +) + +// SiteLink is the golang structure of table cms_site_link for DAO operations like Where/Data. +type SiteLink struct { + g.Meta `orm:"table:cms_site_link, do:true"` + Id interface{} // 主键 + CreatedAt *gtime.Time // 创建时间 + UpdatedAt *gtime.Time // 更新时间 + Name interface{} // 友链名称 + Link interface{} // 链接 + SiteId interface{} // 站点id + Status interface{} // 启用状态 + Sort interface{} // 排序 + Target interface{} // 打开方式 +} diff --git a/app/model/do/video.go b/app/model/do/video.go new file mode 100644 index 0000000..3427e3e --- /dev/null +++ b/app/model/do/video.go @@ -0,0 +1,62 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" +) + +// Video is the golang structure of table cms_video for DAO operations like Where/Data. +type Video struct { + g.Meta `orm:"table:cms_video, do:true"` + Id interface{} // + Title interface{} // 标题 + TitleSub interface{} // 副标 + Letter interface{} // 首字母 + Tag interface{} // TAG + Color interface{} // 颜色 + Lock interface{} // 锁定 + Copyright interface{} // 版权 + IsEnd interface{} // 完结 + Status interface{} // 状态 + Class interface{} // 扩展分类 + CategoryId interface{} // 分类 + Pic interface{} // 图片 + PicId interface{} // 图片编号 + PicLocal interface{} // + PicThumb interface{} // 缩略图 + PicSlide interface{} // 轮播 + PicScreenshot interface{} // 截图 + PicStatus interface{} // 图片状态 + Actor interface{} // 演员 + Director interface{} // 导演 + Writer interface{} // 编剧 + Remarks interface{} // 备注 + Pubdate interface{} // 发布时间 + Total interface{} // 总集数 + Serial interface{} // 连载数 + Duration interface{} // 视频时长 + Tv interface{} // 电视频道 + Weekday interface{} // 节目周期 + Area interface{} // 地区 + Lang interface{} // 语言 + Jumpurl interface{} // 跳转URL + Version interface{} // 资源版本 + Year interface{} // 年份 + State interface{} // 资源类别 + DoubanScore interface{} // 豆瓣评分 + DoubanId interface{} // 豆瓣ID + Up interface{} // 顶 + Down interface{} // 踩 + Hits interface{} // 人气 + HitsMonth interface{} // 月人气 + HitsWeek interface{} // 周人气 + HitsDay interface{} // 天人气 + Content interface{} // 内容 + CreatedAt *gtime.Time // + Blurb interface{} // 简要介绍 + UpdatedAt *gtime.Time // +} diff --git a/app/model/do/video_bind.go b/app/model/do/video_bind.go new file mode 100644 index 0000000..ef27c92 --- /dev/null +++ b/app/model/do/video_bind.go @@ -0,0 +1,21 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" +) + +// VideoBind is the golang structure of table cms_video_bind for DAO operations like Where/Data. +type VideoBind struct { + g.Meta `orm:"table:cms_video_bind, do:true"` + Id interface{} // + VideoId interface{} // 视频编号 + CollectId interface{} // 资源站编号 + SourceId interface{} // 原始编号 + CreatedAt *gtime.Time // + UpdatedAt *gtime.Time // +} diff --git a/app/model/do/video_url.go b/app/model/do/video_url.go new file mode 100644 index 0000000..f31db70 --- /dev/null +++ b/app/model/do/video_url.go @@ -0,0 +1,17 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package do + +import ( + "github.com/gogf/gf/v2/frame/g" +) + +// VideoUrl is the golang structure of table cms_video_url for DAO operations like Where/Data. +type VideoUrl struct { + g.Meta `orm:"table:cms_video_url, do:true"` + Id interface{} // + VideoId interface{} // + Info interface{} // +} diff --git a/app/model/entity/category.go b/app/model/entity/category.go new file mode 100644 index 0000000..5d205f0 --- /dev/null +++ b/app/model/entity/category.go @@ -0,0 +1,24 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +// Category is the golang structure for table category. +type Category struct { + Id int `json:"id" ` // + ParentId int `json:"parent_id" ` // 父节点 + Name string `json:"name" ` // 分类名字 + Union string `json:"union" ` // 关联 + Sort int `json:"sort" ` // 排序 + Status int `json:"status" ` // 状态 + SeoTitle string `json:"seo_title" ` // + SeoKey string `json:"seo_key" ` // + SeoDes string `json:"seo_des" ` // + TplIndex string `json:"tpl_index" ` // Index + TplList string `json:"tpl_list" ` // List + TplDetail string `json:"tpl_detail" ` // Detail + TplDown string `json:"tpl_down" ` // Down + TplPlay string `json:"tpl_play" ` // player + Extend string `json:"extend" ` // 扩展属性 集合 +} diff --git a/app/model/entity/collect.go b/app/model/entity/collect.go new file mode 100644 index 0000000..ce0e905 --- /dev/null +++ b/app/model/entity/collect.go @@ -0,0 +1,19 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +// Collect is the golang structure for table collect. +type Collect struct { + Id uint `json:"id" ` // + Name string `json:"name" ` // 资源名 + Url string `json:"url" ` // + Param string `json:"param" ` // 参数 + Model uint `json:"model" ` // 类型 + Opt uint `json:"opt" ` // 操作方式 + Filter int `json:"filter" ` // 过滤模式 + FilterForm string `json:"filter_form" ` // + SyncPic uint `json:"sync_pic" ` // 同步图片 全局 2 开启 1 关闭0 + Class string `json:"class" ` // 扩展分类 逗号,分隔 +} diff --git a/app/model/entity/collect_bind.go b/app/model/entity/collect_bind.go new file mode 100644 index 0000000..a4f672a --- /dev/null +++ b/app/model/entity/collect_bind.go @@ -0,0 +1,13 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +// CollectBind is the golang structure for table collect_bind. +type CollectBind struct { + Id uint `json:"id" ` // + CollectId int `json:"collect_id" ` // + CategoryId uint `json:"category_id" ` // + SourceId uint `json:"source_id" ` // +} diff --git a/app/model/entity/collect_task.go b/app/model/entity/collect_task.go new file mode 100644 index 0000000..ebb2baf --- /dev/null +++ b/app/model/entity/collect_task.go @@ -0,0 +1,26 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" +) + +// CollectTask is the golang structure for table collect_task. +type CollectTask struct { + Id uint `json:"id" ` // + CollectId uint `json:"collect_id" ` // 采集 + Running int `json:"running" ` // 是否运行中 + Progress float64 `json:"progress" ` // 进度 + Status int `json:"status" ` // 状态 + Current int `json:"current" ` // 当前 + Total uint `json:"total" ` // 总记录 + PageCount uint `json:"page_count" ` // 总页数 + CurrentPage int `json:"current_page" ` // 当前页 + StartTime *gtime.Time `json:"start_time" ` // 开始时间 + LastTime *gtime.Time `json:"last_time" ` // 最后提交时间 + EndTime *gtime.Time `json:"end_time" ` // 结束时间 + UpdateTime int `json:"update_time" ` // 采集多少时间内 +} diff --git a/app/model/entity/config.go b/app/model/entity/config.go new file mode 100644 index 0000000..aba04b6 --- /dev/null +++ b/app/model/entity/config.go @@ -0,0 +1,18 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" +) + +// Config is the golang structure for table config. +type Config struct { + Id uint `json:"id" ` // + Name string `json:"name" ` // + Value string `json:"value" ` // + CreatedAt *gtime.Time `json:"created_at" ` // 创建时间 + UpdatedAt *gtime.Time `json:"updated_at" ` // 更新时间 +} diff --git a/app/model/entity/favorite.go b/app/model/entity/favorite.go new file mode 100644 index 0000000..d05426b --- /dev/null +++ b/app/model/entity/favorite.go @@ -0,0 +1,21 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" +) + +// Favorite is the golang structure for table favorite. +type Favorite struct { + Id uint `json:"id" ` // + VideoId uint64 `json:"video_id" ` // + VideoTitle string `json:"video_title" ` // + VideoPic string `json:"video_pic" ` // + UserId uint64 `json:"user_id" ` // + RecordId uint64 `json:"record_id" ` // + CreatedAt *gtime.Time `json:"created_at" ` // + UpdatedAt *gtime.Time `json:"updated_at" ` // +} diff --git a/app/model/entity/hot_class.go b/app/model/entity/hot_class.go new file mode 100644 index 0000000..babf0b4 --- /dev/null +++ b/app/model/entity/hot_class.go @@ -0,0 +1,15 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +// HotClass is the golang structure for table hot_class. +type HotClass struct { + Id int `json:"id" ` // + TypeName string `json:"type_name" ` // 名字 + Code string `json:"code" ` // 代码 + Url string `json:"url" ` // 地址 + Param string `json:"param" ` // 参数 + Status int `json:"status" ` // 状态 +} diff --git a/app/model/entity/hot_video.go b/app/model/entity/hot_video.go new file mode 100644 index 0000000..422adaf --- /dev/null +++ b/app/model/entity/hot_video.go @@ -0,0 +1,22 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" +) + +// HotVideo is the golang structure for table hot_video. +type HotVideo struct { + Id int `json:"id" ` // + ClassId int `json:"class_id" ` // + VodName string `json:"vod_name" ` // + VodPic string `json:"vod_pic" ` // + VodTime *gtime.Time `json:"vod_time" ` // + Score int64 `json:"score" ` // + CreatedAt *gtime.Time `json:"created_at" ` // + UpdatedAt *gtime.Time `json:"updated_at" ` // + DeletedAt *gtime.Time `json:"deleted_at" ` // +} diff --git a/app/model/entity/hotkey.go b/app/model/entity/hotkey.go new file mode 100644 index 0000000..9a1b2e3 --- /dev/null +++ b/app/model/entity/hotkey.go @@ -0,0 +1,12 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +// Hotkey is the golang structure for table hotkey. +type Hotkey struct { + Id int `json:"id" ` // + Keyword string `json:"keyword" ` // + Sort int `json:"sort" ` // +} diff --git a/app/model/entity/log.go b/app/model/entity/log.go new file mode 100644 index 0000000..2583880 --- /dev/null +++ b/app/model/entity/log.go @@ -0,0 +1,23 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" +) + +// Log is the golang structure for table log. +type Log struct { + Id uint `json:"id" ` // + CreatedAt *gtime.Time `json:"created_at" ` // 创建时间 + UpdatedAt *gtime.Time `json:"updated_at" ` // 更新时间 + Type string `json:"type" ` // 日志类别 + Title string `json:"title" ` // 日志说明 + Error string `json:"error" ` // 错误信息 + SendStatus uint `json:"send_status" ` // 发送状态 | 处理状态 + IsView uint `json:"is_view" ` // 已读 + ViewAt *gtime.Time `json:"view_at" ` // 访问时间 + UserId uint `json:"user_id" ` // 操作员ID +} diff --git a/app/model/entity/player.go b/app/model/entity/player.go new file mode 100644 index 0000000..de09927 --- /dev/null +++ b/app/model/entity/player.go @@ -0,0 +1,21 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +// Player is the golang structure for table player. +type Player struct { + Id uint `json:"id" ` // + Status uint `json:"status" ` // 状态 + From string `json:"from" ` // 编码格式 + Name string `json:"name" ` // 名称 + Target string `json:"target" ` // 目标窗口 + Parse uint `json:"parse" ` // 解析状态 + ParseApi string `json:"parse_api" ` // 解析地址 + Sort uint `json:"sort" ` // 排序 + Tip string `json:"tip" ` // 提示 + Filename string `json:"filename" ` // 文件名称 + Code string `json:"code" ` // 编码 + Remark string `json:"remark" ` // 备注 +} diff --git a/app/model/entity/player_record.go b/app/model/entity/player_record.go new file mode 100644 index 0000000..e2f26f2 --- /dev/null +++ b/app/model/entity/player_record.go @@ -0,0 +1,23 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" +) + +// PlayerRecord is the golang structure for table player_record. +type PlayerRecord struct { + Id uint `json:"id" ` // + VideoId uint64 `json:"video_id" ` // 视频编号 + VideoTitle string `json:"video_title" ` // + VideoPic string `json:"video_pic" ` // + UserId uint64 `json:"user_id" ` // 用户编号 + LineId uint `json:"line_id" ` // 线路编号 + PlayId uint `json:"play_id" ` // 播放编号 + PlayTime float64 `json:"play_time" ` // 播放时间节点 + CreatedAt *gtime.Time `json:"created_at" ` // + UpdatedAt *gtime.Time `json:"updated_at" ` // +} diff --git a/app/model/entity/search_keyword.go b/app/model/entity/search_keyword.go new file mode 100644 index 0000000..f96f15a --- /dev/null +++ b/app/model/entity/search_keyword.go @@ -0,0 +1,18 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" +) + +// SearchKeyword is the golang structure for table search_keyword. +type SearchKeyword struct { + Id uint64 `json:"id" ` // 主键 + CreatedAt *gtime.Time `json:"created_at" ` // 创建时间 + UpdatedAt *gtime.Time `json:"updated_at" ` // 更新时间 + Keyword string `json:"keyword" ` // 搜索关键字 + Total uint64 `json:"total" ` // 搜索次数 +} diff --git a/app/model/entity/short_chapter.go b/app/model/entity/short_chapter.go new file mode 100644 index 0000000..f5699ad --- /dev/null +++ b/app/model/entity/short_chapter.go @@ -0,0 +1,23 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" +) + +// ShortChapter is the golang structure for table short_chapter. +type ShortChapter struct { + Id uint `json:"id" ` // + ShortVideoId uint `json:"short_video_id" ` // 短剧编号 + ChapterNum int `json:"chapter_num" ` // 短剧序号 + Title string `json:"title" ` // 章节标题 + Subtitles string `json:"subtitles" ` // 为后期识别字幕做准备 + SourceUrl string `json:"source_url" ` // 源地址 + CdnUrl string `json:"cdn_url" ` // CDN 地址 + Chapter string `json:"chapter" ` // 章节介绍 + CreatedAt *gtime.Time `json:"created_at" ` // + UpdatedAt *gtime.Time `json:"updated_at" ` // +} diff --git a/app/model/entity/short_play_urls.go b/app/model/entity/short_play_urls.go new file mode 100644 index 0000000..1a9882e --- /dev/null +++ b/app/model/entity/short_play_urls.go @@ -0,0 +1,12 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +// ShortPlayUrls is the golang structure for table short_play_urls. +type ShortPlayUrls struct { + Id int64 `json:"id" ` // + ShortVideoId int64 `json:"short_video_id" ` // + Res string `json:"res" ` // +} diff --git a/app/model/entity/short_player.go b/app/model/entity/short_player.go new file mode 100644 index 0000000..3eae0f8 --- /dev/null +++ b/app/model/entity/short_player.go @@ -0,0 +1,13 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +// ShortPlayer is the golang structure for table short_player. +type ShortPlayer struct { + Id uint `json:"id" ` // + Name string `json:"name" ` // + Sort int `json:"sort" ` // + Status int `json:"status" ` // +} diff --git a/app/model/entity/short_tags.go b/app/model/entity/short_tags.go new file mode 100644 index 0000000..7cb405f --- /dev/null +++ b/app/model/entity/short_tags.go @@ -0,0 +1,13 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +// ShortTags is the golang structure for table short_tags. +type ShortTags struct { + Id uint `json:"id" ` // + Tag string `json:"tag" ` // + Count int `json:"count" ` // + Sort int `json:"sort" ` // +} diff --git a/app/model/entity/short_video.go b/app/model/entity/short_video.go new file mode 100644 index 0000000..32f0e7b --- /dev/null +++ b/app/model/entity/short_video.go @@ -0,0 +1,32 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" +) + +// ShortVideo is the golang structure for table short_video. +type ShortVideo struct { + Id int64 `json:"id" ` // + Title string `json:"title" ` // 标题 + Introduction string `json:"introduction" ` // + Tag string `json:"tag" ` // 标签 + Author string `json:"author" ` // 作者 + Actor string `json:"actor" ` // 演员 + Protagonist string `json:"protagonist" ` // 主角 + Cover string `json:"cover" ` // 封面 + CoverUrl string `json:"cover_url" ` // 封面 + ChapterUrls string `json:"chapter_urls" ` // 资源地址 + ChapterCount int `json:"chapter_count" ` // 当前章节 + ChapterMax int `json:"chapter_max" ` // 共人章节 + Status uint `json:"status" ` // 状态 0未审核 1更新中 2完结 + Views int `json:"views" ` // 观看次数 + Stars int `json:"stars" ` // 标星 + CreatedAt *gtime.Time `json:"created_at" ` // + UpdatedAt *gtime.Time `json:"updated_at" ` // + FinishStatus int `json:"finish_status" ` // + Online int `json:"online" ` // +} diff --git a/app/model/entity/site_domain.go b/app/model/entity/site_domain.go new file mode 100644 index 0000000..0f745d7 --- /dev/null +++ b/app/model/entity/site_domain.go @@ -0,0 +1,23 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" +) + +// SiteDomain is the golang structure for table site_domain. +type SiteDomain struct { + Id uint64 `json:"id" ` // 主键 + CreatedAt *gtime.Time `json:"created_at" ` // 创建时间 + UpdatedAt *gtime.Time `json:"updated_at" ` // 更新时间 + Sort int `json:"sort" ` // 排序 + Name string `json:"name" ` // 网站名称 + Domain string `json:"domain" ` // 域名 + Extend string `json:"extend" ` // 扩展属性 + GroupId uint64 `json:"group_id" ` // 分组id + Remark string `json:"remark" ` // 备注 + Status uint `json:"status" ` // 启用状态 +} diff --git a/app/model/entity/site_group.go b/app/model/entity/site_group.go new file mode 100644 index 0000000..8c01997 --- /dev/null +++ b/app/model/entity/site_group.go @@ -0,0 +1,19 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" +) + +// SiteGroup is the golang structure for table site_group. +type SiteGroup struct { + Id uint64 `json:"id" ` // 主键 + CreatedAt *gtime.Time `json:"created_at" ` // 创建时间 + UpdatedAt *gtime.Time `json:"updated_at" ` // 更新时间 + Name string `json:"name" ` // 分类名称 + Remark string `json:"remark" ` // 备注 + Sort int `json:"sort" ` // 排序 +} diff --git a/app/model/entity/site_link.go b/app/model/entity/site_link.go new file mode 100644 index 0000000..00d3e16 --- /dev/null +++ b/app/model/entity/site_link.go @@ -0,0 +1,22 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" +) + +// SiteLink is the golang structure for table site_link. +type SiteLink struct { + Id uint64 `json:"id" ` // 主键 + CreatedAt *gtime.Time `json:"created_at" ` // 创建时间 + UpdatedAt *gtime.Time `json:"updated_at" ` // 更新时间 + Name string `json:"name" ` // 友链名称 + Link string `json:"link" ` // 链接 + SiteId uint64 `json:"site_id" ` // 站点id + Status uint `json:"status" ` // 启用状态 + Sort int `json:"sort" ` // 排序 + Target string `json:"target" ` // 打开方式 +} diff --git a/app/model/entity/video.go b/app/model/entity/video.go new file mode 100644 index 0000000..0df3e66 --- /dev/null +++ b/app/model/entity/video.go @@ -0,0 +1,60 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" +) + +// Video is the golang structure for table video. +type Video struct { + Id uint `json:"id" ` // + Title string `json:"title" ` // 标题 + TitleSub string `json:"title_sub" ` // 副标 + Letter string `json:"letter" ` // 首字母 + Tag string `json:"tag" ` // TAG + Color string `json:"color" ` // 颜色 + Lock uint `json:"lock" ` // 锁定 + Copyright uint `json:"copyright" ` // 版权 + IsEnd uint `json:"is_end" ` // 完结 + Status uint `json:"status" ` // 状态 + Class string `json:"class" ` // 扩展分类 + CategoryId uint `json:"category_id" ` // 分类 + Pic string `json:"pic" ` // 图片 + PicId string `json:"pic_id" ` // 图片编号 + PicLocal string `json:"pic_local" ` // + PicThumb string `json:"pic_thumb" ` // 缩略图 + PicSlide string `json:"pic_slide" ` // 轮播 + PicScreenshot string `json:"pic_screenshot" ` // 截图 + PicStatus uint `json:"pic_status" ` // 图片状态 + Actor string `json:"actor" ` // 演员 + Director string `json:"director" ` // 导演 + Writer string `json:"writer" ` // 编剧 + Remarks string `json:"remarks" ` // 备注 + Pubdate string `json:"pubdate" ` // 发布时间 + Total int `json:"total" ` // 总集数 + Serial string `json:"serial" ` // 连载数 + Duration string `json:"duration" ` // 视频时长 + Tv string `json:"tv" ` // 电视频道 + Weekday string `json:"weekday" ` // 节目周期 + Area string `json:"area" ` // 地区 + Lang string `json:"lang" ` // 语言 + Jumpurl string `json:"jumpurl" ` // 跳转URL + Version string `json:"version" ` // 资源版本 + Year int `json:"year" ` // 年份 + State string `json:"state" ` // 资源类别 + DoubanScore float64 `json:"douban_score" ` // 豆瓣评分 + DoubanId int `json:"douban_id" ` // 豆瓣ID + Up int `json:"up" ` // 顶 + Down int `json:"down" ` // 踩 + Hits int `json:"hits" ` // 人气 + HitsMonth int `json:"hits_month" ` // 月人气 + HitsWeek int `json:"hits_week" ` // 周人气 + HitsDay int `json:"hits_day" ` // 天人气 + Content string `json:"content" ` // 内容 + CreatedAt *gtime.Time `json:"created_at" ` // + Blurb string `json:"blurb" ` // 简要介绍 + UpdatedAt *gtime.Time `json:"updated_at" ` // +} diff --git a/app/model/entity/video_bind.go b/app/model/entity/video_bind.go new file mode 100644 index 0000000..6d8f1cc --- /dev/null +++ b/app/model/entity/video_bind.go @@ -0,0 +1,19 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +import ( + "github.com/gogf/gf/v2/os/gtime" +) + +// VideoBind is the golang structure for table video_bind. +type VideoBind struct { + Id uint `json:"id" ` // + VideoId uint `json:"video_id" ` // 视频编号 + CollectId uint `json:"collect_id" ` // 资源站编号 + SourceId uint `json:"source_id" ` // 原始编号 + CreatedAt *gtime.Time `json:"created_at" ` // + UpdatedAt *gtime.Time `json:"updated_at" ` // +} diff --git a/app/model/entity/video_url.go b/app/model/entity/video_url.go new file mode 100644 index 0000000..de437cb --- /dev/null +++ b/app/model/entity/video_url.go @@ -0,0 +1,12 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package entity + +// VideoUrl is the golang structure for table video_url. +type VideoUrl struct { + Id uint `json:"id" ` // + VideoId uint `json:"video_id" ` // + Info string `json:"info" ` // +} diff --git a/app/plugin.go b/app/plugin.go new file mode 100644 index 0000000..6dbca29 --- /dev/null +++ b/app/plugin.go @@ -0,0 +1,12 @@ +package app + +import "github.com/gogf/gf/v2/net/ghttp" + +var ( + Version = "0.0.1" + Module = "CMS" +) + +func RegeditPlugin(g *ghttp.RouterGroup) (err error) { + return +} diff --git a/app/service/collect.go b/app/service/collect.go new file mode 100644 index 0000000..484d079 --- /dev/null +++ b/app/service/collect.go @@ -0,0 +1,44 @@ +// ================================================================================ +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// You can delete these comments if you wish manually maintain this interface file. +// ================================================================================ + +package service + +import ( + "context" + + v1 "xgit.pub/module/cms/app/api/collect/v1" +) + +type ( + ICollect interface { + // GetList 获取列表 + GetList(ctx context.Context, req *v1.GetListReq) (res *v1.GetListRes, err error) + // Get 获取详情 + Get(ctx context.Context, req *v1.GetReq) (res *v1.GetRes, err error) + // Create 创建 + Create(ctx context.Context, req *v1.CreateReq) (res *v1.CreateRes, err error) + // Update 更新 + Update(ctx context.Context, req *v1.UpdateReq) (res *v1.UpdateRes, err error) + // Delete 删除 + Delete(ctx context.Context, req *v1.DeleteReq) (res *v1.DeleteRes, err error) + // BatchDelete 批量删除 + BatchDelete(ctx context.Context, req *v1.BatchDeleteReq) (res *v1.BatchDeleteRes, err error) + } +) + +var ( + localCollect ICollect +) + +func Collect() ICollect { + if localCollect == nil { + panic("implement not found for interface ICollect, forgot register?") + } + return localCollect +} + +func RegisterCollect(i ICollect) { + localCollect = i +} diff --git a/app/version.go b/app/version.go deleted file mode 100644 index eedc42f..0000000 --- a/app/version.go +++ /dev/null @@ -1,6 +0,0 @@ -package app - -var ( - Version = "0.0.1" - Module = "CMS" -) diff --git a/go.mod b/go.mod index 66f9100..553d52a 100644 --- a/go.mod +++ b/go.mod @@ -1,29 +1,35 @@ module xgit.pub/module/cms -go 1.18 +go 1.21 -require github.com/gogf/gf/v2 v2.5.2 +toolchain go1.21.5 + +require github.com/gogf/gf/v2 v2.6.0 + +require xgit.pub/st52/xcore v0.0.0 + +replace xgit.pub/st52/xcore => ../../xcore require ( github.com/BurntSushi/toml v1.2.0 // indirect github.com/clbanning/mxj/v2 v2.7.0 // indirect github.com/fatih/color v1.15.0 // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.2.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grokify/html-strip-tags-go v0.0.1 // indirect github.com/magiconair/properties v1.8.6 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/rivo/uniseg v0.4.4 // indirect go.opentelemetry.io/otel v1.14.0 // indirect go.opentelemetry.io/otel/sdk v1.14.0 // indirect go.opentelemetry.io/otel/trace v1.14.0 // indirect - golang.org/x/net v0.12.0 // indirect - golang.org/x/sys v0.10.0 // indirect - golang.org/x/text v0.11.0 // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/sys v0.15.0 // indirect + golang.org/x/text v0.13.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 2003de5..ad9bc7f 100644 --- a/go.sum +++ b/go.sum @@ -7,6 +7,7 @@ github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -14,6 +15,7 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/gogf/gf/v2 v2.5.2 h1:fACJE7DJH6iTGHGhgiNY1uuZIZtr2IqQkJ52E+wBnt8= github.com/gogf/gf/v2 v2.5.2/go.mod h1:7yf5qp0BznfsYx7Sw49m3mQvBsHpwAjJk3Q9ZnKoUEc= +github.com/gogf/gf/v2 v2.6.0/go.mod h1:x2XONYcI4hRQ/4gMNbWHmZrNzSEIg20s2NULbzom5k0= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -26,6 +28,7 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovk github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= @@ -44,13 +47,16 @@ go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyK go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/hack/config.yaml b/hack/config.yaml index 71bbeba..3defe7d 100644 --- a/hack/config.yaml +++ b/hack/config.yaml @@ -5,4 +5,11 @@ gfcli: docker: build: "-a amd64 -s linux -p temp -ew" tagPrefixes: - - my.image.pub/my-app \ No newline at end of file + - my.image.pub/my-app + gen: + dao: + - link: "mysql:cms_cms:steven@tcp(127.0.0.1:3306)/cms_cms" + path: "./app" + group: "cms" + removePrefix: "cms_" + jsonCase: "Snake" diff --git a/hack/hack.mk b/hack/hack.mk index 1a42d77..bc182ec 100644 --- a/hack/hack.mk +++ b/hack/hack.mk @@ -13,7 +13,7 @@ build: cli.install # Parse api and generate controller/sdk. .PHONY: ctrl ctrl: cli.install - @gf gen ctrl + @gf gen ctrl --srcFolder './app/api' --dstFolder './app/controller' # Generate Go files for DAO/DO/Entity. .PHONY: dao @@ -28,7 +28,7 @@ enums: cli.install # Generate Go files for Service. .PHONY: service service: cli.install - @gf gen service + @gf gen service --srcFolder './app/logic' --dstFolder './app/service' # Build docker image. diff --git a/internal/cmd/cmd.go b/internal/cmd/cmd.go index 4f39fc5..0b055d3 100644 --- a/internal/cmd/cmd.go +++ b/internal/cmd/cmd.go @@ -2,6 +2,7 @@ package cmd import ( "context" + "xgit.pub/module/cms/app" "github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/net/ghttp" @@ -17,9 +18,7 @@ var ( s := g.Server() s.Group("/", func(group *ghttp.RouterGroup) { group.Middleware(ghttp.MiddlewareHandlerResponse) - group.Bind( - //hello.NewV1(), - ) + _ = app.RegeditPlugin(group) }) s.Run() return nil diff --git a/main.go b/main.go index 95f3568..ae59a16 100644 --- a/main.go +++ b/main.go @@ -3,6 +3,8 @@ package main import ( _ "xgit.pub/module/cms/internal/packed" + _ "xgit.pub/module/cms/app/logic" + "github.com/gogf/gf/v2/os/gctx" "xgit.pub/module/cms/internal/cmd"