123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369 |
- // Copyright 2019 getensh.com. All rights reserved.
- // Use of this source code is governed by getensh.com.
- package impl
- import (
- "context"
- "property-common/impl/v1/application"
- "property-common/impl/v1/area"
- "property-common/impl/v1/cpackage"
- "property-common/impl/v1/material"
- "property-common/impl/v1/msg_package"
- "property-common/impl/v1/oss_obj"
- "property-common/impl/v1/system_permission"
- "property-common/pb"
- pb_v1 "property-common/pb/v1"
- "git.getensh.com/common/gopkgs/tasker/rpctasker"
- "google.golang.org/grpc"
- )
- // 具体实现
- type Rcvr struct {
- }
- func Register(s *grpc.Server) {
- pb.RegisterCommonServer(s, &Rcvr{})
- }
- //
- func (c *Rcvr) SystemPermissionList(ctx context.Context, req *pb_v1.SystemPermissionListRequest) (reply *pb_v1.SystemPermissionListReply, err error) {
- t1 := func() error {
- reply, err = system_permission.SystemPermissionList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) SystemPermissionsNotTree(ctx context.Context, req *pb_v1.SystemPermissionsNotTreeRequest) (reply *pb_v1.SystemPermissionsNotTreeReply, err error) {
- t1 := func() error {
- reply, err = system_permission.SystemPermissionsNotTree(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) SystemPermissionAdd(ctx context.Context, req *pb_v1.SystemPermissionAddRequest) (reply *pb_v1.SystemPermissionAddReply, err error) {
- t1 := func() error {
- reply, err = system_permission.SystemPermissionAdd(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) SystemPermissionDel(ctx context.Context, req *pb_v1.SystemPermissionDelRequest) (reply *pb_v1.SystemPermissionDelReply, err error) {
- t1 := func() error {
- reply, err = system_permission.SystemPermissionDel(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) SystemPermissionEnable(ctx context.Context, req *pb_v1.SystemPermissionEnableRequest) (reply *pb_v1.SystemPermissionEnableReply, err error) {
- t1 := func() error {
- reply, err = system_permission.SystemPermissionEnable(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) SystemPermissionUpdate(ctx context.Context, req *pb_v1.SystemPermissionUpdateRequest) (reply *pb_v1.SystemPermissionUpdateReply, err error) {
- t1 := func() error {
- reply, err = system_permission.SystemPermissionUpdate(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 省市区
- func (c *Rcvr) ProvinceCityArea(ctx context.Context, req *pb_v1.ProvinceCityAreaRequest) (reply *pb_v1.ProvinceCityAreaReply, err error) {
- t1 := func() error {
- reply, err = area.ProvinceCityArea(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) City(ctx context.Context, req *pb_v1.CityRequest) (reply *pb_v1.CityReply, err error) {
- t1 := func() error {
- reply, err = area.City(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 街道社区
- func (c *Rcvr) StreetCommittee(ctx context.Context, req *pb_v1.StreetCommitteeRequest) (reply *pb_v1.StreetCommitteeReply, err error) {
- t1 := func() error {
- reply, err = area.StreetCommittee(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 对象存储删除无用的数据
- func (c *Rcvr) OssObjDelNotExist(ctx context.Context, req *pb_v1.OssObjDelNotExistRequest) (reply *pb_v1.OssObjDelNotExistReply, err error) {
- t1 := func() error {
- reply, err = oss_obj.OssObjDelNotExist(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 对象存储添加到公共区
- func (c *Rcvr) OssObjAdd(ctx context.Context, req *pb_v1.OssObjAddRequest) (reply *pb_v1.OssObjAddReply, err error) {
- t1 := func() error {
- reply, err = oss_obj.OssObjAdd(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 应用
- func (c *Rcvr) ApplicationAdd(ctx context.Context, req *pb_v1.ApplicationAddRequest) (reply *pb_v1.ApplicationAddReply, err error) {
- t1 := func() error {
- reply, err = application.ApplicationAdd(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) ApplicationDel(ctx context.Context, req *pb_v1.ApplicationDelRequest) (reply *pb_v1.ApplicationDelReply, err error) {
- t1 := func() error {
- reply, err = application.ApplicationDel(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) ApplicationUpdate(ctx context.Context, req *pb_v1.ApplicationUpdateRequest) (reply *pb_v1.ApplicationUpdateReply, err error) {
- t1 := func() error {
- reply, err = application.ApplicationUpdate(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) ApplicationList(ctx context.Context, req *pb_v1.ApplicationListRequest) (reply *pb_v1.ApplicationListReply, err error) {
- t1 := func() error {
- reply, err = application.ApplicationList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) ApplicationEnableSet(ctx context.Context, req *pb_v1.ApplicationEnableSetRequest) (reply *pb_v1.ApplicationEnableSetReply, err error) {
- t1 := func() error {
- reply, err = application.ApplicationEnableSet(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) ApplicationPermissionsSet(ctx context.Context, req *pb_v1.ApplicationPermissionsSetRequest) (reply *pb_v1.ApplicationPermissionsSetReply, err error) {
- t1 := func() error {
- reply, err = application.ApplicationPermissionsSet(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) ApplicationPermissions(ctx context.Context, req *pb_v1.ApplicationPermissionsRequest) (reply *pb_v1.ApplicationPermissionsReply, err error) {
- t1 := func() error {
- reply, err = application.ApplicationPermissions(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) ApplicationInfo(ctx context.Context, req *pb_v1.ApplicationInfoRequest) (reply *pb_v1.ApplicationInfoReply, err error) {
- t1 := func() error {
- reply, err = application.ApplicationInfo(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 套餐
- func (c *Rcvr) PackageAdd(ctx context.Context, req *pb_v1.PackageAddRequest) (reply *pb_v1.PackageAddReply, err error) {
- t1 := func() error {
- reply, err = cpackage.PackageAdd(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) PackageDel(ctx context.Context, req *pb_v1.PackageDelRequest) (reply *pb_v1.PackageDelReply, err error) {
- t1 := func() error {
- reply, err = cpackage.PackageDel(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) PackageUpdate(ctx context.Context, req *pb_v1.PackageUpdateRequest) (reply *pb_v1.PackageUpdateReply, err error) {
- t1 := func() error {
- reply, err = cpackage.PackageUpdate(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) PackageList(ctx context.Context, req *pb_v1.PackageListRequest) (reply *pb_v1.PackageListReply, err error) {
- t1 := func() error {
- reply, err = cpackage.PackageList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) PackageEnableSet(ctx context.Context, req *pb_v1.PackageEnableSetRequest) (reply *pb_v1.PackageEnableSetReply, err error) {
- t1 := func() error {
- reply, err = cpackage.PackageEnableSet(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) PackageApplicationSet(ctx context.Context, req *pb_v1.PackageApplicationSetRequest) (reply *pb_v1.PackageApplicationSetReply, err error) {
- t1 := func() error {
- reply, err = cpackage.PackageApplicationSet(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) PackageInfo(ctx context.Context, req *pb_v1.PackageInfoRequest) (reply *pb_v1.PackageInfoReply, err error) {
- t1 := func() error {
- reply, err = cpackage.PackageInfo(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- // 短信套餐
- func (c *Rcvr) MsgPackageAdd(ctx context.Context, req *pb_v1.MsgPackageAddRequest) (reply *pb_v1.MsgPackageAddReply, err error) {
- t1 := func() error {
- reply, err = msg_package.MsgPackageAdd(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) MsgPackageDel(ctx context.Context, req *pb_v1.MsgPackageDelRequest) (reply *pb_v1.MsgPackageDelReply, err error) {
- t1 := func() error {
- reply, err = msg_package.MsgPackageDel(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) MsgPackageUpdate(ctx context.Context, req *pb_v1.MsgPackageUpdateRequest) (reply *pb_v1.MsgPackageUpdateReply, err error) {
- t1 := func() error {
- reply, err = msg_package.MsgPackageUpdate(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) MsgPackageList(ctx context.Context, req *pb_v1.MsgPackageListRequest) (reply *pb_v1.MsgPackageListReply, err error) {
- t1 := func() error {
- reply, err = msg_package.MsgPackageList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) MsgPackageInfo(ctx context.Context, req *pb_v1.MsgPackageInfoRequest) (reply *pb_v1.MsgPackageInfoReply, err error) {
- t1 := func() error {
- reply, err = msg_package.MsgPackageInfo(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) MaterialList(ctx context.Context, req *pb_v1.MaterialListRequest) (reply *pb_v1.MaterialListReply, err error) {
- t1 := func() error {
- reply, err = material.MaterialList(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) MaterialAdd(ctx context.Context, req *pb_v1.MaterialAddRequest) (reply *pb_v1.MaterialAddReply, err error) {
- t1 := func() error {
- reply, err = material.MaterialAdd(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) MaterialDel(ctx context.Context, req *pb_v1.MaterialDelRequest) (reply *pb_v1.MaterialDelReply, err error) {
- t1 := func() error {
- reply, err = material.MaterialDel(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) MaterialEnable(ctx context.Context, req *pb_v1.MaterialEnableRequest) (reply *pb_v1.MaterialEnableReply, err error) {
- t1 := func() error {
- reply, err = material.MaterialEnable(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) MaterialUpdate(ctx context.Context, req *pb_v1.MaterialUpdateRequest) (reply *pb_v1.MaterialUpdateReply, err error) {
- t1 := func() error {
- reply, err = material.MaterialUpdate(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
- func (c *Rcvr) MaterialInfo(ctx context.Context, req *pb_v1.MaterialInfoRequest) (reply *pb_v1.MaterialInfoReply, err error) {
- t1 := func() error {
- reply, err = material.MaterialInfo(ctx, req)
- return err
- }
- return reply, rpctasker.Exec(ctx, t1)
- }
|