123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- // Copyright 2019 github.com. All rights reserved.
- // Use of this source code is governed by github.com.
- package impl
- import (
- "context"
- "smart-provincial/impl/v1/provincial_department"
- "smart-provincial/pb"
- pb_v1 "smart-provincial/pb/v1"
- "github.com/jaryhe/gopkgs/tasker/rpctasker"
- "google.golang.org/grpc"
- )
- // 具体实现
- type Rcvr struct {
- }
- func Register(s *grpc.Server) {
- pb.RegisterSmartProvincialServer(s, &Rcvr{})
- }
- // 省厅获取项目编码
- func (c *Rcvr) ProvincialGetProjectCode(ctx context.Context, req *pb_v1.ProvincialGetProjectCodeRequest) (reply *pb_v1.ProvincialGetProjectCodeReply, err error) {
- t1 := func() error {
- reply, err = provincial_department.ProvincialGetProjectCode(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 提交项目信息
- func (c *Rcvr) ProvincialPostProject(ctx context.Context, req *pb_v1.ProvincialPostProjectRequest) (reply *pb_v1.ProvincialPostProjectReply, err error) {
- t1 := func() error {
- reply, err = provincial_department.ProvincialPostProject(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 提交扬尘设备信息
- func (c *Rcvr) ProvincialPostDustDevice(ctx context.Context, req *pb_v1.ProvincialPostDustDeviceRequest) (reply *pb_v1.ProvincialPostDustDeviceReply, err error) {
- t1 := func() error {
- reply, err = provincial_department.ProvincialPostDustDevice(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 提交扬尘监测数据
- func (c *Rcvr) ProvincialPostDustData(ctx context.Context, req *pb_v1.ProvincialPostDustDataRequest) (reply *pb_v1.ProvincialPostDustDataReply, err error) {
- t1 := func() error {
- reply, err = provincial_department.ProvincialPostDustData(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) ProvincialVerifyData(ctx context.Context, req *pb_v1.ProvincialVerifyDataRequest) (reply *pb_v1.ProvincialVerifyDataReply, err error) {
- t1 := func() error {
- reply, err = provincial_department.ProvincialVerifyData(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) ProvincialPostTeam(ctx context.Context, req *pb_v1.ProvincialPostTeamRequest) (reply *pb_v1.ProvincialPostTeamReply, err error) {
- t1 := func() error {
- reply, err = provincial_department.ProvincialPostTeam(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) ProvincialPostStaff(ctx context.Context, req *pb_v1.ProvincialPostStaffRequest) (reply *pb_v1.ProvincialPostStaffReply, err error) {
- t1 := func() error {
- reply, err = provincial_department.ProvincialPostStaff(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) ProvincialPostStaffAttendance(ctx context.Context, req *pb_v1.ProvincialPostStaffAttendanceRequest) (reply *pb_v1.ProvincialPostStaffAttendanceReply, err error) {
- t1 := func() error {
- reply, err = provincial_department.ProvincialPostStaffAttendance(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
|