Files
erp/controller/data/live_account_controller.go

54 lines
1.7 KiB
Go
Raw Normal View History

package data
import (
"context"
dto "erp/model/dto/data"
service "erp/service/data"
"gitea.com/red-future/common/beans"
)
type liveAccountController struct{}
// LiveAccount 直播账号控制器
var LiveAccount = new(liveAccountController)
// CreateLiveAccount 创建直播账号
func (c *liveAccountController) CreateLiveAccount(ctx context.Context, req *dto.CreateLiveAccountReq) (res *dto.CreateLiveAccountRes, err error) {
return service.LiveAccount.Create(ctx, req)
}
// ListLiveAccount 获取直播账号列表
func (c *liveAccountController) ListLiveAccount(ctx context.Context, req *dto.ListLiveAccountReq) (res *dto.ListLiveAccountRes, err error) {
return service.LiveAccount.List(ctx, req)
}
// GetLiveAccount 获取直播账号详情
func (c *liveAccountController) GetLiveAccount(ctx context.Context, req *dto.GetLiveAccountReq) (res *dto.GetLiveAccountRes, err error) {
return service.LiveAccount.GetOne(ctx, req)
}
// UpdateLiveAccount 更新直播账号
func (c *liveAccountController) UpdateLiveAccount(ctx context.Context, req *dto.UpdateLiveAccountReq) (res *beans.ResponseEmpty, err error) {
err = service.LiveAccount.Update(ctx, req)
return
}
// UpdateLiveAccountStatus 更新直播账号状态
func (c *liveAccountController) UpdateLiveAccountStatus(ctx context.Context, req *dto.UpdateLiveAccountStatusReq) (res *beans.ResponseEmpty, err error) {
err = service.LiveAccount.UpdateStatus(ctx, req)
return
}
// DeleteLiveAccount 删除直播账号
func (c *liveAccountController) DeleteLiveAccount(ctx context.Context, req *dto.DeleteLiveAccountReq) (res *beans.ResponseEmpty, err error) {
err = service.LiveAccount.Delete(ctx, req)
return
}