// Copyright 2019 getensh.com. All rights reserved. // Use of this source code is governed by getensh.com. package impl import ( "context" "property-company/impl/v1/company" "property-company/impl/v1/garden" "property-company/impl/v1/statistic" "property-company/impl/v1/user" "property-company/pb" pb_v1 "property-company/pb/v1" "git.getensh.com/common/gopkgs/tasker/rpctasker" "google.golang.org/grpc" ) // 具体实现 type Rcvr struct { } func Register(s *grpc.Server) { pb.RegisterCompanyServer(s, &Rcvr{}) } // func (c *Rcvr) Login(ctx context.Context, req *pb_v1.LoginRequest) (reply *pb_v1.LoginReply, err error) { t1 := func() error { reply, err = user.Login(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) Register(ctx context.Context, req *pb_v1.RegisterRequest) (reply *pb_v1.RegisterReply, err error) { t1 := func() error { reply, err = company.Register(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) LoginByPhone(ctx context.Context, req *pb_v1.LoginByPhoneRequest) (reply *pb_v1.LoginByPhoneReply, err error) { t1 := func() error { reply, err = user.LoginByPhone(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) CheckPhone(ctx context.Context, req *pb_v1.CheckPhoneRequest) (reply *pb_v1.CheckPhoneReply, err error) { t1 := func() error { reply, err = user.CheckPhone(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } // 忘记密码重置密码 func (c *Rcvr) ResetPassword(ctx context.Context, req *pb_v1.ResetPasswordRequest) (reply *pb_v1.ResetPasswordReply, err error) { t1 := func() error { reply, err = user.ResetPassword(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } // 登录后修改密码 func (c *Rcvr) ChangePassword(ctx context.Context, req *pb_v1.ChangePasswordRequest) (reply *pb_v1.ChangePasswordReply, err error) { t1 := func() error { reply, err = user.ChangePassword(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) CompanyApprove(ctx context.Context, req *pb_v1.CompanyApproveRequest) (reply *pb_v1.CompanyApproveReply, err error) { t1 := func() error { reply, err = company.CompanyApprove(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) CompanyInfo(ctx context.Context, req *pb_v1.CompanyInfoRequest) (reply *pb_v1.CompanyInfoReply, err error) { t1 := func() error { reply, err = company.CompanyInfo(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) CompanyUpdate(ctx context.Context, req *pb_v1.CompanyUpdateRequest) (reply *pb_v1.CompanyUpdateReply, err error) { t1 := func() error { reply, err = company.CompanyUpdate(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) CompanyList(ctx context.Context, req *pb_v1.CompanyListRequest) (reply *pb_v1.CompanyListReply, err error) { t1 := func() error { reply, err = company.CompanyList(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } // 设置商户号 func (c *Rcvr) CompanyMchIdSet(ctx context.Context, req *pb_v1.CompanyMchIdSetRequest) (reply *pb_v1.CompanyMchIdSetReply, err error) { t1 := func() error { reply, err = company.CompanyMchIdSet(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } // 设置支付方式 仅线下/支付到公司账户/支付到软件系统提供商账户 func (c *Rcvr) CompanyPayModel(ctx context.Context, req *pb_v1.CompanyPayModelRequest) (reply *pb_v1.CompanyPayModelReply, err error) { t1 := func() error { reply, err = company.CompanyPayModel(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } // 微信商户申请 func (c *Rcvr) CompanyWxAccountApply(ctx context.Context, req *pb_v1.CompanyWxAccountApplyRequest) (reply *pb_v1.CompanyWxAccountApplyReply, err error) { t1 := func() error { reply, err = company.CompanyWxAccountApply(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } // 微信商户申请资料 func (c *Rcvr) CompanyWxAccountApplyInfo(ctx context.Context, req *pb_v1.CompanyWxAccountApplyInfoRequest) (reply *pb_v1.CompanyWxAccountApplyInfoReply, err error) { t1 := func() error { reply, err = company.CompanyWxAccountApplyInfo(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } // 微信商户申请列表 func (c *Rcvr) CompanyWxAccountApplyList(ctx context.Context, req *pb_v1.CompanyWxAccountApplyListRequest) (reply *pb_v1.CompanyWxAccountApplyListReply, err error) { t1 := func() error { reply, err = company.CompanyWxAccountApplyList(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) CompanyChangeFreeGarden(ctx context.Context, req *pb_v1.CompanyChangeFreeGardenRequest) (reply *pb_v1.CompanyChangeFreeGardenReply, err error) { t1 := func() error { reply, err = company.CompanyChangeFreeGarden(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) CompanyAddGarden(ctx context.Context, req *pb_v1.CompanyAddGardenRequest) (reply *pb_v1.CompanyAddGardenReply, err error) { t1 := func() error { reply, err = garden.CompanyAddGarden(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) CompanyGardenDecrease(ctx context.Context, req *pb_v1.CompanyGardenDecreaseRequest) (reply *pb_v1.CompanyGardenDecreaseReply, err error) { t1 := func() error { reply, err = garden.CompanyGardenDecrease(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } // 检查是否可以新增小区 func (c *Rcvr) CompanyCanAddGarden(ctx context.Context, req *pb_v1.CompanyCanAddGardenRequest) (reply *pb_v1.CompanyCanAddGardenReply, err error) { t1 := func() error { reply, err = garden.CompanyCanAddGarden(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) CompanyUserAdd(ctx context.Context, req *pb_v1.CompanyUserAddRequest) (reply *pb_v1.CompanyUserAddReply, err error) { t1 := func() error { reply, err = user.CompanyUserAdd(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) CompanyUserDel(ctx context.Context, req *pb_v1.CompanyUserDelRequest) (reply *pb_v1.CompanyUserDelReply, err error) { t1 := func() error { reply, err = user.CompanyUserDel(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) CompanyUserUpdate(ctx context.Context, req *pb_v1.CompanyUserUpdateRequest) (reply *pb_v1.CompanyUserUpdateReply, err error) { t1 := func() error { reply, err = user.CompanyUserUpdate(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) CompanyUserList(ctx context.Context, req *pb_v1.CompanyUserListRequest) (reply *pb_v1.CompanyUserListReply, err error) { t1 := func() error { reply, err = user.CompanyUserList(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) CompanyStatistic(ctx context.Context, req *pb_v1.CompanyStatisticRequest) (reply *pb_v1.CompanyStatisticReply, err error) { t1 := func() error { reply, err = statistic.CompanyStatistic(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) CompanyObjStatisticSet(ctx context.Context, req *pb_v1.CompanyObjStatisticSetRequest) (reply *pb_v1.CompanyObjStatisticSetReply, err error) { t1 := func() error { reply, err = statistic.CompanyObjStatisticSet(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) CompanyDealStatisticSet(ctx context.Context, req *pb_v1.CompanyDealStatisticSetRequest) (reply *pb_v1.CompanyDealStatisticSetReply, err error) { t1 := func() error { reply, err = statistic.CompanyDealStatisticSet(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) }