38 changed files with 648 additions and 72 deletions
-
15api/hello/hello.go
-
12api/hello/v1/hello.go
-
8api/v1/ebooks/ebooks.go
-
10api/v1/live_streams/live_streams.go
-
12api/v1/shows/shows.go
-
4go.mod
-
56go.sum
-
4hack/config.yaml
-
10internal/cmd/cmd.go
-
23internal/controller/ebooks/ebooks.go
-
5internal/controller/hello/hello.go
-
15internal/controller/hello/hello_new.go
-
13internal/controller/hello/hello_v1_hello.go
-
1internal/controller/live_streams/live_streams.go
-
1internal/controller/shows/shows.go
-
27internal/dao/ebooks.go
-
81internal/dao/internal/ebooks.go
-
85internal/dao/internal/live_streams.go
-
95internal/dao/internal/shows.go
-
27internal/dao/live_streams.go
-
27internal/dao/shows.go
-
25internal/logic/ebooks/ebooks.go
-
1internal/logic/live_streams/live_streams.go
-
1internal/logic/shows/shows.go
-
19internal/model/do/ebooks.go
-
22internal/model/do/live_streams.go
-
27internal/model/do/shows.go
-
14internal/model/entity/ebooks.go
-
20internal/model/entity/live_streams.go
-
25internal/model/entity/shows.go
-
27internal/service/ebooks/ebooks.go
-
1internal/service/live_streams/live_streams.go
-
1internal/service/shows/shows.go
-
6main.go
-
BINresource/public/resource/image/ebook1.png
-
BINresource/public/resource/image/ebook2.png
-
BINresource/public/resource/image/ebook3.png
-
BINresource/public/resource/image/ebook4.png
@ -1,15 +0,0 @@ |
|||
// =================================================================================
|
|||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
|||
// =================================================================================
|
|||
|
|||
package hello |
|||
|
|||
import ( |
|||
"context" |
|||
|
|||
"practice_Go/api/hello/v1" |
|||
) |
|||
|
|||
type IHelloV1 interface { |
|||
Hello(ctx context.Context, req *v1.HelloReq) (res *v1.HelloRes, err error) |
|||
} |
@ -1,12 +0,0 @@ |
|||
package v1 |
|||
|
|||
import ( |
|||
"github.com/gogf/gf/v2/frame/g" |
|||
) |
|||
|
|||
type HelloReq struct { |
|||
g.Meta `path:"/hello" tags:"Hello" method:"get" summary:"You first hello api"` |
|||
} |
|||
type HelloRes struct { |
|||
g.Meta `mime:"text/html" example:"string"` |
|||
} |
@ -0,0 +1,8 @@ |
|||
package ebooks |
|||
|
|||
import "practice_Go/internal/model/entity" |
|||
|
|||
type GetEbooksListReq struct{} |
|||
type GetEbooksListRes struct { |
|||
List []*entity.Ebooks `json:"list" dc:"ebooks list"` |
|||
} |
@ -0,0 +1,10 @@ |
|||
package live_streams |
|||
|
|||
import "practice_Go/internal/model/entity" |
|||
|
|||
type GetListReq struct { |
|||
Status *int `v:"in:0,1" dc:"开播状态(0=未开播,1=直播中)"` |
|||
} |
|||
type GetListRes struct { |
|||
List []*entity.LiveStreams `json:"list" dc:"LiveStreams list"` |
|||
} |
@ -0,0 +1,12 @@ |
|||
package shows |
|||
|
|||
import ( |
|||
"practice_Go/internal/model/entity" |
|||
) |
|||
|
|||
type GetListReq struct { |
|||
Type *int `v:"in:1,2" dc:"类型(1=文章,2=视频)"` |
|||
} |
|||
type GetListRes struct { |
|||
List []*entity.Shows `json:"list" dc:"shows list"` |
|||
} |
@ -0,0 +1,23 @@ |
|||
package controller |
|||
|
|||
import ( |
|||
"github.com/gogf/gf/v2/net/ghttp" |
|||
"practice_Go/api/v1/ebooks" |
|||
"practice_Go/internal/service/ebooks" |
|||
) |
|||
|
|||
type cEbooks struct{} |
|||
|
|||
var Ebooks = cEbooks{} |
|||
|
|||
func (c *cEbooks) GetEbooksList(r *ghttp.Request) { |
|||
var req *ebooks.GetEbooksListReq |
|||
if err := r.Parse(&req); err != nil { |
|||
r.Response.WriteJsonExit(err.Error()) |
|||
} |
|||
res, err := service.Ebooks().GetEbooksList(r.Context(), req) |
|||
if err != nil { |
|||
r.Response.WriteJsonExit(err.Error()) |
|||
} |
|||
r.Response.WriteJsonExit(res) |
|||
} |
@ -1,5 +0,0 @@ |
|||
// =================================================================================
|
|||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
|||
// =================================================================================
|
|||
|
|||
package hello |
@ -1,15 +0,0 @@ |
|||
// =================================================================================
|
|||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
|||
// =================================================================================
|
|||
|
|||
package hello |
|||
|
|||
import ( |
|||
"practice_Go/api/hello" |
|||
) |
|||
|
|||
type ControllerV1 struct{} |
|||
|
|||
func NewV1() hello.IHelloV1 { |
|||
return &ControllerV1{} |
|||
} |
@ -1,13 +0,0 @@ |
|||
package hello |
|||
|
|||
import ( |
|||
"context" |
|||
"github.com/gogf/gf/v2/frame/g" |
|||
|
|||
"practice_Go/api/hello/v1" |
|||
) |
|||
|
|||
func (c *ControllerV1) Hello(ctx context.Context, req *v1.HelloReq) (res *v1.HelloRes, err error) { |
|||
g.RequestFromCtx(ctx).Response.Writeln("Hello World!") |
|||
return |
|||
} |
@ -0,0 +1 @@ |
|||
package live_streams |
@ -0,0 +1 @@ |
|||
package shows |
@ -0,0 +1,27 @@ |
|||
// =================================================================================
|
|||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
|||
// =================================================================================
|
|||
|
|||
package dao |
|||
|
|||
import ( |
|||
"practice_Go/internal/dao/internal" |
|||
) |
|||
|
|||
// internalEbooksDao is internal type for wrapping internal DAO implements.
|
|||
type internalEbooksDao = *internal.EbooksDao |
|||
|
|||
// ebooksDao is the data access object for table ebooks.
|
|||
// You can define custom methods on it to extend its functionality as you wish.
|
|||
type ebooksDao struct { |
|||
internalEbooksDao |
|||
} |
|||
|
|||
var ( |
|||
// Ebooks is globally public accessible object for table ebooks operations.
|
|||
Ebooks = ebooksDao{ |
|||
internal.NewEbooksDao(), |
|||
} |
|||
) |
|||
|
|||
// Fill with you ideas below.
|
@ -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" |
|||
) |
|||
|
|||
// EbooksDao is the data access object for table ebooks.
|
|||
type EbooksDao 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 EbooksColumns // columns contains all the column names of Table for convenient usage.
|
|||
} |
|||
|
|||
// EbooksColumns defines and stores column names for table ebooks.
|
|||
type EbooksColumns struct { |
|||
Id string // 主键
|
|||
Cover string // 封面图URL
|
|||
Title string // 书名(唯一约束)
|
|||
Description string // 简介
|
|||
ViewCount string // 观看人数
|
|||
} |
|||
|
|||
// ebooksColumns holds the columns for table ebooks.
|
|||
var ebooksColumns = EbooksColumns{ |
|||
Id: "id", |
|||
Cover: "cover", |
|||
Title: "title", |
|||
Description: "description", |
|||
ViewCount: "view_count", |
|||
} |
|||
|
|||
// NewEbooksDao creates and returns a new DAO object for table data access.
|
|||
func NewEbooksDao() *EbooksDao { |
|||
return &EbooksDao{ |
|||
group: "default", |
|||
table: "ebooks", |
|||
columns: ebooksColumns, |
|||
} |
|||
} |
|||
|
|||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
|||
func (dao *EbooksDao) DB() gdb.DB { |
|||
return g.DB(dao.group) |
|||
} |
|||
|
|||
// Table returns the table name of current dao.
|
|||
func (dao *EbooksDao) Table() string { |
|||
return dao.table |
|||
} |
|||
|
|||
// Columns returns all column names of current dao.
|
|||
func (dao *EbooksDao) Columns() EbooksColumns { |
|||
return dao.columns |
|||
} |
|||
|
|||
// Group returns the configuration group name of database of current dao.
|
|||
func (dao *EbooksDao) Group() string { |
|||
return dao.group |
|||
} |
|||
|
|||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
|||
func (dao *EbooksDao) 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 *EbooksDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { |
|||
return dao.Ctx(ctx).Transaction(ctx, f) |
|||
} |
@ -0,0 +1,85 @@ |
|||
// ==========================================================================
|
|||
// 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" |
|||
) |
|||
|
|||
// LiveStreamsDao is the data access object for table live_streams.
|
|||
type LiveStreamsDao 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 LiveStreamsColumns // columns contains all the column names of Table for convenient usage.
|
|||
} |
|||
|
|||
// LiveStreamsColumns defines and stores column names for table live_streams.
|
|||
type LiveStreamsColumns struct { |
|||
Id string // 主键
|
|||
Cover string // 直播封面URL
|
|||
Title string // 直播标题
|
|||
Avatar string // 主播头像URL
|
|||
PublisherId string // 主播ID
|
|||
StartTime string // 计划开播时间
|
|||
Status string // 开播状态(0=未开播,1=直播中)
|
|||
} |
|||
|
|||
// liveStreamsColumns holds the columns for table live_streams.
|
|||
var liveStreamsColumns = LiveStreamsColumns{ |
|||
Id: "id", |
|||
Cover: "cover", |
|||
Title: "title", |
|||
Avatar: "avatar", |
|||
PublisherId: "publisher_id", |
|||
StartTime: "start_time", |
|||
Status: "status", |
|||
} |
|||
|
|||
// NewLiveStreamsDao creates and returns a new DAO object for table data access.
|
|||
func NewLiveStreamsDao() *LiveStreamsDao { |
|||
return &LiveStreamsDao{ |
|||
group: "default", |
|||
table: "live_streams", |
|||
columns: liveStreamsColumns, |
|||
} |
|||
} |
|||
|
|||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
|||
func (dao *LiveStreamsDao) DB() gdb.DB { |
|||
return g.DB(dao.group) |
|||
} |
|||
|
|||
// Table returns the table name of current dao.
|
|||
func (dao *LiveStreamsDao) Table() string { |
|||
return dao.table |
|||
} |
|||
|
|||
// Columns returns all column names of current dao.
|
|||
func (dao *LiveStreamsDao) Columns() LiveStreamsColumns { |
|||
return dao.columns |
|||
} |
|||
|
|||
// Group returns the configuration group name of database of current dao.
|
|||
func (dao *LiveStreamsDao) Group() string { |
|||
return dao.group |
|||
} |
|||
|
|||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
|||
func (dao *LiveStreamsDao) 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 *LiveStreamsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { |
|||
return dao.Ctx(ctx).Transaction(ctx, f) |
|||
} |
@ -0,0 +1,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" |
|||
) |
|||
|
|||
// ShowsDao is the data access object for table shows.
|
|||
type ShowsDao 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 ShowsColumns // columns contains all the column names of Table for convenient usage.
|
|||
} |
|||
|
|||
// ShowsColumns defines and stores column names for table shows.
|
|||
type ShowsColumns struct { |
|||
Id string // 主键
|
|||
Cover string // 封面图URL
|
|||
Title string // 标题
|
|||
PublisherId string // 发布人ID
|
|||
PublisherAvatar string // 发布人头像URL
|
|||
PublishTime string // 发布时间
|
|||
ViewCount string // 观看人数
|
|||
CommentCount string // 评论数
|
|||
LikeCount string // 点赞数
|
|||
Type string // 类型(1=文章,2=视频)
|
|||
ClubId string // 所属俱乐部(0=无,1=博古)
|
|||
VideoDuration string // 视频时长(秒)
|
|||
} |
|||
|
|||
// showsColumns holds the columns for table shows.
|
|||
var showsColumns = ShowsColumns{ |
|||
Id: "id", |
|||
Cover: "cover", |
|||
Title: "title", |
|||
PublisherId: "publisher_id", |
|||
PublisherAvatar: "publisher_avatar", |
|||
PublishTime: "publish_time", |
|||
ViewCount: "view_count", |
|||
CommentCount: "comment_count", |
|||
LikeCount: "like_count", |
|||
Type: "type", |
|||
ClubId: "club_id", |
|||
VideoDuration: "video_duration", |
|||
} |
|||
|
|||
// NewShowsDao creates and returns a new DAO object for table data access.
|
|||
func NewShowsDao() *ShowsDao { |
|||
return &ShowsDao{ |
|||
group: "default", |
|||
table: "shows", |
|||
columns: showsColumns, |
|||
} |
|||
} |
|||
|
|||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
|||
func (dao *ShowsDao) DB() gdb.DB { |
|||
return g.DB(dao.group) |
|||
} |
|||
|
|||
// Table returns the table name of current dao.
|
|||
func (dao *ShowsDao) Table() string { |
|||
return dao.table |
|||
} |
|||
|
|||
// Columns returns all column names of current dao.
|
|||
func (dao *ShowsDao) Columns() ShowsColumns { |
|||
return dao.columns |
|||
} |
|||
|
|||
// Group returns the configuration group name of database of current dao.
|
|||
func (dao *ShowsDao) Group() string { |
|||
return dao.group |
|||
} |
|||
|
|||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
|||
func (dao *ShowsDao) 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 *ShowsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { |
|||
return dao.Ctx(ctx).Transaction(ctx, f) |
|||
} |
@ -0,0 +1,27 @@ |
|||
// =================================================================================
|
|||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
|||
// =================================================================================
|
|||
|
|||
package dao |
|||
|
|||
import ( |
|||
"practice_Go/internal/dao/internal" |
|||
) |
|||
|
|||
// internalLiveStreamsDao is internal type for wrapping internal DAO implements.
|
|||
type internalLiveStreamsDao = *internal.LiveStreamsDao |
|||
|
|||
// liveStreamsDao is the data access object for table live_streams.
|
|||
// You can define custom methods on it to extend its functionality as you wish.
|
|||
type liveStreamsDao struct { |
|||
internalLiveStreamsDao |
|||
} |
|||
|
|||
var ( |
|||
// LiveStreams is globally public accessible object for table live_streams operations.
|
|||
LiveStreams = liveStreamsDao{ |
|||
internal.NewLiveStreamsDao(), |
|||
} |
|||
) |
|||
|
|||
// Fill with you ideas below.
|
@ -0,0 +1,27 @@ |
|||
// =================================================================================
|
|||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
|||
// =================================================================================
|
|||
|
|||
package dao |
|||
|
|||
import ( |
|||
"practice_Go/internal/dao/internal" |
|||
) |
|||
|
|||
// internalShowsDao is internal type for wrapping internal DAO implements.
|
|||
type internalShowsDao = *internal.ShowsDao |
|||
|
|||
// showsDao is the data access object for table shows.
|
|||
// You can define custom methods on it to extend its functionality as you wish.
|
|||
type showsDao struct { |
|||
internalShowsDao |
|||
} |
|||
|
|||
var ( |
|||
// Shows is globally public accessible object for table shows operations.
|
|||
Shows = showsDao{ |
|||
internal.NewShowsDao(), |
|||
} |
|||
) |
|||
|
|||
// Fill with you ideas below.
|
@ -0,0 +1,25 @@ |
|||
package logic |
|||
|
|||
import ( |
|||
"context" |
|||
"practice_Go/api/v1/ebooks" |
|||
"practice_Go/internal/dao" |
|||
"practice_Go/internal/service/ebooks" |
|||
) |
|||
|
|||
type sEbooks struct{} |
|||
|
|||
func init() { |
|||
service.RegisterEbooks(New()) |
|||
} |
|||
func New() *sEbooks { |
|||
return &sEbooks{} |
|||
} |
|||
|
|||
func (c *sEbooks) GetEbooksList(ctx context.Context, req *ebooks.GetEbooksListReq) (res ebooks.GetEbooksListRes, err error) { |
|||
err = dao.Ebooks.Ctx(ctx).Scan(&res.List) |
|||
if err != nil { |
|||
return |
|||
} |
|||
return |
|||
} |
@ -0,0 +1 @@ |
|||
package live_streams |
@ -0,0 +1 @@ |
|||
package shows |
@ -0,0 +1,19 @@ |
|||
// =================================================================================
|
|||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
|||
// =================================================================================
|
|||
|
|||
package do |
|||
|
|||
import ( |
|||
"github.com/gogf/gf/v2/frame/g" |
|||
) |
|||
|
|||
// Ebooks is the golang structure of table ebooks for DAO operations like Where/Data.
|
|||
type Ebooks struct { |
|||
g.Meta `orm:"table:ebooks, do:true"` |
|||
Id interface{} // 主键
|
|||
Cover interface{} // 封面图URL
|
|||
Title interface{} // 书名(唯一约束)
|
|||
Description interface{} // 简介
|
|||
ViewCount interface{} // 观看人数
|
|||
} |
@ -0,0 +1,22 @@ |
|||
// =================================================================================
|
|||
// 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" |
|||
) |
|||
|
|||
// LiveStreams is the golang structure of table live_streams for DAO operations like Where/Data.
|
|||
type LiveStreams struct { |
|||
g.Meta `orm:"table:live_streams, do:true"` |
|||
Id interface{} // 主键
|
|||
Cover interface{} // 直播封面URL
|
|||
Title interface{} // 直播标题
|
|||
Avatar interface{} // 主播头像URL
|
|||
PublisherId interface{} // 主播ID
|
|||
StartTime *gtime.Time // 计划开播时间
|
|||
Status interface{} // 开播状态(0=未开播,1=直播中)
|
|||
} |
@ -0,0 +1,27 @@ |
|||
// =================================================================================
|
|||
// 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" |
|||
) |
|||
|
|||
// Shows is the golang structure of table shows for DAO operations like Where/Data.
|
|||
type Shows struct { |
|||
g.Meta `orm:"table:shows, do:true"` |
|||
Id interface{} // 主键
|
|||
Cover interface{} // 封面图URL
|
|||
Title interface{} // 标题
|
|||
PublisherId interface{} // 发布人ID
|
|||
PublisherAvatar interface{} // 发布人头像URL
|
|||
PublishTime *gtime.Time // 发布时间
|
|||
ViewCount interface{} // 观看人数
|
|||
CommentCount interface{} // 评论数
|
|||
LikeCount interface{} // 点赞数
|
|||
Type interface{} // 类型(1=文章,2=视频)
|
|||
ClubId interface{} // 所属俱乐部(0=无,1=博古)
|
|||
VideoDuration interface{} // 视频时长(秒)
|
|||
} |
@ -0,0 +1,14 @@ |
|||
// =================================================================================
|
|||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
|||
// =================================================================================
|
|||
|
|||
package entity |
|||
|
|||
// Ebooks is the golang structure for table ebooks.
|
|||
type Ebooks struct { |
|||
Id uint64 `json:"id" orm:"id" ` // 主键
|
|||
Cover string `json:"cover" orm:"cover" ` // 封面图URL
|
|||
Title string `json:"title" orm:"title" ` // 书名(唯一约束)
|
|||
Description string `json:"description" orm:"description" ` // 简介
|
|||
ViewCount uint `json:"viewCount" orm:"view_count" ` // 观看人数
|
|||
} |
@ -0,0 +1,20 @@ |
|||
// =================================================================================
|
|||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
|||
// =================================================================================
|
|||
|
|||
package entity |
|||
|
|||
import ( |
|||
"github.com/gogf/gf/v2/os/gtime" |
|||
) |
|||
|
|||
// LiveStreams is the golang structure for table live_streams.
|
|||
type LiveStreams struct { |
|||
Id uint64 `json:"id" orm:"id" ` // 主键
|
|||
Cover string `json:"cover" orm:"cover" ` // 直播封面URL
|
|||
Title string `json:"title" orm:"title" ` // 直播标题
|
|||
Avatar string `json:"avatar" orm:"avatar" ` // 主播头像URL
|
|||
PublisherId uint64 `json:"publisherId" orm:"publisher_id" ` // 主播ID
|
|||
StartTime *gtime.Time `json:"startTime" orm:"start_time" ` // 计划开播时间
|
|||
Status int `json:"status" orm:"status" ` // 开播状态(0=未开播,1=直播中)
|
|||
} |
@ -0,0 +1,25 @@ |
|||
// =================================================================================
|
|||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
|||
// =================================================================================
|
|||
|
|||
package entity |
|||
|
|||
import ( |
|||
"github.com/gogf/gf/v2/os/gtime" |
|||
) |
|||
|
|||
// Shows is the golang structure for table shows.
|
|||
type Shows struct { |
|||
Id uint64 `json:"id" orm:"id" ` // 主键
|
|||
Cover string `json:"cover" orm:"cover" ` // 封面图URL
|
|||
Title string `json:"title" orm:"title" ` // 标题
|
|||
PublisherId uint64 `json:"publisherId" orm:"publisher_id" ` // 发布人ID
|
|||
PublisherAvatar string `json:"publisherAvatar" orm:"publisher_avatar" ` // 发布人头像URL
|
|||
PublishTime *gtime.Time `json:"publishTime" orm:"publish_time" ` // 发布时间
|
|||
ViewCount uint `json:"viewCount" orm:"view_count" ` // 观看人数
|
|||
CommentCount uint `json:"commentCount" orm:"comment_count" ` // 评论数
|
|||
LikeCount uint `json:"likeCount" orm:"like_count" ` // 点赞数
|
|||
Type int `json:"type" orm:"type" ` // 类型(1=文章,2=视频)
|
|||
ClubId int `json:"clubId" orm:"club_id" ` // 所属俱乐部(0=无,1=博古)
|
|||
VideoDuration uint `json:"videoDuration" orm:"video_duration" ` // 视频时长(秒)
|
|||
} |
@ -0,0 +1,27 @@ |
|||
package service |
|||
|
|||
import ( |
|||
"context" |
|||
"practice_Go/api/v1/ebooks" |
|||
) |
|||
|
|||
type ( |
|||
IEbooks interface { |
|||
GetEbooksList(ctx context.Context, req *ebooks.GetEbooksListReq) (res ebooks.GetEbooksListRes, err error) |
|||
} |
|||
) |
|||
|
|||
var ( |
|||
localBooks IEbooks |
|||
) |
|||
|
|||
func Ebooks() IEbooks { |
|||
if localBooks == nil { |
|||
panic("implement not found for interface IUser, forgot register?") |
|||
} |
|||
return localBooks |
|||
} |
|||
|
|||
func RegisterEbooks(i IEbooks) { |
|||
localBooks = i |
|||
} |
@ -0,0 +1 @@ |
|||
package live_streams |
@ -0,0 +1 @@ |
|||
package shows |
After Width: 119 | Height: 169 | Size: 40 KiB |
After Width: 123 | Height: 170 | Size: 43 KiB |
After Width: 116 | Height: 166 | Size: 48 KiB |
After Width: 122 | Height: 170 | Size: 52 KiB |
Write
Preview
Loading…
Cancel
Save
Reference in new issue