fonchain-artistinfo/cmd/internal/logic/supply.go
2023-02-06 09:33:09 +08:00

89 lines
3.4 KiB
Go

package logic
import (
"github.com/fonchain/fonchain-artistinfo/cmd/internal/dao"
"github.com/fonchain/fonchain-artistinfo/pb/supplyinfo"
)
type ISupply interface {
GetSupplyInfoList(req *supplyinfo.GetSupplyInfoListRequest) (rep *supplyinfo.GetSupplyInfoListRespond, err error)
GetSupplyInfo(req *supplyinfo.GetSupplyInfoRequest) (rep *supplyinfo.GetSupplyInfoData, err error)
UpdateSupplyInfo(req *supplyinfo.UpdateSupplyInfoRequest) (rep *supplyinfo.UpdateSupplyInfoRespond, err error)
GetVideoList(req *supplyinfo.GetVideoListRequest) (rep *supplyinfo.GetVideoListRespond, err error)
GetVideo(req *supplyinfo.GetVideoRequest) (rep *supplyinfo.GetVideoListData, err error)
UpdateVideo(req *supplyinfo.UpdateVideoRequest) (rep *supplyinfo.UpdateVideoRespond, err error)
GetExam(req *supplyinfo.GetExamRequest) (rep *supplyinfo.GetExamListData, err error)
GetExamList(req *supplyinfo.GetExamListRequest) (rep *supplyinfo.GetExamListRespond, err error)
UpdateExam(req *supplyinfo.UpdateExamRequest) (rep *supplyinfo.UpdateExamRespond, err error)
GetArtistInfoList(req *supplyinfo.GetArtistInfoListRequest) (rep *supplyinfo.GetArtistInfoListRespond, err error)
GetArtistInfo(req *supplyinfo.GetArtistInfoRequest) (rep *supplyinfo.GetArtistInfoListData, err error)
UpdateArtistInfo(req *supplyinfo.UpdateArtistInfoRequest) (rep *supplyinfo.UpdateArtistInfoRespond, err error)
}
func NewSupply() ISupply {
return &Supply{}
}
type Supply struct {
}
func (a *Supply) GetSupplyInfoList(req *supplyinfo.GetSupplyInfoListRequest) (rep *supplyinfo.GetSupplyInfoListRespond, err error) {
rep, err = dao.GetSupplyInfoList(int32(req.ArtistId), int32(req.Types))
return
}
func (a *Supply) GetSupplyInfo(req *supplyinfo.GetSupplyInfoRequest) (rep *supplyinfo.GetSupplyInfoData, err error) {
rep, err = dao.GetSupplyInfo(req)
return
}
func (a *Supply) UpdateSupplyInfo(req *supplyinfo.UpdateSupplyInfoRequest) (rep *supplyinfo.UpdateSupplyInfoRespond, err error) {
rep, err = dao.UpdateSupplyInfo(req)
return
}
func (a *Supply) GetVideoList(req *supplyinfo.GetVideoListRequest) (rep *supplyinfo.GetVideoListRespond, err error) {
rep, err = dao.GetVideoList(int32(req.UserId))
return
}
func (a *Supply) GetVideo(req *supplyinfo.GetVideoRequest) (rep *supplyinfo.GetVideoListData, err error) {
rep, err = dao.GetVideo(req)
return
}
func (a *Supply) UpdateVideo(req *supplyinfo.UpdateVideoRequest) (rep *supplyinfo.UpdateVideoRespond, err error) {
rep, err = dao.UpdateVideo(req)
return
}
func (a *Supply) GetExam(req *supplyinfo.GetExamRequest) (rep *supplyinfo.GetExamListData, err error) {
rep, err = dao.GetExam(req)
return
}
func (a *Supply) GetExamList(req *supplyinfo.GetExamListRequest) (rep *supplyinfo.GetExamListRespond, err error) {
rep, err = dao.GetExamList(req)
return
}
func (a *Supply) UpdateExam(req *supplyinfo.UpdateExamRequest) (rep *supplyinfo.UpdateExamRespond, err error) {
rep, err = dao.UpdateExam(req)
return
}
func (a *Supply) GetArtistInfoList(req *supplyinfo.GetArtistInfoListRequest) (rep *supplyinfo.GetArtistInfoListRespond, err error) {
rep, err = dao.GetArtistInfoList(int32(req.UserId))
return
}
func (a *Supply) GetArtistInfo(req *supplyinfo.GetArtistInfoRequest) (rep *supplyinfo.GetArtistInfoListData, err error) {
rep, err = dao.GetArtistInfo(req)
return
}
func (a *Supply) UpdateArtistInfo(req *supplyinfo.UpdateArtistInfoRequest) (rep *supplyinfo.UpdateArtistInfoRespond, err error) {
rep, err = dao.UpdateArtistInfo(req)
return
}