123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513 |
- // 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)
- }
|