// Copyright 2019 getensh.com. All rights reserved. // Use of this source code is governed by getensh.com. package impl import ( "context" "property-system/impl/v1/application" "property-system/impl/v1/department" "property-system/impl/v1/garden" "property-system/impl/v1/msg_package" "property-system/impl/v1/permission" "property-system/impl/v1/spackage" "property-system/impl/v1/user" "property-system/pb" pb_v1 "property-system/pb/v1" "git.getensh.com/common/gopkgs/tasker/rpctasker" "google.golang.org/grpc" ) // 具体实现 type Rcvr struct { } func Register(s *grpc.Server) { pb.RegisterSystemServer(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) PermissionReget(ctx context.Context, req *pb_v1.PermissionRegetRequest) (reply *pb_v1.PermissionRegetReply, err error) { t1 := func() error { reply, err = user.PermissionReget(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) GardenChangeCompany(ctx context.Context, req *pb_v1.GardenChangeCompanyRequest) (reply *pb_v1.GardenChangeCompanyReply, err error) { t1 := func() error { reply, err = garden.GardenChangeCompany(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) GardenRentSellCount(ctx context.Context, req *pb_v1.GardenRentSellCountRequest) (reply *pb_v1.GardenRentSellCountReply, err error) { t1 := func() error { reply, err = garden.GardenRentSellCount(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) GardenInfos(ctx context.Context, req *pb_v1.GardenInfosRequest) (reply *pb_v1.GardenInfosReply, err error) { t1 := func() error { reply, err = garden.GardenInfos(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) GardenIds(ctx context.Context, req *pb_v1.GardenIdsRequest) (reply *pb_v1.GardenIdsReply, err error) { t1 := func() error { reply, err = garden.GardenIds(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) GardenList(ctx context.Context, req *pb_v1.GardenListRequest) (reply *pb_v1.GardenListReply, err error) { t1 := func() error { reply, err = garden.GardenList(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) GardenAdd(ctx context.Context, req *pb_v1.GardenAddRequest) (reply *pb_v1.GardenAddReply, err error) { t1 := func() error { reply, err = garden.GardenAdd(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) GardenUpdate(ctx context.Context, req *pb_v1.GardenUpdateRequest) (reply *pb_v1.GardenUpdateReply, err error) { t1 := func() error { reply, err = garden.GardenUpdate(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) GardenDel(ctx context.Context, req *pb_v1.GardenDelRequest) (reply *pb_v1.GardenDelReply, err error) { t1 := func() error { reply, err = garden.GardenDel(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) GardenKeyInfoChange(ctx context.Context, req *pb_v1.GardenKeyInfoChangeRequest) (reply *pb_v1.GardenKeyInfoChangeReply, err error) { t1 := func() error { reply, err = garden.GardenKeyInfoChange(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) GardenKeyInfoApprove(ctx context.Context, req *pb_v1.GardenKeyInfoApproveRequest) (reply *pb_v1.GardenKeyInfoApproveReply, err error) { t1 := func() error { reply, err = garden.GardenKeyInfoApprove(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) GardenKeyInfoChangeList(ctx context.Context, req *pb_v1.GardenKeyInfoChangeListRequest) (reply *pb_v1.GardenKeyInfoChangeListReply, err error) { t1 := func() error { reply, err = garden.GardenKeyInfoChangeList(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) GardenApprove(ctx context.Context, req *pb_v1.GardenApproveRequest) (reply *pb_v1.GardenApproveReply, err error) { t1 := func() error { reply, err = garden.GardenApprove(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) GardenEnableSet(ctx context.Context, req *pb_v1.GardenEnableSetRequest) (reply *pb_v1.GardenEnableSetReply, err error) { t1 := func() error { reply, err = garden.GardenEnableSet(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } // 设置小区支付商户号 func (c *Rcvr) GardenSetMch(ctx context.Context, req *pb_v1.GardenSetMchRequest) (reply *pb_v1.GardenSetMchReply, err error) { t1 := func() error { reply, err = garden.GardenSetMch(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) GardenHouseCountLimit(ctx context.Context, req *pb_v1.GardenHouseCountLimitRequest) (reply *pb_v1.GardenHouseCountLimitReply, err error) { t1 := func() error { reply, err = garden.GardenHouseCountLimit(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) GardenHouseCountChange(ctx context.Context, req *pb_v1.GardenHouseCountChangeRequest) (reply *pb_v1.GardenHouseCountChangeReply, err error) { t1 := func() error { reply, err = garden.GardenHouseCountChange(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } // 设置小区支付模式 func (c *Rcvr) GardenSetMchPayMode(ctx context.Context, req *pb_v1.GardenSetMchPayModeRequest) (reply *pb_v1.GardenSetMchPayModeReply, err error) { t1 := func() error { reply, err = garden.GardenSetMchPayMode(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } // 获取公司下的小区支付模式信息 func (c *Rcvr) CompanyMchGardenList(ctx context.Context, req *pb_v1.CompanyMchGardenListRequest) (reply *pb_v1.CompanyMchGardenListReply, err error) { t1 := func() error { reply, err = garden.CompanyMchGardenList(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) CompanyEnterGarden(ctx context.Context, req *pb_v1.CompanyEnterGardenRequest) (reply *pb_v1.CompanyEnterGardenReply, err error) { t1 := func() error { reply, err = user.CompanyEnterGarden(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) UserAdd(ctx context.Context, req *pb_v1.UserAddRequest) (reply *pb_v1.UserAddReply, err error) { t1 := func() error { reply, err = user.UserAdd(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) UserDel(ctx context.Context, req *pb_v1.UserDelRequest) (reply *pb_v1.UserDelReply, err error) { t1 := func() error { reply, err = user.UserDel(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) UserUpdate(ctx context.Context, req *pb_v1.UserUpdateRequest) (reply *pb_v1.UserUpdateReply, err error) { t1 := func() error { reply, err = user.UserUpdate(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) UserList(ctx context.Context, req *pb_v1.UserListRequest) (reply *pb_v1.UserListReply, err error) { t1 := func() error { reply, err = user.UserList(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) UserGardenChange(ctx context.Context, req *pb_v1.UserGardenChangeRequest) (reply *pb_v1.UserGardenChangeReply, err error) { t1 := func() error { reply, err = user.UserGardenChange(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) GroupAdd(ctx context.Context, req *pb_v1.GroupAddRequest) (reply *pb_v1.GroupAddReply, err error) { t1 := func() error { reply, err = permission.GroupAdd(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) GroupDel(ctx context.Context, req *pb_v1.GroupDelRequest) (reply *pb_v1.GroupDelReply, err error) { t1 := func() error { reply, err = permission.GroupDel(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) GroupUpdate(ctx context.Context, req *pb_v1.GroupUpdateRequest) (reply *pb_v1.GroupUpdateReply, err error) { t1 := func() error { reply, err = permission.GroupUpdate(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) GardenPermissionList(ctx context.Context, req *pb_v1.GardenPermissionListRequest) (reply *pb_v1.GardenPermissionListReply, err error) { t1 := func() error { reply, err = permission.GardenPermissionList(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) GroupList(ctx context.Context, req *pb_v1.GroupListRequest) (reply *pb_v1.GroupListReply, err error) { t1 := func() error { reply, err = permission.GroupList(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) GroupInfo(ctx context.Context, req *pb_v1.GroupInfoRequest) (reply *pb_v1.GroupInfoReply, err error) { t1 := func() error { reply, err = permission.GroupInfo(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) SuperGroup(ctx context.Context, req *pb_v1.SuperGroupRequest) (reply *pb_v1.SuperGroupReply, err error) { t1 := func() error { reply, err = permission.SuperGroup(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) DepartmentAdd(ctx context.Context, req *pb_v1.DepartmentAddRequest) (reply *pb_v1.DepartmentAddReply, err error) { t1 := func() error { reply, err = department.DepartmentAdd(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) DepartmentDel(ctx context.Context, req *pb_v1.DepartmentDelRequest) (reply *pb_v1.DepartmentDelReply, err error) { t1 := func() error { reply, err = department.DepartmentDel(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) DepartmentUpdate(ctx context.Context, req *pb_v1.DepartmentUpdateRequest) (reply *pb_v1.DepartmentUpdateReply, err error) { t1 := func() error { reply, err = department.DepartmentUpdate(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) DepartmentList(ctx context.Context, req *pb_v1.DepartmentListRequest) (reply *pb_v1.DepartmentListReply, err error) { t1 := func() error { reply, err = department.DepartmentList(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } // 应用相关 func (c *Rcvr) ApplicationOrderAdd(ctx context.Context, req *pb_v1.ApplicationOrderAddRequest) (reply *pb_v1.ApplicationOrderAddReply, err error) { t1 := func() error { reply, err = application.ApplicationOrderAdd(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) ApplicationOrderApprove(ctx context.Context, req *pb_v1.ApplicationOrderApproveRequest) (reply *pb_v1.ApplicationOrderApproveReply, err error) { t1 := func() error { reply, err = application.ApplicationOrderApprove(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) ApplicationOrderAmount(ctx context.Context, req *pb_v1.ApplicationOrderAmountRequest) (reply *pb_v1.ApplicationOrderAmountReply, err error) { t1 := func() error { reply, err = application.ApplicationOrderAmount(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) GardenApplicationList(ctx context.Context, req *pb_v1.GardenApplicationListRequest) (reply *pb_v1.GardenApplicationListReply, err error) { t1 := func() error { reply, err = application.GardenApplicationList(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } // 套餐相关 func (c *Rcvr) PackageOrderAdd(ctx context.Context, req *pb_v1.PackageOrderAddRequest) (reply *pb_v1.PackageOrderAddReply, err error) { t1 := func() error { reply, err = spackage.PackageOrderAdd(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) PackageOrderApprove(ctx context.Context, req *pb_v1.PackageOrderApproveRequest) (reply *pb_v1.PackageOrderApproveReply, err error) { t1 := func() error { reply, err = spackage.PackageOrderApprove(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) PackageOrderAmount(ctx context.Context, req *pb_v1.PackageOrderAmountRequest) (reply *pb_v1.PackageOrderAmountReply, err error) { t1 := func() error { reply, err = spackage.PackageOrderAmount(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) CompanyPackageList(ctx context.Context, req *pb_v1.CompanyPackageListRequest) (reply *pb_v1.CompanyPackageListReply, err error) { t1 := func() error { reply, err = spackage.CompanyPackageList(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } // 短信套餐相关 func (c *Rcvr) MsgPackageOrderAdd(ctx context.Context, req *pb_v1.MsgPackageOrderAddRequest) (reply *pb_v1.MsgPackageOrderAddReply, err error) { t1 := func() error { reply, err = msg_package.MsgPackageOrderAdd(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) MsgPackageOrderApprove(ctx context.Context, req *pb_v1.MsgPackageOrderApproveRequest) (reply *pb_v1.MsgPackageOrderApproveReply, err error) { t1 := func() error { reply, err = msg_package.MsgPackageOrderApprove(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) MsgPackageOrderDecrease(ctx context.Context, req *pb_v1.MsgPackageOrderDecreaseRequest) (reply *pb_v1.MsgPackageOrderDecreaseReply, err error) { t1 := func() error { reply, err = msg_package.MsgPackageOrderDecrease(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) } func (c *Rcvr) MsgPackageOrderList(ctx context.Context, req *pb_v1.MsgPackageOrderListRequest) (reply *pb_v1.MsgPackageOrderListReply, err error) { t1 := func() error { reply, err = msg_package.MsgPackageOrderList(ctx, req) return err } return reply, rpctasker.Exec(ctx, t1) }