// Copyright 2019 github.com. All rights reserved. // Use of this source code is governed by github.com. package impl import ( "context" "smart-government-management/pb" "smart-government-management/pb/v1" "github.com/jaryhe/gopkgs/tasker/rpctasker" "google.golang.org/grpc" "smart-government-management/impl/v1/provider" "smart-government-management/impl/v1/device" "smart-government-management/impl/v1/user" "smart-government-management/impl/v1/alarm" "smart-government-management/impl/v1/company" "smart-government-management/impl/v1/dust" "smart-government-management/impl/v1/staff" "smart-government-management/impl/v1/tower" ) // 具体实现 type Rcvr struct { } func Register(s *grpc.Server) { pb.RegisterSmartSiteGovernmentServer(s, &Rcvr{}) } func (c *Rcvr) ChangePasswd(ctx context.Context, req *v1.ChangePasswdRequest) (reply *v1.ChangePasswdReply, err error) { t1 := func() error { reply, err = user.ChangePasswd(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) EmailUpdate(ctx context.Context, req *v1.EmailUpdateRequest) (reply *v1.EmailUpdateReply, err error) { t1 := func() error { reply, err = user.EmailUpdate(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) EmailPrepare(ctx context.Context, req *v1.EmailPrepareRequest) (reply *v1.EmailPrepareReply, err error) { t1 := func() error { reply, err = user.EmailPrepare(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) PhoneUpdate(ctx context.Context, req *v1.PhoneUpdateRequest) (reply *v1.PhoneUpdateReply, err error) { t1 := func() error { reply, err = user.PhoneUpdate(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) UserInfo(ctx context.Context, req *v1.UserInfoRequest) (reply *v1.UserInfoReply, err error) { t1 := func() error { reply, err = user.UserInfo(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) SetPhone(ctx context.Context, req *v1.SetPhoneRequest) (reply *v1.SetPhoneReply, err error) { t1 := func() error { reply, err = user.SetPhone(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) GetPhone(ctx context.Context, req *v1.GetPhoneRequest) (reply *v1.GetPhoneReply, err error) { t1 := func() error { reply, err = user.GetPhone(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) Publicity(ctx context.Context, req *v1.PublicityRequest) (reply *v1.PublicityReply, err error) { t1 := func() error { reply, err = provider.Publicity(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) DeviceTypeList(ctx context.Context, req *v1.DeviceTypeListRequest) (reply *v1.DeviceTypeListReply, err error) { t1 := func() error { reply, err = device.DeviceTypeList(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) DeviceAllTypeList(ctx context.Context, req *v1.DeviceAllTypeListRequest) (reply *v1.DeviceAllTypeListReply, err error) { t1 := func() error { reply, err = device.DeviceAllTypeList(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) DeviceList(ctx context.Context, req *v1.DeviceListRequest) (reply *v1.DeviceListReply, err error) { t1 := func() error { reply, err = device.DeviceList(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) ChannelList(ctx context.Context, req *v1.ChannelListRequest) (reply *v1.ChannelListReply, err error) { t1 := func() error { reply, err = device.ChannelList(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) VedioList(ctx context.Context, req *v1.VedioListRequest) (reply *v1.VedioListReply, err error) { t1 := func() error { reply, err = device.VedioList(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) DockingApprove(ctx context.Context, req *v1.DockingApproveRequest) (reply *v1.DockingApproveReply, err error) { t1 := func() error { reply, err = device.DockingApprove(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) ProviderList(ctx context.Context, req *v1.ProviderListRequest) (reply *v1.ProviderListReply, err error) { t1 := func() error { reply, err = provider.ProviderList(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) ProviderApprove(ctx context.Context, req *v1.ProviderApproveRequest) (reply *v1.ProviderApproveReply, err error) { t1 := func() error { reply, err = provider.ProviderApprove(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) Login(ctx context.Context, req *v1.LoginRequest) (reply *v1.LoginReply, err error) { t1 := func() error { reply, err = user.Login(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) CompanyList(ctx context.Context, req *v1.CompanyListRequest) (reply *v1.CompanyListReply, err error) { t1 := func() error { reply, err = company.CompanyList(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) ProjectList(ctx context.Context, req *v1.ProjectListRequest) (reply *v1.ProjectListReply, err error) { t1 := func() error { reply, err = company.ProjectList(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) ProjectChangeInfoList(ctx context.Context, req *v1.ProjectChangeInfoListRequest) (reply *v1.ProjectChangeInfoListReply, err error) { t1 := func() error { reply, err = company.ProjectChangeInfoList(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) CompanyApprove(ctx context.Context, req *v1.CompanyApproveRequest) (reply *v1.CompanyApproveReply, err error) { t1 := func() error { reply, err = company.CompanyApprove(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) ProjectStatistic(ctx context.Context, req *v1.ProjectStatisticRequest) (reply *v1.ProjectStatisticReply, err error) { t1 := func() error { reply, err = company.ProjectStatistic(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) ProjectTypeStatistic(ctx context.Context, req *v1.ProjectTypeStatisticRequest) (reply *v1.ProjectTypeStatisticReply, err error) { t1 := func() error { reply, err = company.ProjectTypeStatistic(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) StaffStatistic(ctx context.Context, req *v1.StaffStatisticRequest) (reply *v1.StaffStatisticReply, err error) { t1 := func() error { reply, err = company.StaffStatistic(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) CompanyStatistic(ctx context.Context, req *v1.CompanyStatisticRequest) (reply *v1.CompanyStatisticReply, err error) { t1 := func() error { reply, err = company.CompanyStatistic(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) DeviceDelJobList(ctx context.Context, req *v1.DeviceDelJobListRequest) (reply *v1.DeviceDelJobListReply, err error) { t1 := func() error { reply, err = device.DeviceDelJobList(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) DeviceStatistic(ctx context.Context, req *v1.DeviceStatisticRequest) (reply *v1.DeviceStatisticReply, err error) { t1 := func() error { reply, err = device.DeviceStatistic(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) DeviceTypeStatistic(ctx context.Context, req *v1.DeviceTypeStatisticRequest) (reply *v1.DeviceTypeStatisticReply, err error) { t1 := func() error { reply, err = device.DeviceTypeStatistic(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) SetPasswd(ctx context.Context, req *v1.SetPasswdRequest) (reply *v1.SetPasswdReply, err error) { t1 := func() error { reply, err = user.SetPasswd(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) AlarmList(ctx context.Context, req *v1.AlarmListRequest) (reply *v1.AlarmListReply, err error) { t1 := func() error { reply, err = alarm.AlarmList(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) AlarmHandle(ctx context.Context, req *v1.AlarmHandleRequest) (reply *v1.AlarmHandleReply, err error) { t1 := func() error { reply, err = alarm.AlarmHandle(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) AlarmProject(ctx context.Context, req *v1.AlarmProjectRequest) (reply *v1.AlarmProjectReply, err error) { t1 := func() error { reply, err = alarm.AlarmProject(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) AlarmReasonStatistic(ctx context.Context, req *v1.AlarmReasonStatisticRequest) (reply *v1.AlarmReasonStatisticReply, err error) { t1 := func() error { reply, err = alarm.AlarmReasonStatistic(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) AlarmDeviceStatistic(ctx context.Context, req *v1.AlarmDeviceStatisticRequest) (reply *v1.AlarmDeviceStatisticReply, err error) { t1 := func() error { reply, err = alarm.AlarmDeviceStatistic(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) AlarmIncreaseStatistic(ctx context.Context, req *v1.AlarmIncreaseStatisticRequest) (reply *v1.AlarmIncreaseStatisticReply, err error) { t1 := func() error { reply, err = alarm.AlarmIncreaseStatistic(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) AlarmPercentStatistic(ctx context.Context, req *v1.AlarmPercentStatisticRequest) (reply *v1.AlarmPercentStatisticReply, err error) { t1 := func() error { reply, err = alarm.AlarmPercentStatistic(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) DustAqi(ctx context.Context, req *v1.DustAqiRequest) (reply *v1.DustAqiReply, err error) { t1 := func() error { reply, err = dust.DustAqi(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } // 最近一次扬尘数据 func (c *Rcvr) LatestDustMonitorData(ctx context.Context, req *v1.LatestDustMonitorDataRequest) (reply *v1.LatestDustMonitorDataReply, err error) { t1 := func() error { reply, err = dust.LatestDustMonitorData(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) StaffTypeStatistics(ctx context.Context, req *v1.StaffTypeStatisticsRequest) (reply *v1.StaffTypeStatisticsReply, err error) { t1 := func() error { reply, err = staff.StaffTypeStatistics(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) LaborCompanyStatistics(ctx context.Context, req *v1.LaborCompanyStatisticsRequest) (reply *v1.LaborCompanyStatisticsReply, err error) { t1 := func() error { reply, err = staff.LaborCompanyStatistics(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) StaffWorkTypeStatistics(ctx context.Context, req *v1.StaffWorkTypeStatisticsRequest) (reply *v1.StaffWorkTypeStatisticsReply, err error) { t1 := func() error { reply, err = staff.StaffWorkTypeStatistics(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) LatestTowerMonitorData(ctx context.Context, req *v1.LatestTowerMonitorDataRequest) (reply *v1.LatestTowerMonitorDataReply, err error) { t1 := func() error { reply, err = tower.LatestTowerMonitorData(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) }