排班管理、主播管理、直播账号管理
This commit is contained in:
47
controller/data/anchor_controller.go
Normal file
47
controller/data/anchor_controller.go
Normal file
@@ -0,0 +1,47 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
"context"
|
||||
dto "erp/model/dto/data"
|
||||
service "erp/service/data"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
)
|
||||
|
||||
type anchorController struct{}
|
||||
|
||||
// Anchor 主播控制器
|
||||
var Anchor = new(anchorController)
|
||||
|
||||
// CreateAnchor 创建主播
|
||||
func (c *anchorController) CreateAnchor(ctx context.Context, req *dto.CreateAnchorReq) (res *dto.CreateAnchorRes, err error) {
|
||||
return service.Anchor.Create(ctx, req)
|
||||
}
|
||||
|
||||
// ListAnchor 获取主播列表
|
||||
func (c *anchorController) ListAnchor(ctx context.Context, req *dto.ListAnchorReq) (res *dto.ListAnchorRes, err error) {
|
||||
return service.Anchor.List(ctx, req)
|
||||
}
|
||||
|
||||
// GetAnchor 获取主播详情
|
||||
func (c *anchorController) GetAnchor(ctx context.Context, req *dto.GetAnchorReq) (res *dto.GetAnchorRes, err error) {
|
||||
return service.Anchor.GetOne(ctx, req)
|
||||
}
|
||||
|
||||
// UpdateAnchor 更新主播
|
||||
func (c *anchorController) UpdateAnchor(ctx context.Context, req *dto.UpdateAnchorReq) (res *beans.ResponseEmpty, err error) {
|
||||
err = service.Anchor.Update(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateAnchorStatus 更新主播状态
|
||||
func (c *anchorController) UpdateAnchorStatus(ctx context.Context, req *dto.UpdateAnchorStatusReq) (res *beans.ResponseEmpty, err error) {
|
||||
err = service.Anchor.UpdateStatus(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// DeleteAnchor 删除主播
|
||||
func (c *anchorController) DeleteAnchor(ctx context.Context, req *dto.DeleteAnchorReq) (res *beans.ResponseEmpty, err error) {
|
||||
err = service.Anchor.Delete(ctx, req)
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user