123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654 |
- // Copyright 2019 github.com. All rights reserved.
- // Use of this source code is governed by github.com.
- package impl
- import (
- "context"
- "smart-site-management/impl/v1/alarm"
- "smart-site-management/impl/v1/dust"
- "smart-site-management/impl/v1/lift"
- "smart-site-management/impl/v1/staff"
- "smart-site-management/impl/v1/task"
- "smart-site-management/impl/v1/vehicle"
- "smart-site-management/impl/v1/tower"
- "smart-site-management/pb"
- "smart-site-management/pb/v1"
- "smart-site-management/impl/v1/camera"
- "smart-site-management/impl/v1/project"
- "smart-site-management/impl/v1/user"
- "github.com/jaryhe/gopkgs/tasker/rpctasker"
- "google.golang.org/grpc"
- )
- // 具体实现
- type Rcvr struct {
- }
- func Register(s *grpc.Server) {
- pb.RegisterSmartSiteProjectServer(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) 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) ProjectSetPic(ctx context.Context, req *v1.ProjectSetPicRequest) (reply *v1.ProjectSetPicReply, err error) {
- t1 := func() error {
- reply, err = project.ProjectSetPic(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 = project.DeviceList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) DeviceState(ctx context.Context, req *v1.DeviceStateRequest) (reply *v1.DeviceStateReply, err error) {
- t1 := func() error {
- reply, err = project.DeviceState(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 获取设备绑定的摄像头
- func (c *Rcvr) DeviceVideoChannel(ctx context.Context, req *v1.DeviceVideoChannelRequest) (reply *v1.DeviceVideoChannelReply, err error) {
- t1 := func() error {
- reply, err = project.DeviceVideoChannel(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) ChannelUpdate(ctx context.Context, req *v1.ChannelUpdateRequest) (reply *v1.ChannelUpdateReply, err error) {
- t1 := func() error {
- reply, err = camera.ChannelUpdate(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 = camera.VedioList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 运渣车辆列表
- func (c *Rcvr) VehicleList(ctx context.Context, req *v1.VehicleListRequest) (reply *v1.VehicleListReply, err error) {
- t1 := func() error {
- reply, err = vehicle.VehicleList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 获取实时播放地址
- func (c *Rcvr) RealPlay(ctx context.Context, req *v1.RealPlayRequest) (reply *v1.RealPlayReply, err error) {
- t1 := func() error {
- reply, err = camera.RealPlay(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) Ptz(ctx context.Context, req *v1.PtzRequest) (reply *v1.PtzReply, err error) {
- t1 := func() error {
- reply, err = camera.Ptz(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) VedioPing(ctx context.Context, req *v1.VedioPingRequest) (reply *v1.VedioPingReply, err error) {
- t1 := func() error {
- reply, err = camera.VedioPing(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 最近一次考勤数据
- func (c *Rcvr) LatestStaffData(ctx context.Context, req *v1.LatestStaffDataRequest) (reply *v1.LatestStaffDataReply, err error) {
- t1 := func() error {
- reply, err = staff.LatestStaffData(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) StaffList(ctx context.Context, req *v1.StaffListRequest) (reply *v1.StaffListReply, err error) {
- t1 := func() error {
- reply, err = staff.StaffList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) StaffAttendance(ctx context.Context, req *v1.StaffAttendanceRequest) (reply *v1.StaffAttendanceReply, err error) {
- t1 := func() error {
- reply, err = staff.StaffAttendance(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) 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) 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) DustMonitorHistory(ctx context.Context, req *v1.DustMonitorHistoryRequest) (reply *v1.DustMonitorHistoryReply, err error) {
- t1 := func() error {
- reply, err = dust.DustMonitorHistory(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 扬尘设备列表
- func (c *Rcvr) DustList(ctx context.Context, req *v1.DustListRequest) (reply *v1.DustListReply, err error) {
- t1 := func() error {
- reply, err = dust.DustList(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) 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) DeviceBindCamera(ctx context.Context, req *v1.DeviceBindCameraRequest) (reply *v1.DeviceBindCameraReply, err error) {
- t1 := func() error {
- reply, err = camera.DeviceBindCamera(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 设备入库审批
- func (c *Rcvr) DeviceApprove(ctx context.Context, req *v1.DeviceApproveRequest) (reply *v1.DeviceApproveReply, err error) {
- t1 := func() error {
- reply, err = project.DeviceApprove(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 设备解绑摄像头
- func (c *Rcvr) DeviceUnbindCamera(ctx context.Context, req *v1.DeviceUnbindCameraRequest) (reply *v1.DeviceUnbindCameraReply, err error) {
- t1 := func() error {
- reply, err = camera.DeviceUnbindCamera(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 = camera.ChannelList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 项目(工程)信息
- func (c *Rcvr) ProjectInfo(ctx context.Context, req *v1.ProjectInfoRequest) (reply *v1.ProjectInfoReply, err error) {
- t1 := func() error {
- reply, err = project.ProjectInfo(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 项目设备统计
- func (c *Rcvr) ProjectDeviceStatistics(ctx context.Context, req *v1.ProjectDeviceStatisticsRequest) (reply *v1.ProjectDeviceStatisticsReply, err error) {
- t1 := func() error {
- reply, err = project.ProjectDeviceStatistics(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 获取项目进度
- func (c *Rcvr) ProjectProgress(ctx context.Context, req *v1.ProjectProgressRequest) (reply *v1.ProjectProgressReply, err error) {
- t1 := func() error {
- reply, err = project.ProjectProgress(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 添加项目进度
- func (c *Rcvr) ProjectProgressAdd(ctx context.Context, req *v1.ProjectProgressAddRequest) (reply *v1.ProjectProgressAddReply, err error) {
- t1 := func() error {
- reply, err = project.ProjectProgressAdd(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 进度完成设置
- func (c *Rcvr) ProjectProgressSet(ctx context.Context, req *v1.ProjectProgressSetRequest) (reply *v1.ProjectProgressSetReply, err error) {
- t1 := func() error {
- reply, err = project.ProjectProgressSet(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 删除项目进度
- func (c *Rcvr) ProjectProgressDel(ctx context.Context, req *v1.ProjectProgressDelRequest) (reply *v1.ProjectProgressDelReply, err error) {
- t1 := func() error {
- reply, err = project.ProjectProgressDel(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 添加告警规则
- func (c *Rcvr) AlarmRuleAdd(ctx context.Context, req *v1.AlarmRuleAddRequest) (reply *v1.AlarmRuleAddReply, err error) {
- t1 := func() error {
- reply, err = alarm.AlarmRuleAdd(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 删除告警规则
- func (c *Rcvr) AlarmRuleDelete(ctx context.Context, req *v1.AlarmRuleDeleteRequest) (reply *v1.AlarmRuleDeleteReply, err error) {
- t1 := func() error {
- reply, err = alarm.AlarmRuleDelete(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 告警规则列表
- func (c *Rcvr) AlarmRuleList(ctx context.Context, req *v1.AlarmRuleListRequest) (reply *v1.AlarmRuleListReply, err error) {
- t1 := func() error {
- reply, err = alarm.AlarmRuleList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 更新告警规则
- func (c *Rcvr) AlarmRuleUpdate(ctx context.Context, req *v1.AlarmRuleUpdateRequest) (reply *v1.AlarmRuleUpdateReply, err error) {
- t1 := func() error {
- reply, err = alarm.AlarmRuleUpdate(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 告警规则启停用
- func (c *Rcvr) AlarmRuleOnOff(ctx context.Context, req *v1.AlarmRuleOnOffRequest) (reply *v1.AlarmRuleOnOffReply, err error) {
- t1 := func() error {
- reply, err = alarm.AlarmRuleOnOff(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 添加告警联系人
- func (c *Rcvr) AlarmContactAdd(ctx context.Context, req *v1.AlarmContactAddRequest) (reply *v1.AlarmContactAddReply, err error) {
- t1 := func() error {
- reply, err = alarm.AlarmContactAdd(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 删除告警联系人
- func (c *Rcvr) AlarmContactDelete(ctx context.Context, req *v1.AlarmContactDeleteRequest) (reply *v1.AlarmContactDeleteReply, err error) {
- t1 := func() error {
- reply, err = alarm.AlarmContactDelete(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 编辑告警联系人
- func (c *Rcvr) AlarmContactUpdate(ctx context.Context, req *v1.AlarmContactUpdateRequest) (reply *v1.AlarmContactUpdateReply, err error) {
- t1 := func() error {
- reply, err = alarm.AlarmContactUpdate(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 告警联系人列表
- func (c *Rcvr) AlarmContactList(ctx context.Context, req *v1.AlarmContactListRequest) (reply *v1.AlarmContactListReply, err error) {
- t1 := func() error {
- reply, err = alarm.AlarmContactList(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)
- }
- // 历史塔吊数据
- func (c *Rcvr) TowerMonitorHistory(ctx context.Context, req *v1.TowerMonitorHistoryRequest) (reply *v1.TowerMonitorHistoryReply, err error) {
- t1 := func() error {
- reply, err = tower.TowerMonitorHistory(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 最近一次升降机数据
- func (c *Rcvr) LatestLiftMonitorData(ctx context.Context, req *v1.LatestLiftMonitorDataRequest) (reply *v1.LatestLiftMonitorDataReply, err error) {
- t1 := func() error {
- reply, err = lift.LatestLiftMonitorData(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 历史升降机数据
- func (c *Rcvr) LiftMonitorHistory(ctx context.Context, req *v1.LiftMonitorHistoryRequest) (reply *v1.LiftMonitorHistoryReply, err error) {
- t1 := func() error {
- reply, err = lift.LiftMonitorHistory(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 塔机基本属性
- func (c *Rcvr) TowerBaseInfoList(ctx context.Context, req *v1.TowerBaseInfoListRequest) (reply *v1.TowerBaseInfoListReply, err error) {
- t1 := func() error {
- reply, err = tower.TowerBaseInfoList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 添加参建单位
- func (c *Rcvr) ProjectCorpAdd(ctx context.Context, req *v1.ProjectCorpAddRequest) (reply *v1.ProjectCorpAddReply, err error) {
- t1 := func() error {
- reply, err = project.ProjectCorpAdd(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 删除参建单位
- func (c *Rcvr) ProjectCorpDel(ctx context.Context, req *v1.ProjectCorpDelRequest) (reply *v1.ProjectCorpDelReply, err error) {
- t1 := func() error {
- reply, err = project.ProjectCorpDel(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 更新参建单位
- func (c *Rcvr) ProjectCorpUpdate(ctx context.Context, req *v1.ProjectCorpUpdateRequest) (reply *v1.ProjectCorpUpdateReply, err error) {
- t1 := func() error {
- reply, err = project.ProjectCorpUpdate(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 参建单位列表
- func (c *Rcvr) ProjectCorpList(ctx context.Context, req *v1.ProjectCorpListRequest) (reply *v1.ProjectCorpListReply, err error) {
- t1 := func() error {
- reply, err = project.ProjectCorpList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 添加管理人员
- func (c *Rcvr) ProjectPMAdd(ctx context.Context, req *v1.ProjectPMAddRequest) (reply *v1.ProjectPMAddReply, err error) {
- t1 := func() error {
- reply, err = project.ProjectPMAdd(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 删除管理人员
- func (c *Rcvr) ProjectPMDel(ctx context.Context, req *v1.ProjectPMDelRequest) (reply *v1.ProjectPMDelReply, err error) {
- t1 := func() error {
- reply, err = project.ProjectPMDel(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 更新管理人员
- func (c *Rcvr) ProjectPMUpdate(ctx context.Context, req *v1.ProjectPMUpdateRequest) (reply *v1.ProjectPMUpdateReply, err error) {
- t1 := func() error {
- reply, err = project.ProjectPMUpdate(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 管理人员列表
- func (c *Rcvr) ProjectPMList(ctx context.Context, req *v1.ProjectPMListRequest) (reply *v1.ProjectPMListReply, err error) {
- t1 := func() error {
- reply, err = project.ProjectPMList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 行政区域列表
- func (c *Rcvr) AreaCodeList(ctx context.Context, req *v1.AreaCodeListRequest) (reply *v1.AreaCodeListReply, err error) {
- t1 := func() error {
- reply, err = project.AreaCodeList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) TaskList(ctx context.Context, req *v1.TaskListRequest) (reply *v1.TaskListReply, err error) {
- t1 := func() error {
- reply, err = task.TaskList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) TaskInfo(ctx context.Context, req *v1.TaskInfoRequest) (reply *v1.TaskInfoReply, err error) {
- t1 := func() error {
- reply, err = task.TaskInfo(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) TaskFinish(ctx context.Context, req *v1.TaskFinishRequest) (reply *v1.TaskFinishReply, err error) {
- t1 := func() error {
- reply, err = task.TaskFinish(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
|