排班管理、主播管理、直播账号管理
This commit is contained in:
89
model/dto/data/anchor_dto.go
Normal file
89
model/dto/data/anchor_dto.go
Normal file
@@ -0,0 +1,89 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
"erp/consts/data"
|
||||
entity "erp/model/entity/data"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// CreateAnchorReq 创建主播请求
|
||||
type CreateAnchorReq struct {
|
||||
g.Meta `path:"/createAnchor" method:"post" tags:"主播管理" summary:"创建主播" dc:"创建新的主播"`
|
||||
Name string `json:"name" v:"required" dc:"主播姓名"`
|
||||
Phone string `json:"phone" v:"required" dc:"联系电话"`
|
||||
Code string `json:"code" v:"required" dc:"工号"`
|
||||
Status int `json:"status" d:"1" dc:"状态(0停用 1正常)"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
}
|
||||
|
||||
// CreateAnchorRes 创建主播响应
|
||||
type CreateAnchorRes struct {
|
||||
Id int64 `json:"id" dc:"主播ID"`
|
||||
}
|
||||
|
||||
// ListAnchorReq 获取主播列表请求
|
||||
type ListAnchorReq struct {
|
||||
g.Meta `path:"/listAnchors" method:"get" tags:"主播管理" summary:"获取主播列表" dc:"分页查询主播列表"`
|
||||
*beans.Page
|
||||
Name string `json:"name" dc:"主播姓名"`
|
||||
Phone string `json:"phone" dc:"联系电话"`
|
||||
Code string `json:"code" dc:"工号"`
|
||||
Status *int `json:"status" dc:"状态(0停用 1正常)"`
|
||||
Keyword string `json:"keyword" dc:"关键字(搜索姓名/电话/工号)"`
|
||||
}
|
||||
|
||||
// ListAnchorRes 获取主播列表响应
|
||||
type ListAnchorRes struct {
|
||||
List []AnchorItem `json:"list" dc:"主播列表"`
|
||||
Total int `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// AnchorItem 主播列表项
|
||||
type AnchorItem struct {
|
||||
Id int64 `json:"id,string"`
|
||||
Name string `json:"name"`
|
||||
Phone string `json:"phone"`
|
||||
Code string `json:"code"`
|
||||
Status int `json:"status"`
|
||||
StatusName string `json:"statusName"`
|
||||
Remark string `json:"remark"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
UpdatedAt int64 `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// GetAnchorReq 获取主播详情请求
|
||||
type GetAnchorReq struct {
|
||||
g.Meta `path:"/getAnchor" method:"get" tags:"主播管理" summary:"获取主播详情" dc:"获取主播详情"`
|
||||
Id int64 `json:"id" v:"required" dc:"主播ID"`
|
||||
}
|
||||
|
||||
// GetAnchorRes 获取主播详情响应
|
||||
type GetAnchorRes struct {
|
||||
*entity.Anchor
|
||||
}
|
||||
|
||||
// UpdateAnchorReq 更新主播请求
|
||||
type UpdateAnchorReq struct {
|
||||
g.Meta `path:"/updateAnchor" method:"put" tags:"主播管理" summary:"更新主播" dc:"更新主播信息"`
|
||||
Id int64 `json:"id" v:"required" dc:"主播ID"`
|
||||
Name string `json:"name" dc:"主播姓名"`
|
||||
Phone string `json:"phone" dc:"联系电话"`
|
||||
Code string `json:"code" dc:"工号"`
|
||||
Status *int `json:"status" dc:"状态(0停用 1正常)"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
}
|
||||
|
||||
// DeleteAnchorReq 删除主播请求
|
||||
type DeleteAnchorReq struct {
|
||||
g.Meta `path:"/deleteAnchor" method:"delete" tags:"主播管理" summary:"删除主播" dc:"删除主播"`
|
||||
Id int64 `json:"id" v:"required" dc:"主播ID"`
|
||||
}
|
||||
|
||||
// UpdateAnchorStatusReq 更新主播状态请求
|
||||
type UpdateAnchorStatusReq struct {
|
||||
g.Meta `path:"/updateAnchorStatus" method:"put" tags:"主播管理" summary:"更新主播状态" dc:"更新主播状态"`
|
||||
Id int64 `json:"id" v:"required" dc:"主播ID"`
|
||||
Status data.AnchorStatus `json:"status" v:"required" dc:"状态(0停用 1正常)"`
|
||||
}
|
||||
89
model/dto/data/live_account_dto.go
Normal file
89
model/dto/data/live_account_dto.go
Normal file
@@ -0,0 +1,89 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
"erp/consts/data"
|
||||
entity "erp/model/entity/data"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// CreateLiveAccountReq 创建直播账号请求
|
||||
type CreateLiveAccountReq struct {
|
||||
g.Meta `path:"/createLiveAccount" method:"post" tags:"直播账号管理" summary:"创建直播账号" dc:"创建新的直播账号"`
|
||||
Platform string `json:"platform" v:"required" dc:"直播平台(抖音/快手/淘宝等)"`
|
||||
AccountName string `json:"accountName" v:"required" dc:"账号名称"`
|
||||
AccountId string `json:"accountId" v:"required" dc:"账号ID"`
|
||||
Status int `json:"status" d:"1" dc:"状态(0停用 1正常)"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
}
|
||||
|
||||
// CreateLiveAccountRes 创建直播账号响应
|
||||
type CreateLiveAccountRes struct {
|
||||
Id int64 `json:"id" dc:"账号ID"`
|
||||
}
|
||||
|
||||
// ListLiveAccountReq 获取直播账号列表请求
|
||||
type ListLiveAccountReq struct {
|
||||
g.Meta `path:"/listLiveAccounts" method:"get" tags:"直播账号管理" summary:"获取直播账号列表" dc:"分页查询直播账号列表"`
|
||||
*beans.Page
|
||||
Platform string `json:"platform" dc:"直播平台"`
|
||||
AccountName string `json:"accountName" dc:"账号名称"`
|
||||
AccountId string `json:"accountId" dc:"账号ID"`
|
||||
Status *int `json:"status" dc:"状态(0停用 1正常)"`
|
||||
Keyword string `json:"keyword" dc:"关键字(搜索平台/账号名称/账号ID)"`
|
||||
}
|
||||
|
||||
// ListLiveAccountRes 获取直播账号列表响应
|
||||
type ListLiveAccountRes struct {
|
||||
List []LiveAccountItem `json:"list" dc:"直播账号列表"`
|
||||
Total int `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// LiveAccountItem 直播账号列表项
|
||||
type LiveAccountItem struct {
|
||||
Id int64 `json:"id,string"`
|
||||
Platform string `json:"platform"`
|
||||
AccountName string `json:"accountName"`
|
||||
AccountId string `json:"accountId"`
|
||||
Status int `json:"status"`
|
||||
StatusName string `json:"statusName"`
|
||||
Remark string `json:"remark"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
UpdatedAt int64 `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// GetLiveAccountReq 获取直播账号详情请求
|
||||
type GetLiveAccountReq struct {
|
||||
g.Meta `path:"/getLiveAccount" method:"get" tags:"直播账号管理" summary:"获取直播账号详情" dc:"获取直播账号详情"`
|
||||
Id int64 `json:"id" v:"required" dc:"账号ID"`
|
||||
}
|
||||
|
||||
// GetLiveAccountRes 获取直播账号详情响应
|
||||
type GetLiveAccountRes struct {
|
||||
*entity.LiveAccount
|
||||
}
|
||||
|
||||
// UpdateLiveAccountReq 更新直播账号请求
|
||||
type UpdateLiveAccountReq struct {
|
||||
g.Meta `path:"/updateLiveAccount" method:"put" tags:"直播账号管理" summary:"更新直播账号" dc:"更新直播账号信息"`
|
||||
Id int64 `json:"id" v:"required" dc:"账号ID"`
|
||||
Platform string `json:"platform" dc:"直播平台"`
|
||||
AccountName string `json:"accountName" dc:"账号名称"`
|
||||
AccountId string `json:"accountId" dc:"账号ID"`
|
||||
Status *int `json:"status" dc:"状态(0停用 1正常)"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
}
|
||||
|
||||
// DeleteLiveAccountReq 删除直播账号请求
|
||||
type DeleteLiveAccountReq struct {
|
||||
g.Meta `path:"/deleteLiveAccount" method:"delete" tags:"直播账号管理" summary:"删除直播账号" dc:"删除直播账号"`
|
||||
Id int64 `json:"id" v:"required" dc:"账号ID"`
|
||||
}
|
||||
|
||||
// UpdateLiveAccountStatusReq 更新直播账号状态请求
|
||||
type UpdateLiveAccountStatusReq struct {
|
||||
g.Meta `path:"/updateLiveAccountStatus" method:"put" tags:"直播账号管理" summary:"更新直播账号状态" dc:"更新直播账号状态"`
|
||||
Id int64 `json:"id" v:"required" dc:"账号ID"`
|
||||
Status data.AnchorStatus `json:"status" v:"required" dc:"状态(0停用 1正常)"`
|
||||
}
|
||||
102
model/dto/data/schedule_dto.go
Normal file
102
model/dto/data/schedule_dto.go
Normal file
@@ -0,0 +1,102 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
"erp/consts/data"
|
||||
entity "erp/model/entity/data"
|
||||
"time"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// CreateScheduleReq 创建排班请求
|
||||
type CreateScheduleReq struct {
|
||||
g.Meta `path:"/createSchedule" method:"post" tags:"排班管理" summary:"创建排班" dc:"创建新的排班"`
|
||||
AnchorId int `json:"anchorId" v:"required" dc:"主播ID"`
|
||||
AccountId int `json:"accountId" v:"required" dc:"直播账号ID"`
|
||||
StartTime time.Time `json:"startTime" v:"required" dc:"开始时间"`
|
||||
EndTime time.Time `json:"endTime" v:"required" dc:"结束时间"`
|
||||
Status int `json:"status" d:"0" dc:"状态(0待直播 1直播中 2已结束 3已取消)"`
|
||||
ProductId int64 `json:"productId" dc:"商品ID"`
|
||||
OrderId int64 `json:"orderId" dc:"订单ID"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
}
|
||||
|
||||
// CreateScheduleRes 创建排班响应
|
||||
type CreateScheduleRes struct {
|
||||
Id int64 `json:"id" dc:"排班ID"`
|
||||
}
|
||||
|
||||
// ListScheduleReq 获取排班列表请求
|
||||
type ListScheduleReq struct {
|
||||
g.Meta `path:"/listSchedules" method:"get" tags:"排班管理" summary:"获取排班列表" dc:"分页查询排班列表"`
|
||||
*beans.Page
|
||||
AnchorId *int `json:"anchorId" dc:"主播ID"`
|
||||
AccountId *int `json:"accountId" dc:"直播账号ID"`
|
||||
Status *int `json:"status" dc:"状态"`
|
||||
StartDate time.Time `json:"startDate" dc:"开始日期(筛选)"`
|
||||
EndDate time.Time `json:"endDate" dc:"结束日期(筛选)"`
|
||||
}
|
||||
|
||||
// ListScheduleRes 获取排班列表响应
|
||||
type ListScheduleRes struct {
|
||||
List []ScheduleItem `json:"list" dc:"排班列表"`
|
||||
Total int `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// ScheduleItem 排班列表项
|
||||
type ScheduleItem struct {
|
||||
Id int64 `json:"id,string"`
|
||||
AnchorId int `json:"anchorId"`
|
||||
AnchorName string `json:"anchorName"`
|
||||
AccountId int `json:"accountId"`
|
||||
AccountName string `json:"accountName"`
|
||||
Platform string `json:"platform"`
|
||||
StartTime int64 `json:"startTime"`
|
||||
EndTime int64 `json:"endTime"`
|
||||
Status int `json:"status"`
|
||||
StatusName string `json:"statusName"`
|
||||
ProductId int64 `json:"productId"`
|
||||
OrderId int64 `json:"orderId"`
|
||||
Remark string `json:"remark"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
UpdatedAt int64 `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// GetScheduleReq 获取排班详情请求
|
||||
type GetScheduleReq struct {
|
||||
g.Meta `path:"/getSchedule" method:"get" tags:"排班管理" summary:"获取排班详情" dc:"获取排班详情"`
|
||||
Id int64 `json:"id" v:"required" dc:"排班ID"`
|
||||
}
|
||||
|
||||
// GetScheduleRes 获取排班详情响应
|
||||
type GetScheduleRes struct {
|
||||
*entity.Schedule
|
||||
}
|
||||
|
||||
// UpdateScheduleReq 更新排班请求
|
||||
type UpdateScheduleReq struct {
|
||||
g.Meta `path:"/updateSchedule" method:"put" tags:"排班管理" summary:"更新排班" dc:"更新排班信息"`
|
||||
Id int64 `json:"id" v:"required" dc:"排班ID"`
|
||||
AnchorId *int `json:"anchorId" dc:"主播ID"`
|
||||
AccountId *int `json:"accountId" dc:"直播账号ID"`
|
||||
StartTime *time.Time `json:"startTime" dc:"开始时间"`
|
||||
EndTime *time.Time `json:"endTime" dc:"结束时间"`
|
||||
Status *int `json:"status" dc:"状态(0待直播 1直播中 2已结束 3已取消)"`
|
||||
ProductId *int64 `json:"productId" dc:"商品ID"`
|
||||
OrderId *int64 `json:"orderId" dc:"订单ID"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
}
|
||||
|
||||
// DeleteScheduleReq 删除排班请求
|
||||
type DeleteScheduleReq struct {
|
||||
g.Meta `path:"/deleteSchedule" method:"delete" tags:"排班管理" summary:"删除排班" dc:"删除排班"`
|
||||
Id int64 `json:"id" v:"required" dc:"排班ID"`
|
||||
}
|
||||
|
||||
// UpdateScheduleStatusReq 更新排班状态请求
|
||||
type UpdateScheduleStatusReq struct {
|
||||
g.Meta `path:"/updateScheduleStatus" method:"put" tags:"排班管理" summary:"更新排班状态" dc:"更新排班状态"`
|
||||
Id int64 `json:"id" v:"required" dc:"排班ID"`
|
||||
Status data.ScheduleStatus `json:"status" v:"required" dc:"状态(0待直播 1直播中 2已结束 3已取消)"`
|
||||
}
|
||||
35
model/entity/data/anchor.go
Normal file
35
model/entity/data/anchor.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
"gitea.com/red-future/common/beans"
|
||||
)
|
||||
|
||||
// Anchor 主播实体
|
||||
type Anchor struct {
|
||||
beans.SQLBaseDO `orm:",inherit"`
|
||||
Name string `orm:"name" json:"name" description:"主播姓名"`
|
||||
Phone string `orm:"phone" json:"phone" description:"联系电话"`
|
||||
Code string `orm:"code" json:"code" description:"工号"`
|
||||
Status int `orm:"status" json:"status" description:"状态(0停用 1正常)"`
|
||||
Remark string `orm:"remark" json:"remark" description:"备注"`
|
||||
}
|
||||
|
||||
// AnchorCol 主播表字段定义
|
||||
type AnchorCol struct {
|
||||
beans.SQLBaseCol
|
||||
Name string
|
||||
Phone string
|
||||
Code string
|
||||
Status string
|
||||
Remark string
|
||||
}
|
||||
|
||||
// AnchorCols 主播表字段常量
|
||||
var AnchorCols = AnchorCol{
|
||||
SQLBaseCol: beans.DefSQLBaseCol,
|
||||
Name: "name",
|
||||
Phone: "phone",
|
||||
Code: "code",
|
||||
Status: "status",
|
||||
Remark: "remark",
|
||||
}
|
||||
35
model/entity/data/live_account.go
Normal file
35
model/entity/data/live_account.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
"gitea.com/red-future/common/beans"
|
||||
)
|
||||
|
||||
// LiveAccount 直播账号实体
|
||||
type LiveAccount struct {
|
||||
beans.SQLBaseDO `orm:",inherit"`
|
||||
Platform string `orm:"platform" json:"platform" description:"直播平台(抖音/快手/淘宝等)"`
|
||||
AccountName string `orm:"account_name" json:"accountName" description:"账号名称"`
|
||||
AccountId string `orm:"account_id" json:"accountId" description:"账号ID"`
|
||||
Status int `orm:"status" json:"status" description:"状态(0停用 1正常)"`
|
||||
Remark string `orm:"remark" json:"remark" description:"备注"`
|
||||
}
|
||||
|
||||
// LiveAccountCol 直播账号表字段定义
|
||||
type LiveAccountCol struct {
|
||||
beans.SQLBaseCol
|
||||
Platform string
|
||||
AccountName string
|
||||
AccountId string
|
||||
Status string
|
||||
Remark string
|
||||
}
|
||||
|
||||
// LiveAccountCols 直播账号表字段常量
|
||||
var LiveAccountCols = LiveAccountCol{
|
||||
SQLBaseCol: beans.DefSQLBaseCol,
|
||||
Platform: "platform",
|
||||
AccountName: "account_name",
|
||||
AccountId: "account_id",
|
||||
Status: "status",
|
||||
Remark: "remark",
|
||||
}
|
||||
46
model/entity/data/schedule.go
Normal file
46
model/entity/data/schedule.go
Normal file
@@ -0,0 +1,46 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
)
|
||||
|
||||
// Schedule 排班实体
|
||||
type Schedule struct {
|
||||
beans.SQLBaseDO `orm:",inherit"`
|
||||
AnchorId int `orm:"anchor_id" json:"anchorId" description:"主播ID"`
|
||||
AccountId int `orm:"account_id" json:"accountId" description:"直播账号ID"`
|
||||
StartTime time.Time `orm:"start_time" json:"startTime" description:"开始时间"`
|
||||
EndTime time.Time `orm:"end_time" json:"endTime" description:"结束时间"`
|
||||
Status int `orm:"status" json:"status" description:"状态(0待直播 1直播中 2已结束 3已取消)"`
|
||||
ProductId int64 `orm:"product_id" json:"productId" description:"商品ID"`
|
||||
OrderId int64 `orm:"order_id" json:"orderId" description:"订单ID"`
|
||||
Remark string `orm:"remark" json:"remark" description:"备注"`
|
||||
}
|
||||
|
||||
// ScheduleCol 排班表字段定义
|
||||
type ScheduleCol struct {
|
||||
beans.SQLBaseCol
|
||||
AnchorId string
|
||||
AccountId string
|
||||
StartTime string
|
||||
EndTime string
|
||||
Status string
|
||||
ProductId string
|
||||
OrderId string
|
||||
Remark string
|
||||
}
|
||||
|
||||
// ScheduleCols 排班表字段常量
|
||||
var ScheduleCols = ScheduleCol{
|
||||
SQLBaseCol: beans.DefSQLBaseCol,
|
||||
AnchorId: "anchor_id",
|
||||
AccountId: "account_id",
|
||||
StartTime: "start_time",
|
||||
EndTime: "end_time",
|
||||
Status: "status",
|
||||
ProductId: "product_id",
|
||||
OrderId: "order_id",
|
||||
Remark: "remark",
|
||||
}
|
||||
Reference in New Issue
Block a user