55 lines
1.3 KiB
Go
55 lines
1.3 KiB
Go
// Code generated by goctl. DO NOT EDIT.
|
|
// goctl 1.10.1
|
|
// Source: ad.proto
|
|
|
|
package server
|
|
|
|
import (
|
|
"context"
|
|
|
|
"lone-services/rpc/ad/pb"
|
|
"lone-services/services/ad/internal/logic"
|
|
"lone-services/services/ad/internal/svc"
|
|
)
|
|
|
|
type AdServer struct {
|
|
svcCtx *svc.ServiceContext
|
|
ad.UnimplementedAdServer
|
|
}
|
|
|
|
func NewAdServer(svcCtx *svc.ServiceContext) *AdServer {
|
|
return &AdServer{
|
|
svcCtx: svcCtx,
|
|
}
|
|
}
|
|
|
|
// 添加广告
|
|
func (s *AdServer) Create(ctx context.Context, in *ad.CreateReq) (*ad.Response, error) {
|
|
l := logic.NewCreateLogic(ctx, s.svcCtx)
|
|
return l.Create(in)
|
|
}
|
|
|
|
// 编辑广告
|
|
func (s *AdServer) Edit(ctx context.Context, in *ad.EditReq) (*ad.Response, error) {
|
|
l := logic.NewEditLogic(ctx, s.svcCtx)
|
|
return l.Edit(in)
|
|
}
|
|
|
|
// 广告列表(后台)
|
|
func (s *AdServer) Items(ctx context.Context, in *ad.ItemsReq) (*ad.Response, error) {
|
|
l := logic.NewItemsLogic(ctx, s.svcCtx)
|
|
return l.Items(in)
|
|
}
|
|
|
|
// 广告状态
|
|
func (s *AdServer) Status(ctx context.Context, in *ad.StatusReq) (*ad.Response, error) {
|
|
l := logic.NewStatusLogic(ctx, s.svcCtx)
|
|
return l.Status(in)
|
|
}
|
|
|
|
// 广告列表(C 端)
|
|
func (s *AdServer) WebItems(ctx context.Context, in *ad.WebItemsReq) (*ad.Response, error) {
|
|
l := logic.NewWebItemsLogic(ctx, s.svcCtx)
|
|
return l.WebItems(in)
|
|
}
|