fonchain-artistinfo/cmd/internal/controller/supply.go
2023-01-18 17:03:15 +08:00

111 lines
3.5 KiB
Go

package controller
import (
"context"
"fmt"
"github.com/fonchain-artistserver/cmd/internal/logic"
"github.com/fonchain-artistserver/pb/supplyinfo"
)
type SupplyProvider struct {
supplyinfo.UnimplementedSupplyInfoServer
SupplyLogic *logic.Supply
}
func (a *SupplyProvider) GetSupplyInfoList(ctx context.Context, req *supplyinfo.GetSupplyInfoListRequest) (rep *supplyinfo.GetSupplyInfoListRespond, err error) {
fmt.Println("第一处")
if rep, err = a.SupplyLogic.GetSupplyInfoList(req); err != nil {
return nil, err
}
return rep, nil
}
func (a *SupplyProvider) GetSupplyInfo(ctx context.Context, req *supplyinfo.GetSupplyInfoRequest) (rep *supplyinfo.GetSupplyInfoData, err error) {
fmt.Println("第一处")
if rep, err = a.SupplyLogic.GetSupplyInfo(req); err != nil {
return nil, err
}
return rep, nil
}
func (a *SupplyProvider) UpdateSupplyInfo(ctx context.Context, req *supplyinfo.UpdateSupplyInfoRequest) (rep *supplyinfo.UpdateSupplyInfoRespond, err error) {
fmt.Println("第一处")
if rep, err = a.SupplyLogic.UpdateSupplyInfo(req); err != nil {
return nil, err
}
return rep, nil
}
func (a *SupplyProvider) GetVideoList(ctx context.Context, req *supplyinfo.GetVideoListRequest) (rep *supplyinfo.GetVideoListRespond, err error) {
fmt.Println("第一处")
if rep, err = a.SupplyLogic.GetVideoList(req); err != nil {
return nil, err
}
return rep, nil
}
func (a *SupplyProvider) GetVideo(ctx context.Context, req *supplyinfo.GetVideoRequest) (rep *supplyinfo.GetVideoListData, err error) {
fmt.Println("第一处")
if rep, err = a.SupplyLogic.GetVideo(req); err != nil {
return nil, err
}
return rep, nil
}
func (a *SupplyProvider) UpdateVideo(ctx context.Context, req *supplyinfo.UpdateVideoRequest) (rep *supplyinfo.UpdateVideoRespond, err error) {
fmt.Println("第一处")
if rep, err = a.SupplyLogic.UpdateVideo(req); err != nil {
return nil, err
}
return rep, nil
}
func (a *SupplyProvider) GetExam(ctx context.Context, req *supplyinfo.GetExamRequest) (rep *supplyinfo.GetExamListData, err error) {
fmt.Println("第一处")
if rep, err = a.SupplyLogic.GetExam(req); err != nil {
return nil, err
}
return rep, nil
}
func (a *SupplyProvider) GetExamList(ctx context.Context, req *supplyinfo.GetExamListRequest) (rep *supplyinfo.GetExamListRespond, err error) {
fmt.Println("第一处")
if rep, err = a.SupplyLogic.GetExamList(req); err != nil {
return nil, err
}
return rep, nil
}
func (a *SupplyProvider) UpdateExam(ctx context.Context, req *supplyinfo.UpdateExamRequest) (rep *supplyinfo.UpdateExamRespond, err error) {
fmt.Println("第一处")
if rep, err = a.SupplyLogic.UpdateExam(req); err != nil {
return nil, err
}
return rep, nil
}
func (a *SupplyProvider) GetArtistInfoList(ctx context.Context, req *supplyinfo.GetArtistInfoListRequest) (rep *supplyinfo.GetArtistInfoListRespond, err error) {
fmt.Println("第一处")
if rep, err = a.SupplyLogic.GetArtistInfoList(req); err != nil {
return nil, err
}
return rep, nil
}
func (a *SupplyProvider) GetArtistInfo(ctx context.Context, req *supplyinfo.GetArtistInfoRequest) (rep *supplyinfo.GetArtistInfoListData, err error) {
fmt.Println("第一处")
if rep, err = a.SupplyLogic.GetArtistInfo(req); err != nil {
return nil, err
}
return rep, nil
}
func (a *SupplyProvider) UpdateArtistInfo(ctx context.Context, req *supplyinfo.UpdateArtistInfoRequest) (rep *supplyinfo.UpdateArtistInfoRespond, err error) {
fmt.Println("第一处")
if rep, err = a.SupplyLogic.UpdateArtistInfo(req); err != nil {
return nil, err
}
return rep, nil
}