You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
2.2 KiB
Go
82 lines
2.2 KiB
Go
package handler
|
|
|
|
import (
|
|
"context"
|
|
"joybuywork/internal/service"
|
|
pb "joybuywork/proto/go_proto/w_common"
|
|
)
|
|
|
|
type WCommonServer struct{}
|
|
|
|
// PolicyToken 获取阿里云token
|
|
func (s *WCommonServer) PolicyToken(ctx context.Context, req *pb.PolicyTokenReq, res *pb.PolicyTokenRes) (err error) {
|
|
//初始化服务
|
|
srv := service.WCommon{}
|
|
srv.Init(ctx)
|
|
err = srv.PolicyToken(req, res)
|
|
return err
|
|
}
|
|
|
|
// Whitelist 服务器白名单
|
|
func (s *WCommonServer) Whitelist(ctx context.Context, req *pb.WhitelistReq, res *pb.WhitelistRes) (err error) {
|
|
//初始化服务
|
|
srv := service.WCommon{}
|
|
srv.Init(ctx)
|
|
err = srv.Whitelist(req, res)
|
|
return err
|
|
}
|
|
|
|
// Download 下载
|
|
func (s *WCommonServer) Download(ctx context.Context, req *pb.DownloadReq, res *pb.DownloadRes) (err error) {
|
|
//初始化服务
|
|
srv := service.WCommon{}
|
|
srv.Init(ctx)
|
|
err = srv.Download(req, res)
|
|
return err
|
|
}
|
|
|
|
// DownloadStatus 下载状态
|
|
func (s *WCommonServer) DownloadStatus(ctx context.Context, req *pb.DownloadStatusReq, res *pb.DownloadStatusRes) (err error) {
|
|
//初始化服务
|
|
srv := service.WCommon{}
|
|
srv.Init(ctx)
|
|
err = srv.DownloadStatus(req, res)
|
|
return err
|
|
}
|
|
|
|
// OperateLog dashboard操作日志
|
|
func (s *WCommonServer) OperateLog(ctx context.Context, req *pb.OperateLogReq, res *pb.OperateLogRes) (err error) {
|
|
//初始化服务
|
|
srv := service.WCommon{}
|
|
srv.Init(ctx)
|
|
err = srv.OperateLog(req, res)
|
|
return err
|
|
}
|
|
|
|
// SaveMaterial 保存素材
|
|
func (s *WCommonServer) SaveMaterial(ctx context.Context, req *pb.SaveMaterialReq, res *pb.SaveMaterialRes) (err error) {
|
|
//初始化服务
|
|
srv := service.WCommon{}
|
|
srv.Init(ctx)
|
|
err = srv.SaveMaterial(req, res)
|
|
return err
|
|
}
|
|
|
|
// MaterialList 素材列表
|
|
func (s *WCommonServer) MaterialList(ctx context.Context, req *pb.MaterialListReq, res *pb.MaterialListRes) (err error) {
|
|
//初始化服务
|
|
srv := service.WCommon{}
|
|
srv.Init(ctx)
|
|
err = srv.MaterialList(req, res)
|
|
return err
|
|
}
|
|
|
|
// CompanyMade 企业定制组件列表
|
|
func (s *WCommonServer) CompanyMade(ctx context.Context, req *pb.CompanyMadeReq, res *pb.CompanyMadeRes) (err error) {
|
|
//初始化服务
|
|
srv := service.WCommon{}
|
|
srv.Init(ctx)
|
|
err = srv.CompanyMade(req, res)
|
|
return err
|
|
}
|