// Copyright 2019 getensh.com. All rights reserved. // Use of this source code is governed by getensh.com. package impl import ( "context" "property-log/impl/v1/log" "property-log/pb" pb_v1 "property-log/pb/v1" "git.getensh.com/common/gopkgs/tasker/rpctasker" "google.golang.org/grpc" ) // 具体实现 type Rcvr struct { } func Register(s *grpc.Server) { pb.RegisterPropertyLogServer(s, &Rcvr{}) } // func (c *Rcvr) CompanyLogAdd(ctx context.Context, req *pb_v1.CompanyLogAddRequest) (reply *pb_v1.CompanyLogAddReply, err error) { t1 := func() error { reply, err = log.CompanyLogAdd(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) CompanyLog(ctx context.Context, req *pb_v1.CompanyLogRequest) (reply *pb_v1.CompanyLogReply, err error) { t1 := func() error { reply, err = log.CompanyLog(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) SystemLogAdd(ctx context.Context, req *pb_v1.SystemLogAddRequest) (reply *pb_v1.SystemLogAddReply, err error) { t1 := func() error { reply, err = log.SystemLogAdd(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) SystemLog(ctx context.Context, req *pb_v1.SystemLogRequest) (reply *pb_v1.SystemLogReply, err error) { t1 := func() error { reply, err = log.SystemLog(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) ManagementLogAdd(ctx context.Context, req *pb_v1.ManagementLogAddRequest) (reply *pb_v1.ManagementLogAddReply, err error) { t1 := func() error { reply, err = log.ManagementLogAdd(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) ManagementLog(ctx context.Context, req *pb_v1.ManagementLogRequest) (reply *pb_v1.ManagementLogReply, err error) { t1 := func() error { reply, err = log.ManagementLog(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) }