diff --git a/cmd/open_im_api/main.go b/cmd/open_im_api/main.go index eb2e13850..2622bdfdf 100644 --- a/cmd/open_im_api/main.go +++ b/cmd/open_im_api/main.go @@ -214,32 +214,7 @@ func main() { officeGroup.POST("/delete_comment", office.DeleteComment) } // - organizationGroup := r.Group("/organization") - { - organizationGroup.POST("/create_department", organization.CreateDepartment) - organizationGroup.POST("/update_department", organization.UpdateDepartment) - organizationGroup.POST("/get_sub_department", organization.GetSubDepartment) - organizationGroup.POST("/delete_department", organization.DeleteDepartment) - organizationGroup.POST("/get_all_department", organization.GetAllDepartment) - organizationGroup.POST("/create_organization_user", organization.CreateOrganizationUser) - organizationGroup.POST("/update_organization_user", organization.UpdateOrganizationUser) - organizationGroup.POST("/delete_organization_user", organization.DeleteOrganizationUser) - - organizationGroup.POST("/create_department_member", organization.CreateDepartmentMember) - organizationGroup.POST("/get_user_in_department", organization.GetUserInDepartment) - organizationGroup.POST("/update_user_in_department", organization.UpdateUserInDepartment) - - organizationGroup.POST("/get_department_member", organization.GetDepartmentMember) - organizationGroup.POST("/delete_user_in_department", organization.DeleteUserInDepartment) - organizationGroup.POST("/get_user_in_organization", organization.GetUserInOrganization) - } - // - initGroup := r.Group("/init") - { - initGroup.POST("/set_client_config", clientInit.SetClientInitConfig) - initGroup.POST("/get_client_config", clientInit.GetClientInitConfig) - } go utils.RegisterConf() go apiThird.MinioInit() defaultPorts := config.Config.Api.GinPort diff --git a/cmd/open_im_demo/main.go b/cmd/open_im_demo/main.go index 56d76a7b7..945c586d2 100644 --- a/cmd/open_im_demo/main.go +++ b/cmd/open_im_demo/main.go @@ -35,7 +35,6 @@ func main() { authRouterGroup.POST("/password", register.SetPassword) authRouterGroup.POST("/login", register.Login) authRouterGroup.POST("/reset_password", register.ResetPassword) - authRouterGroup.POST("/check_login", register.CheckLoginLimit) } demoRouterGroup := r.Group("/auth") { @@ -44,24 +43,8 @@ func main() { demoRouterGroup.POST("/password", register.SetPassword) demoRouterGroup.POST("/login", register.Login) demoRouterGroup.POST("/reset_password", register.ResetPassword) - demoRouterGroup.POST("/check_login", register.CheckLoginLimit) } - //deprecated - cmsRouterGroup := r.Group("/cms_admin") - { - cmsRouterGroup.POST("/generate_invitation_code", register.GenerateInvitationCode) - cmsRouterGroup.POST("/query_invitation_code", register.QueryInvitationCode) - cmsRouterGroup.POST("/get_invitation_codes", register.GetInvitationCodes) - - cmsRouterGroup.POST("/query_user_ip_limit_login", register.QueryUserIDLimitLogin) - cmsRouterGroup.POST("/add_user_ip_limit_login", register.AddUserIPLimitLogin) - cmsRouterGroup.POST("/remove_user_ip_limit_login", register.RemoveUserIPLimitLogin) - - cmsRouterGroup.POST("/query_ip_register", register.QueryIPRegister) - cmsRouterGroup.POST("/add_ip_limit", register.AddIPLimit) - cmsRouterGroup.POST("/remove_ip_Limit", register.RemoveIPLimit) - } defaultPorts := config.Config.Demo.Port ginPort := flag.Int("port", defaultPorts[0], "get ginServerPort from cmd,default 10004 as port") flag.Parse() @@ -71,7 +54,6 @@ func main() { } address = config.Config.CmsApi.ListenIP + ":" + strconv.Itoa(*ginPort) fmt.Println("start demo api server address: ", address, ", OpenIM version: ", constant.CurrentVersion, "\n") - go register.OnboardingProcessRoutine() go register.ImportFriendRoutine() err := r.Run(address) if err != nil { diff --git a/cmd/rpc/open_im_organization/Makefile b/cmd/rpc/open_im_organization/Makefile deleted file mode 100644 index 77d658db9..000000000 --- a/cmd/rpc/open_im_organization/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -.PHONY: all build run gotool install clean help - -BINARY_NAME=open_im_organization -BIN_DIR=../../../bin/ - -all: gotool build - -build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" - -run: - @go run ./ - -gotool: - go fmt ./ - go vet ./ - -install: - make build - mv ${BINARY_NAME} ${BIN_DIR} - -clean: - @if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi - - diff --git a/cmd/rpc/open_im_organization/main.go b/cmd/rpc/open_im_organization/main.go deleted file mode 100644 index 1de97bfcb..000000000 --- a/cmd/rpc/open_im_organization/main.go +++ /dev/null @@ -1,26 +0,0 @@ -package main - -import ( - "Open_IM/internal/rpc/organization" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/constant" - promePkg "Open_IM/pkg/common/prometheus" - "flag" - "fmt" -) - -func main() { - defaultPorts := config.Config.RpcPort.OpenImOrganizationPort - rpcPort := flag.Int("port", defaultPorts[0], "get RpcOrganizationPort from cmd,default 11200 as port") - prometheusPort := flag.Int("prometheus_port", config.Config.Prometheus.OrganizationPrometheusPort[0], "organizationPrometheusPort default listen port") - flag.Parse() - fmt.Println("start organization rpc server, port: ", *rpcPort, ", OpenIM version: ", constant.CurrentVersion, "\n") - rpcServer := organization.NewServer(*rpcPort) - go func() { - err := promePkg.StartPromeSrv(*prometheusPort) - if err != nil { - panic(err) - } - }() - rpcServer.Run() -} diff --git a/cmd/test/main.go b/cmd/test/main.go deleted file mode 100644 index 87d5165f7..000000000 --- a/cmd/test/main.go +++ /dev/null @@ -1,69 +0,0 @@ -package main - -import ( - "Open_IM/pkg/utils" - "context" - "fmt" - "go.mongodb.org/mongo-driver/bson" - "go.mongodb.org/mongo-driver/mongo" - "go.mongodb.org/mongo-driver/mongo/options" - "time" -) - -type MongoMsg struct { - UID string - Msg []string -} - - -func main() { - //"mongodb://%s:%s@%s/%s/?maxPoolSize=%d" - uri := "mongodb://user:pass@sample.host:27017/?maxPoolSize=20&w=majority" - DBAddress := "127.0.0.1:37017" - DBDatabase := "new-test-db" - Collection := "new-test-collection" - DBMaxPoolSize := 100 - uri = fmt.Sprintf("mongodb://%s/%s/?maxPoolSize=%d", - DBAddress,DBDatabase, - DBMaxPoolSize) - - mongoClient, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(uri)) - if err != nil { - panic(err) - } - filter := bson.M{"uid":"my_uid"} - ctx, _ := context.WithTimeout(context.Background(), 30*time.Second) - for i:=0; i < 2; i++{ - - if err = mongoClient.Database(DBDatabase).Collection(Collection).FindOneAndUpdate(ctx, filter, - bson.M{"$push": bson.M{"msg": utils.Int32ToString(int32(i))}}).Err(); err != nil{ - fmt.Println("FindOneAndUpdate failed ", i, ) - var mmsg MongoMsg - mmsg.UID = "my_uid" - mmsg.Msg = append(mmsg.Msg, utils.Int32ToString(int32(i))) - _, err := mongoClient.Database(DBDatabase).Collection(Collection).InsertOne(ctx, &mmsg) - if err != nil { - fmt.Println("insertone failed ", err.Error(), i) - } else{ - fmt.Println("insertone ok ", i) - } - - }else { - fmt.Println("FindOneAndUpdate ok ", i) - } - - } - - var mmsg MongoMsg - - if err = mongoClient.Database(DBDatabase).Collection(Collection).FindOne(ctx, filter).Decode(&mmsg); err != nil { - fmt.Println("findone failed ", err.Error()) - }else{ - fmt.Println("findone ok ", mmsg.UID) - for i, v:=range mmsg.Msg{ - fmt.Println("find value: ", i, v) - } - } - - -} diff --git a/config/config.yaml b/config/config.yaml index 61aadf2b3..9499c99a0 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -162,7 +162,6 @@ rpcport: #rpc服务端口 默认即可 openImPushPort: [ 10170 ] openImAdminCmsPort: [ 10200 ] openImOfficePort: [ 10210 ] - openImOrganizationPort: [ 10220 ] openImConversationPort: [ 10230 ] openImCachePort: [ 10240 ] openImRealTimeCommPort: [ 11300 ] @@ -186,7 +185,6 @@ rpcregistername: #rpc注册服务名,默认即可 openImAuthName: Auth openImAdminCMSName: AdminCMS openImOfficeName: Office - openImOrganizationName: Organization openImConversationName: Conversation openImCacheName: Cache openImRealTimeCommName: RealTimeComm @@ -554,19 +552,6 @@ notification: tips: "group member info set" - organizationChanged: - conversation: - reliabilityLevel: 2 - unreadCount: false - offlinePush: - switch: false - title: "organizationChanged title" - desc: "organizationChanged desc" - ext: "organizationChanged ext" - defaultTips: - tips: "organization changed" - - #############################friend################################# @@ -743,18 +728,6 @@ notification: openTips: "burn after reading was opened" closeTips: "burn after reading was closed" - ###################organization################ - joinDepartmentNotification: - conversation: - reliabilityLevel: 3 - unreadCount: true - offlinePush: - switch: false - title: "welcome user join department" - desc: "welcome user join department" - ext: "welcome user join department" - defaultTips: - tips: "welcome user join department" #---------------demo configuration---------------------# #The following configuration items are applied to openIM Demo configuration @@ -792,7 +765,6 @@ demo: testDepartMentID: 001 imAPIURL: http://127.0.0.1:10002 onboardProcess: false # 是否开启注册流程 - createOrganizationUserAndJoinDepartment: false joinDepartmentIDList: [] # 用户注册进来默认加的部门ID列表 不填就随机 joinDepartmentGroups: false # 注册是否加部门群 oaNotification: false # 注册是否发送OA通知 @@ -816,7 +788,6 @@ prometheus: pushPrometheusPort: [ 20170 ] adminCmsPrometheusPort: [ 20200 ] officePrometheusPort: [ 20210 ] - organizationPrometheusPort: [ 20220 ] conversationPrometheusPort: [ 20230 ] cachePrometheusPort: [ 20240 ] realTimeCommPrometheusPort: [ 21300 ] diff --git a/deploy/.dockerignore b/deploy/.dockerignore deleted file mode 100644 index 019893ce7..000000000 --- a/deploy/.dockerignore +++ /dev/null @@ -1,6 +0,0 @@ -# 先设为忽略所有内容 -**/** - - -# 然后逐个排除 -!open_im_* \ No newline at end of file diff --git a/deploy/Makefile b/deploy/Makefile deleted file mode 100644 index 8250a06a4..000000000 --- a/deploy/Makefile +++ /dev/null @@ -1,158 +0,0 @@ - -GREEN_PREFIX="\033[32m" -COLOR_SUFFIX="\033[0m" -SKY_BLUE_PREFIX="\033[36m" - - -# 编译所有需要的组件源码 -win-build-all: - go env -w GOOS=linux - - make build-api && make build-msg-gateway && make build-msg-transfer && make build-push && make build-timer-task - make build-rpc-user && make build-rpc-friend && make build-rpc-group && make build-rpc-msg && make build-rpc-auth - make build-demo - - go env -w GOOS=windows - -# 编译 open_im_api -build-api: - echo -e ${GREEN_PREFIX} "open_im_api building..." ${COLOR_SUFFIX} - go build -ldflags="-w -s" -o open_im_api ../cmd/open_im_api/main.go - echo -e ${GREEN_PREFIX} "open_im_api build ok" ${COLOR_SUFFIX} - -# 编译 open_im_msg_gateway -build-msg-gateway: - echo -e ${GREEN_PREFIX} "open_im_msg_gateway building..." ${COLOR_SUFFIX} - go build -ldflags="-w -s" -o open_im_msg_gateway ../cmd/open_im_msg_gateway/main.go - echo -e ${GREEN_PREFIX} "open_im_msg_gateway build ok" ${COLOR_SUFFIX} - -# 编译 open_im_msg_transfer -build-msg-transfer: - echo -e ${GREEN_PREFIX} "open_im_msg_transfer building..." ${COLOR_SUFFIX} - go build -ldflags="-w -s" -o open_im_msg_transfer ../cmd/open_im_msg_transfer/main.go - echo -e ${GREEN_PREFIX} "open_im_msg_transfer build ok" ${COLOR_SUFFIX} - -# 编译 open_im_push -build-push: - echo -e ${GREEN_PREFIX} "open_im_push building..." ${COLOR_SUFFIX} - go build -ldflags="-w -s" -o open_im_push ../cmd/open_im_push/main.go - echo -e ${GREEN_PREFIX} "open_im_push build ok" ${COLOR_SUFFIX} - -# 编译 open_im_timer_task -build-timer-task: - echo -e ${GREEN_PREFIX} "open_im_timer_task building..." ${COLOR_SUFFIX} - go build -ldflags="-w -s" -o open_im_timer_task ../cmd/open_im_timer_task/main.go - echo -e ${GREEN_PREFIX} "open_im_timer_task build ok" ${COLOR_SUFFIX} - -# 编译 build-rpc-user -build-rpc-user: - echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_user building..." ${COLOR_SUFFIX} - go build -ldflags="-w -s" -o open_im_rpc_user ../cmd/rpc/open_im_user/main.go - echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_user build ok" ${COLOR_SUFFIX} - -# 编译 build-rpc-friend -build-rpc-friend: - echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_friend building..." ${COLOR_SUFFIX} - go build -ldflags="-w -s" -o open_im_rpc_friend ../cmd/rpc/open_im_friend/main.go - echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_friend build ok" ${COLOR_SUFFIX} - -# 编译 build-rpc-group -build-rpc-group: - echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_group building..." ${COLOR_SUFFIX} - go build -ldflags="-w -s" -o open_im_rpc_group ../cmd/rpc/open_im_group/main.go - echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_group build ok" ${COLOR_SUFFIX} - -# 编译 build-rpc-auth -build-rpc-auth: - echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_auth building..." ${COLOR_SUFFIX} - go build -ldflags="-w -s" -o open_im_rpc_auth ../cmd/rpc/open_im_auth/main.go - echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_auth build ok" ${COLOR_SUFFIX} - -# 编译 build-rpc-msg -build-rpc-msg: - echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_msg building..." ${COLOR_SUFFIX} - go build -ldflags="-w -s" -o open_im_rpc_msg ../cmd/rpc/open_im_msg/main.go - echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_msg build ok" ${COLOR_SUFFIX} - -# 编译 open_im_demo -build-demo: - echo -e ${SKY_BLUE_PREFIX} "open_im_demo building..." ${COLOR_SUFFIX} - go build -ldflags="-w -s" -o open_im_demo ../cmd/open_im_demo/main.go - echo -e ${SKY_BLUE_PREFIX} "open_im_demo build ok" ${COLOR_SUFFIX} - -# 打包所有组件为镜像 -image-all: - make image-api && make image-msg-gateway && make image-msg-transfer & make image-push && make image-timer-task - make image-rpc-user && make image-rpc-friend && make image-rpc-group && make image-rpc-msg && make image-rpc-auth - make image-demo - -# 打包 open_im_api -image-api: - echo -e ${GREEN_PREFIX} "IMAGE:openim/api building..." ${COLOR_SUFFIX} - docker build -t openim/api:latest -f ./dockerfiles/Dockerfile.api . - echo -e ${GREEN_PREFIX} "IMAGE:openim/api build ok" ${COLOR_SUFFIX} - -# 打包 open_im_msg_gateway -image-msg-gateway: - echo -e ${GREEN_PREFIX} "IMAGE:openim/msg_gateway building..." ${COLOR_SUFFIX} - docker build -t openim/msg_gateway:latest -f ./dockerfiles/Dockerfile.msg_gateway . - echo -e ${GREEN_PREFIX} "IMAGE:openim/msg_gateway build ok" ${COLOR_SUFFIX} - -# 打包 open_im_msg_transfer -image-msg-transfer: - echo -e ${GREEN_PREFIX} "IMAGE:openim/msg_transfer building..." ${COLOR_SUFFIX} - docker build -t openim/msg_transfer:latest -f ./dockerfiles/Dockerfile.msg_transfer . - echo -e ${GREEN_PREFIX} "IMAGE:openim/msg_transfer build ok" ${COLOR_SUFFIX} - -# 打包 open_im_push -image-push: - echo -e ${GREEN_PREFIX} "IMAGE:openim/push building..." ${COLOR_SUFFIX} - docker build -t openim/push:latest -f ./dockerfiles/Dockerfile.push . - echo -e ${GREEN_PREFIX} "IMAGE:openim/push build ok" ${COLOR_SUFFIX} - -# 打包 open_im_timer_task -image-timer-task: - echo -e ${GREEN_PREFIX} "IMAGE:openim/timer_task building..." ${COLOR_SUFFIX} - docker build -t openim/timer_task:latest -f ./dockerfiles/Dockerfile.timer_task . - echo -e ${GREEN_PREFIX} "IMAGE:openim/timer_task build ok" ${COLOR_SUFFIX} - -# 打包 build-rpc-user -image-rpc-user: - echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_user building..." ${COLOR_SUFFIX} - docker build -t openim/rpc_user:latest -f ./dockerfiles/Dockerfile.rpc_user . - echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_user build ok" ${COLOR_SUFFIX} - -# 打包 build-rpc-friend -image-rpc-friend: - echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_friend building..." ${COLOR_SUFFIX} - docker build -t openim/rpc_friend:latest -f ./dockerfiles/Dockerfile.rpc_friend . - echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_friend build ok" ${COLOR_SUFFIX} - -# 打包 build-rpc-group -image-rpc-group: - echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_group building..." ${COLOR_SUFFIX} - docker build -t openim/rpc_group:latest -f ./dockerfiles/Dockerfile.rpc_group . - echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_group build ok" ${COLOR_SUFFIX} - -# 打包 build-rpc-auth -image-rpc-auth: - echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_auth building..." ${COLOR_SUFFIX} - docker build -t openim/rpc_auth:latest -f ./dockerfiles/Dockerfile.rpc_auth . - echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_auth build ok" ${COLOR_SUFFIX} - -# 打包 build-rpc-msg -image-rpc-msg: - echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_msg building..." ${COLOR_SUFFIX} - docker build -t openim/rpc_msg:latest -f ./dockerfiles/Dockerfile.rpc_msg . - echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_msg build ok" ${COLOR_SUFFIX} - -# 打包 open_im_demo -image-demo: - echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/demo building..." ${COLOR_SUFFIX} - docker build -t openim/demo:latest -f ./dockerfiles/Dockerfile.demo . - echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/demo build ok" ${COLOR_SUFFIX} - -.PHONY: win-build-all build-api build-msg-gateway build-msg-transfer build-push - build-timer-task build-rpc-user build-rpc-friend build-rpc-group build-rpc-msg build-demo - image-all image-api image-msg-gateway image-msg-transfer image-push - image-timer-task image-rpc-user image-rpc-friend image-rpc-group image-rpc-msg image-demo diff --git a/deploy/config.example.yaml b/deploy/config.example.yaml deleted file mode 100644 index 08d8858e4..000000000 --- a/deploy/config.example.yaml +++ /dev/null @@ -1,183 +0,0 @@ -# The class cannot be named by Pascal or camel case. -# If it is not used, the corresponding structure will not be set, -# and it will not be read naturally. -serverversion: 1.0.3 -#---------------Infrastructure configuration---------------------# -etcd: - etcdSchema: openIM - etcdAddr: [ openim_etcd:2379 ] - -mysql: - dbMysqlAddress: [ openim_mysql:3306 ] # openim_mysql 是对应的mysql服务的host - dbMysqlUserName: openIM - dbMysqlPassword: openIM - dbMysqlDatabaseName: openIM - dbTableName: eMsg - dbMsgTableNum: 1 - dbMaxOpenConns: 20 - dbMaxIdleConns: 10 - dbMaxLifeTime: 120 - -mongo: - dbUri: ""#当dbUri值不为空则直接使用该值 - dbAddress: [ openim_mongo:27017 ] - dbDirect: false - dbTimeout: 10 - dbDatabase: openIM - dbSource: admin - dbUserName: - dbPassword: - dbMaxPoolSize: 20 - dbRetainChatRecords: 7 - -redis: - dbAddress: openim_redis:6379 - dbMaxIdle: 128 - dbMaxActive: 0 - dbIdleTimeout: 120 - dbPassWord: openIM - -kafka: - ws2mschat: - addr: [ openim_kafka:9092 ] - topic: "ws2ms_chat" - ms2pschat: - addr: [ openim_kafka:9092 ] - topic: "ms2ps_chat" - consumergroupid: - msgToMongo: mongo - msgToMySql: mysql - msgToPush: push - - - -#---------------Internal service configuration---------------------# - -# The service ip default is empty, -# automatically obtain the machine's valid network card ip as the service ip, -# otherwise the configuration ip is preferred -serverip: 0.0.0.0 - -# endpoints 内部组件间访问的端点host名称,访问时,可以内部直接访问 host:port 来访问 -# 新增的这一段配置节,主要是位了注册到etcd时,可以使用同一network下的容器名(host)来访问不同的容器,拆分到不同容器后原来全部使用serverip的形式不能用了 -endpoints: - api: openim_api - push: openim_push - msg_gateway: openim_msg_gateway - rpc_auth: openim_rpc_auth - rpc_friend: openim_rpc_friend - rpc_group: openim_rpc_group - rpc_msg: openim_rpc_msg - rpc_user: openim_rpc_user - -api: - openImApiPort: [ 10000 ] -sdk: - openImSdkWsPort: [ 30000 ] -cmsapi: - openImCmsApiPort: [ 8000 ] - -credential: - tencent: - appID: 1302656840 - region: ap-chengdu - bucket: echat-1302656840 - secretID: AKIDGNYVChzIQinu7QEgtNp0hnNgqcV8vZTC - secretKey: kz15vW83qM6dBUWIq681eBZA0c0vlIbe - - -rpcport: - openImUserPort: [ 10100 ] - openImFriendPort: [ 10200 ] - openImOfflineMessagePort: [ 10300] - openImOnlineRelayPort: [ 10400 ] - openImGroupPort: [ 10500 ] - openImAuthPort: [ 10600 ] - openImPushPort: [ 10700 ] - openImStatisticsPort: [ 10800 ] - openImMessageCmsPort: [ 10900 ] - openImAdminCmsPort: [ 11000 ] - -rpcregistername: - openImUserName: User - openImFriendName: Friend - openImOfflineMessageName: OfflineMessage - openImPushName: Push - openImOnlineMessageRelayName: OnlineMessageRelay - openImGroupName: Group - openImAuthName: Auth - -log: - storageLocation: ../logs/ - rotationTime: 24 - remainRotationCount: 5 - remainLogLevel: 6 - elasticSearchSwitch: false - elasticSearchAddr: [ 127.0.0.1:9201 ] - elasticSearchUser: "" - elasticSearchPassword: "" - -modulename: - longConnSvrName: msg_gateway - msgTransferName: msg_transfer - pushName: push - -longconnsvr: - openImWsPort: [ 17778 ] - websocketMaxConnNum: 10000 - websocketMaxMsgLen: 4096 - websocketTimeOut: 10 - -push: - tpns: - ios: - accessID: 1600018281 - secretKey: 3cd68a77a95b89e5089a1aca523f318f - android: - accessID: 111 - secretKey: 111 - jpns: - appKey: cf47465a368f24c659608e7e - masterSecret: 02204efe3f3832947a236ee5 - pushUrl: "https://api.jpush.cn/v3/push" - pushIntent: "intent:#Intent;component=io.openim.app.enterprisechat/io.openim.app.enterprisechat.MainActivity;end" -manager: - appManagerUid: ["openIM123456","openIM654321"] - secrets: ["openIM1","openIM2"] - -secret: tuoyun - -multiloginpolicy: 1 - -#token config -tokenpolicy: - accessSecret: "open_im_server" - # Token effective time day as a unit - accessExpire: 7 - -messagecallback: - callbackSwitch: false - callbackUrl: "http://www.xxx.com/msg/judge" - #TimeOut use second as unit - callbackTimeOut: 10 - - -#---------------demo configuration---------------------# -#The following configuration items are applied to openIM Demo configuration -demoswitch: true -demo: - openImDemoPort: [ 42233 ] - alismsverify: - accessKeyId: LTAI5tJPkn4HuuePdiLdGqe71 - accessKeySecret: 4n9OJ7ZCVN1U6KeHDAtOyNeVZcjOuV1 - signName: OpenIM Corporation - verificationCodeTemplateCode: SMS_2268101641 - superCode: 666666 - mail: - title: "openIM" - senderMail: "1765567899@qq.com" - senderAuthorizationCode: "1gxyausfoevlzbfag" - smtpAddr: "smtp.qq.com" - smtpPort: 25 - - diff --git a/deploy/dockerfiles/Dockerfile.api b/deploy/dockerfiles/Dockerfile.api deleted file mode 100644 index 99582608a..000000000 --- a/deploy/dockerfiles/Dockerfile.api +++ /dev/null @@ -1,17 +0,0 @@ -FROM alpine:3.13 - -# 设置固定的项目路径 -ENV WORKDIR /app -ENV CONFIG_NAME $WORKDIR/config/config.yaml - -# 将可执行文件复制到目标目录 -ADD ./open_im_api $WORKDIR/main -COPY ./start_api.sh $$WORKDIR - -# 创建用于挂载的几个目录,添加可执行权限 -RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ - chmod +x $WORKDIR/main - - -WORKDIR $WORKDIR -CMD ./start_api.sh \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.demo b/deploy/dockerfiles/Dockerfile.demo deleted file mode 100644 index ac77ad8d3..000000000 --- a/deploy/dockerfiles/Dockerfile.demo +++ /dev/null @@ -1,16 +0,0 @@ -FROM alpine:3.13 - -# 设置固定的项目路径 -ENV WORKDIR /app -ENV CONFIG_NAME $WORKDIR/config/config.yaml - -# 将可执行文件复制到目标目录 -ADD ./open_im_demo $WORKDIR/main - -# 创建用于挂载的几个目录,添加可执行权限 -RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ - chmod +x $WORKDIR/main - - -WORKDIR $WORKDIR -CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.msg_gateway b/deploy/dockerfiles/Dockerfile.msg_gateway deleted file mode 100644 index ffd012bc4..000000000 --- a/deploy/dockerfiles/Dockerfile.msg_gateway +++ /dev/null @@ -1,16 +0,0 @@ -FROM alpine:3.13 - -# 设置固定的项目路径 -ENV WORKDIR /app -ENV CONFIG_NAME $WORKDIR/config/config.yaml - -# 将可执行文件复制到目标目录 -ADD ./open_im_msg_gateway $WORKDIR/main - -# 创建用于挂载的几个目录,重命名可执行文件为 main,添加可执行权限 -RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ - chmod +x $WORKDIR/main - - -WORKDIR $WORKDIR -CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.msg_transfer b/deploy/dockerfiles/Dockerfile.msg_transfer deleted file mode 100644 index a82c4da8b..000000000 --- a/deploy/dockerfiles/Dockerfile.msg_transfer +++ /dev/null @@ -1,16 +0,0 @@ -FROM alpine:3.13 - -# 设置固定的项目路径 -ENV WORKDIR /app -ENV CONFIG_NAME $WORKDIR/config/config.yaml - -# 将可执行文件复制到目标目录 -ADD ./open_im_msg_transfer $WORKDIR/main - -# 创建用于挂载的几个目录,添加可执行权限 -RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ - chmod +x $WORKDIR/main - - -WORKDIR $WORKDIR -CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.push b/deploy/dockerfiles/Dockerfile.push deleted file mode 100644 index b929dd82c..000000000 --- a/deploy/dockerfiles/Dockerfile.push +++ /dev/null @@ -1,16 +0,0 @@ -FROM alpine:3.13 - -# 设置固定的项目路径 -ENV WORKDIR /app -ENV CONFIG_NAME $WORKDIR/config/config.yaml - -# 将可执行文件复制到目标目录 -ADD ./open_im_push $WORKDIR/main - -# 创建用于挂载的几个目录,添加可执行权限 -RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ - chmod +x $WORKDIR/main - - -WORKDIR $WORKDIR -CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.rpc_auth b/deploy/dockerfiles/Dockerfile.rpc_auth deleted file mode 100644 index a8e50fdb1..000000000 --- a/deploy/dockerfiles/Dockerfile.rpc_auth +++ /dev/null @@ -1,16 +0,0 @@ -FROM alpine:3.13 - -# 设置固定的项目路径 -ENV WORKDIR /app -ENV CONFIG_NAME $WORKDIR/config/config.yaml - -# 将可执行文件复制到目标目录 -ADD ./open_im_rpc_auth $WORKDIR/main - -# 创建用于挂载的几个目录,添加可执行权限 -RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ - chmod +x $WORKDIR/main - - -WORKDIR $WORKDIR -CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.rpc_friend b/deploy/dockerfiles/Dockerfile.rpc_friend deleted file mode 100644 index cfa2fe18c..000000000 --- a/deploy/dockerfiles/Dockerfile.rpc_friend +++ /dev/null @@ -1,16 +0,0 @@ -FROM alpine:3.13 - -# 设置固定的项目路径 -ENV WORKDIR /app -ENV CONFIG_NAME $WORKDIR/config/config.yaml - -# 将可执行文件复制到目标目录 -ADD ./open_im_rpc_friend $WORKDIR/main - -# 创建用于挂载的几个目录,添加可执行权限 -RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ - chmod +x $WORKDIR/main - - -WORKDIR $WORKDIR -CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.rpc_group b/deploy/dockerfiles/Dockerfile.rpc_group deleted file mode 100644 index d56a0fefe..000000000 --- a/deploy/dockerfiles/Dockerfile.rpc_group +++ /dev/null @@ -1,16 +0,0 @@ -FROM alpine:3.13 - -# 设置固定的项目路径 -ENV WORKDIR /app -ENV CONFIG_NAME $WORKDIR/config/config.yaml - -# 将可执行文件复制到目标目录 -ADD ./open_im_rpc_group $WORKDIR/main - -# 创建用于挂载的几个目录,添加可执行权限 -RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ - chmod +x $WORKDIR/main - - -WORKDIR $WORKDIR -CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.rpc_msg b/deploy/dockerfiles/Dockerfile.rpc_msg deleted file mode 100644 index 01b5de02f..000000000 --- a/deploy/dockerfiles/Dockerfile.rpc_msg +++ /dev/null @@ -1,16 +0,0 @@ -FROM alpine:3.13 - -# 设置固定的项目路径 -ENV WORKDIR /app -ENV CONFIG_NAME $WORKDIR/config/config.yaml - -# 将可执行文件复制到目标目录 -ADD ./open_im_rpc_msg $WORKDIR/main - -# 创建用于挂载的几个目录,添加可执行权限 -RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ - chmod +x $WORKDIR/main - - -WORKDIR $WORKDIR -CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.rpc_user b/deploy/dockerfiles/Dockerfile.rpc_user deleted file mode 100644 index 5be6298bd..000000000 --- a/deploy/dockerfiles/Dockerfile.rpc_user +++ /dev/null @@ -1,16 +0,0 @@ -FROM alpine:3.13 - -# 设置固定的项目路径 -ENV WORKDIR /app -ENV CONFIG_NAME $WORKDIR/config/config.yaml - -# 将可执行文件复制到目标目录 -ADD ./open_im_rpc_user $WORKDIR/main - -# 创建用于挂载的几个目录,添加可执行权限 -RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ - chmod +x $WORKDIR/main - - -WORKDIR $WORKDIR -CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.timer_task b/deploy/dockerfiles/Dockerfile.timer_task deleted file mode 100644 index 0c2222cfb..000000000 --- a/deploy/dockerfiles/Dockerfile.timer_task +++ /dev/null @@ -1,16 +0,0 @@ -FROM alpine:3.13 - -# 设置固定的项目路径 -ENV WORKDIR /app -ENV CONFIG_NAME $WORKDIR/config/config.yaml - -# 将可执行文件复制到目标目录 -ADD ./open_im_timer_task $WORKDIR/main - -# 创建用于挂载的几个目录,添加可执行权限 -RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ - chmod +x $WORKDIR/main - - -WORKDIR $WORKDIR -CMD ./main \ No newline at end of file diff --git a/deploy/env.yaml b/deploy/env.yaml deleted file mode 100644 index 423807e4f..000000000 --- a/deploy/env.yaml +++ /dev/null @@ -1,101 +0,0 @@ -version: "3.7" -networks: - openim: - external: true - -services: - mysql: - networks: - - openim - image: mysql:5.7 - # ports: - # #- 13306:3306 - # - 23306:33060 - container_name: openim_mysql - volumes: - - ./components/mysql/data:/var/lib/mysql - - /etc/localtime:/etc/localtime - environment: - MYSQL_ROOT_PASSWORD: openIM - restart: always - - mongodb: - networks: - - openim - image: mongo:4.4.5-bionic - # ports: - # - 37017:27017 - container_name: openim_mongo - volumes: - - ./components/mongodb/data/db:/data/db - - ./components/mongodb/data/logs:/data/logs - - ./components/mongodb/data/conf:/etc/mongo - environment: - TZ: Asia/Shanghai - # - MONGO_INITDB_ROOT_USERNAME=openIM - # - MONGO_INITDB_ROOT_PASSWORD=openIM - restart: always - - redis: - networks: - - openim - image: redis:6.2.4-alpine - # ports: - # - 16379:6379 - container_name: openim_redis - volumes: - - ./components/redis/data:/data - #redis config file - #- ./components/redis/config/redis.conf:/usr/local/redis/config/redis.conf - environment: - TZ: Asia/Shanghai - restart: always - sysctls: - net.core.somaxconn: 1024 - command: redis-server --requirepass openIM --appendonly yes - - - zookeeper: - networks: - - openim - image: wurstmeister/zookeeper - # ports: - # - 2181:2181 - container_name: openim_zookeeper - volumes: - - /etc/localtime:/etc/localtime - environment: - TZ: Asia/Shanghai - restart: always - - kafka: - networks: - - openim - image: wurstmeister/kafka - container_name: openim_kafka - restart: always - environment: - TZ: Asia/Shanghai - KAFKA_BROKER_ID: 0 - KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 - KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092 - KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092 - depends_on: - - zookeeper - - etcd: - networks: - - openim - image: quay.io/coreos/etcd - # ports: - # - 2379:2379 - # - 2380:2380 - container_name: openim_etcd - volumes: - - /etc/timezone:/etc/timezone - - /etc/localtime:/etc/localtime - environment: - ETCDCTL_API: 3 - restart: always - command: /usr/local/bin/etcd --name etcd0 --data-dir /etcd-data --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://0.0.0.0:2379 --listen-peer-urls http://0.0.0.0:2380 --initial-advertise-peer-urls http://0.0.0.0:2380 --initial-cluster etcd0=http://0.0.0.0:2380 --initial-cluster-token tkn --initial-cluster-state new - diff --git a/deploy/openim.yaml b/deploy/openim.yaml deleted file mode 100644 index 350729399..000000000 --- a/deploy/openim.yaml +++ /dev/null @@ -1,223 +0,0 @@ -version: "3.7" -networks: - openim: - external: true - -services: - api: - networks: - - openim - image: openim/api - container_name: openim_api - ports: - - 10000:10000 # API,必须开 - volumes: - - ./logs:/app/logs - # Dockerfile 里定义了配置文件的路径环境变量,CONFIG_NAME,默认指向了 /app/config/config.yaml - - ./config/config.yaml:/app/config/config.yaml - - ./db/sdk:/app/db/sdk - restart: always - # depends_on: - # - kafka - # # - mysql - # # - mongodb - # - redis - # - etcd - logging: - driver: json-file - options: - max-size: "1g" - max-file: "2" - - msg_gateway: - networks: - - openim - image: openim/msg_gateway - container_name: openim_msg_gateway - ports: - - 17778:17778 # 消息,必须开 - volumes: - - ./logs:/app/logs - - ./config/config.yaml:/app/config/config.yaml - - ./db/sdk:/app/db/sdk - restart: always - # depends_on: - # - kafka - # # - mysql - # # - mongodb - # - redis - # - etcd - logging: - driver: json-file - options: - max-size: "1g" - max-file: "2" - - msg_transfer: - networks: - - openim - image: openim/msg_transfer - container_name: openim_msg_transfer - volumes: - - ./logs:/app/logs - - ./config/config.yaml:/app/config/config.yaml - - ./db/sdk:/app/db/sdk - restart: always - # depends_on: - # - kafka - # # - mysql - # # - mongodb - # - redis - # - etcd - logging: - driver: json-file - options: - max-size: "1g" - max-file: "2" - - push: - networks: - - openim - image: openim/push - container_name: openim_push - volumes: - - ./logs:/app/logs - - ./config/config.yaml:/app/config/config.yaml - - ./db/sdk:/app/db/sdk - restart: always - # depends_on: - # - kafka - # # - mysql - # # - mongodb - # - redis - # - etcd - logging: - driver: json-file - options: - max-size: "1g" - max-file: "2" - - timer_task: - networks: - - openim - image: openim/timer_task - container_name: openim_timer_task - volumes: - - ./logs:/app/logs - - ./config/config.yaml:/app/config/config.yaml - - ./db/sdk:/app/db/sdk - restart: always - # depends_on: - # - kafka - # # - mysql - # # - mongodb - # - redis - # - etcd - logging: - driver: json-file - options: - max-size: "1g" - max-file: "2" - - rpc_user: - networks: - - openim - image: openim/rpc_user - container_name: openim_rpc_user - volumes: - - ./logs:/app/logs - - ./config/config.yaml:/app/config/config.yaml - - ./db/sdk:/app/db/sdk - restart: always - # depends_on: - # - kafka - # # - mysql - # # - mongodb - # - redis - # - etcd - logging: - driver: json-file - options: - max-size: "1g" - max-file: "2" - - rpc_friend: - networks: - - openim - image: openim/rpc_friend - container_name: openim_rpc_friend - volumes: - - ./logs:/app/logs - - ./config/config.yaml:/app/config/config.yaml - - ./db/sdk:/app/db/sdk - restart: always - # depends_on: - # - kafka - # # - mysql - # # - mongodb - # - redis - # - etcd - - rpc_group: - networks: - - openim - image: openim/rpc_group - container_name: openim_rpc_group - volumes: - - ./logs:/app/logs - - ./config/config.yaml:/app/config/config.yaml - - ./db/sdk:/app/db/sdk - restart: always - # depends_on: - # - kafka - # # - mysql - # # - mongodb - # - redis - # - etcd - - rpc_auth: - networks: - - openim - image: openim/rpc_auth - container_name: openim_rpc_auth - volumes: - - ./logs:/app/logs - - ./config/config.yaml:/app/config/config.yaml - - ./db/sdk:/app/db/sdk - restart: always - # depends_on: - # - kafka - # # - mysql - # # - mongodb - # - redis - # - etcd - - rpc_msg: - networks: - - openim - image: openim/rpc_msg - container_name: openim_rpc_msg - volumes: - - ./logs:/app/logs - - ./config/config.yaml:/app/config/config.yaml - - ./db/sdk:/app/db/sdk - restart: always - # depends_on: - # - kafka - # # - mysql - # # - mongodb - # - redis - # - etcd - - demo: - networks: - - openim - image: openim/demo - container_name: openim_demo - ports: - - 42233:42233 - volumes: - - ./logs:/app/logs - - ./config/config.yaml:/app/config/config.yaml - - ./db/sdk:/app/db/sdk - restart: always \ No newline at end of file diff --git a/deploy/readme.md b/deploy/readme.md deleted file mode 100644 index 61fbd9700..000000000 --- a/deploy/readme.md +++ /dev/null @@ -1,30 +0,0 @@ - -### 以docker-compose 形式单独部署 -```sh -# 查看 ./Makefile ,先编译各个需要的源码到 ../bin -# win-* 表示在win平台编译位linux二进制,其实就是处理了 go env -w GOOS=linux -make win-build-all - -# 得到各个二进制程序之后,打包为镜像 -# 目前没有处理 Open-IM-SDK-Core ,需要的话可以自己单独处理这个模块 -make image-all - -# docker-compose.yaml 分成了两部分,一部分是openIM的镜像容器 openim.yaml,一部分是依赖的环境 env.yaml -# 两部分使用一个外部的网络来联通,所以首先创建用到的 network -docker network create openim --attachable=true -d bridge - -# 处理openim组件需要的挂载目录,主要是处理config目录 -mkdir ./config -cp ./config.example.yaml ./config/config.yaml # 修改 ./config/config.yaml 内容,比如各个依赖组件的 host - -# 然后拉起env.yaml -docker-compose -f ./env.yaml up -d - -# 等env 容器全部拉起成功之后,拉起openim.yaml -docker-compose -f ./openim.yaml up -d - -# 查看容器运行,推荐使用下 portainer ,web查看容器情况,查看日志等等 -docker container ps -a | grep openim - -# 正常应该是查看api,demo等的容器日志,看到gin打印的路由日志才算是成功 -``` \ No newline at end of file diff --git a/internal/api/organization/organization.go b/internal/api/organization/organization.go deleted file mode 100644 index fb0b479e7..000000000 --- a/internal/api/organization/organization.go +++ /dev/null @@ -1,696 +0,0 @@ -package organization - -import ( - jsonData "Open_IM/internal/utils" - api "Open_IM/pkg/base_info" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/log" - "Open_IM/pkg/common/token_verify" - "Open_IM/pkg/getcdv3" - rpc "Open_IM/pkg/proto/organization" - open_im_sdk "Open_IM/pkg/proto/sdk_ws" - "Open_IM/pkg/utils" - "context" - "github.com/gin-gonic/gin" - "net/http" - "strings" -) - -// @Summary 创建部门 -// @Description 创建部门 -// @Tags 组织架构相关 -// @ID CreateDepartment -// @Accept json -// @Param token header string true "im token" -// @Param req body api.CreateDepartmentReq true "请求" -// @Produce json -// @Success 0 {object} api.CreateDepartmentResp{data=open_im_sdk.Department} -// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" -// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" -// @Router /organization/create_department [post] -func CreateDepartment(c *gin.Context) { - params := api.CreateDepartmentReq{} - if err := c.BindJSON(¶ms); err != nil { - log.NewError("0", "BindJSON failed ", err.Error()) - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &rpc.CreateDepartmentReq{DepartmentInfo: &open_im_sdk.Department{}} - utils.CopyStructFields(req, ¶ms) - utils.CopyStructFields(req.DepartmentInfo, ¶ms) - err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) - req.OpUserID = opUserID - if err != nil { - errMsg := "ParseTokenGetUserID failed " + err.Error() + " " + c.Request.Header.Get("token") - log.NewError(req.OperationID, errMsg, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) - if etcdConn == nil { - errMsg := req.OperationID + "getcdv3.GetDefaultConn == nil" - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - - client := rpc.NewOrganizationClient(etcdConn) - RpcResp, err := client.CreateDepartment(context.Background(), req) - if err != nil { - errMsg := "rpc CreateDepartment failed " + err.Error() + req.String() - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - - apiResp := api.CreateDepartmentResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, Department: RpcResp.DepartmentInfo} - apiResp.Data = jsonData.JsonDataOne(RpcResp.DepartmentInfo) - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) - c.JSON(http.StatusOK, apiResp) -} - -// @Summary 更新部门信息 -// @Description 更新部门信息 -// @Tags 组织架构相关 -// @ID UpdateDepartment -// @Accept json -// @Param token header string true "im token" -// @Param req body api.UpdateDepartmentReq true "请求" -// @Produce json -// @Success 0 {object} api.UpdateDepartmentResp -// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" -// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" -// @Router /organization/update_department [post] -func UpdateDepartment(c *gin.Context) { - params := api.UpdateDepartmentReq{} - if err := c.BindJSON(¶ms); err != nil { - log.NewError("0", "BindJSON failed ", err.Error()) - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &rpc.UpdateDepartmentReq{DepartmentInfo: &open_im_sdk.Department{}} - utils.CopyStructFields(req, ¶ms) - utils.CopyStructFields(req.DepartmentInfo, ¶ms) - err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) - req.OpUserID = opUserID - if err != nil { - errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token") - log.NewError(req.OperationID, errMsg, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) - if etcdConn == nil { - errMsg := req.OperationID + "getcdv3.GetDefaultConn == nil" - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - - client := rpc.NewOrganizationClient(etcdConn) - RpcResp, err := client.UpdateDepartment(context.Background(), req) - if err != nil { - errMsg := "rpc UpdateDepartment failed " + err.Error() + req.String() - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - - apiResp := api.UpdateDepartmentResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) - c.JSON(http.StatusOK, apiResp) -} - -// @Summary 获取子部门列表 -// @Description 获取子部门列表 -// @Tags 组织架构相关 -// @ID GetSubDepartment -// @Accept json -// @Param token header string true "im token" -// @Param req body api.GetSubDepartmentReq true "请求" -// @Produce json -// @Success 0 {object} api.GetSubDepartmentResp{data=[]open_im_sdk.Department} -// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" -// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" -// @Router /organization/get_sub_department [post] -func GetSubDepartment(c *gin.Context) { - params := api.GetSubDepartmentReq{} - if err := c.BindJSON(¶ms); err != nil { - log.NewError("0", "BindJSON failed ", err.Error()) - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &rpc.GetSubDepartmentReq{} - utils.CopyStructFields(req, ¶ms) - err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) - req.OpUserID = opUserID - if err != nil { - errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token") - log.NewError(req.OperationID, errMsg, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) - if etcdConn == nil { - errMsg := req.OperationID + "getcdv3.GetDefaultConn == nil" - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - client := rpc.NewOrganizationClient(etcdConn) - RpcResp, err := client.GetSubDepartment(context.Background(), req) - if err != nil { - errMsg := "rpc GetDepartment failed " + err.Error() + req.String() - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - - apiResp := api.GetSubDepartmentResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, DepartmentList: RpcResp.DepartmentList} - apiResp.Data = jsonData.JsonDataList(RpcResp.DepartmentList) - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) - c.JSON(http.StatusOK, apiResp) -} - -func GetAllDepartment(c *gin.Context) { - -} - -// @Summary 删除部门 -// @Description 删除部门 -// @Tags 组织架构相关 -// @ID DeleteDepartment -// @Accept json -// @Param token header string true "im token" -// @Param req body api.DeleteDepartmentReq true "请求" -// @Produce json -// @Success 0 {object} api.DeleteDepartmentResp -// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" -// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" -// @Router /organization/delete_department [post] -func DeleteDepartment(c *gin.Context) { - params := api.DeleteDepartmentReq{} - if err := c.BindJSON(¶ms); err != nil { - log.NewError("0", "BindJSON failed ", err.Error()) - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &rpc.DeleteDepartmentReq{} - utils.CopyStructFields(req, ¶ms) - err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) - req.OpUserID = opUserID - if err != nil { - errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token") - log.NewError(req.OperationID, errMsg, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) - if etcdConn == nil { - errMsg := req.OperationID + "getcdv3.GetDefaultConn == nil" - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - client := rpc.NewOrganizationClient(etcdConn) - RpcResp, err := client.DeleteDepartment(context.Background(), req) - if err != nil { - errMsg := "rpc DeleteDepartment failed " + err.Error() + req.String() - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - - apiResp := api.DeleteDepartmentResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) - c.JSON(http.StatusOK, apiResp) -} - -// @Summary 组织架构导入用户 -// @Description 组织架构导入用户 -// @Tags 组织架构相关 -// @ID CreateOrganizationUser -// @Accept json -// @Param token header string true "im token" -// @Param req body api.CreateOrganizationUserReq true "请求" -// @Produce json -// @Success 0 {object} api.CreateOrganizationUserResp -// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" -// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" -// @Router /organization/create_organization_user [post] -func CreateOrganizationUser(c *gin.Context) { - params := api.CreateOrganizationUserReq{} - if err := c.BindJSON(¶ms); err != nil { - log.NewError("0", "BindJSON failed ", err.Error()) - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - - req := &rpc.CreateOrganizationUserReq{OrganizationUser: &open_im_sdk.OrganizationUser{}} - utils.CopyStructFields(req, ¶ms) - utils.CopyStructFields(req.OrganizationUser, ¶ms) - - err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) - req.OpUserID = opUserID - if err != nil { - errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token") - log.NewError(req.OperationID, errMsg, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) - if etcdConn == nil { - errMsg := req.OperationID + "getcdv3.GetDefaultConn == nil" - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - client := rpc.NewOrganizationClient(etcdConn) - RpcResp, err := client.CreateOrganizationUser(context.Background(), req) - if err != nil { - errMsg := "rpc CreateOrganizationUser failed " + err.Error() + req.String() - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - - apiResp := api.CreateOrganizationUserResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) - c.JSON(http.StatusOK, apiResp) -} - -// @Summary 更新组织架构中的用户 -// @Description 更新组织架构中的用户 -// @Tags 组织架构相关 -// @ID UpdateOrganizationUser -// @Accept json -// @Param token header string true "im token" -// @Param req body api.UpdateOrganizationUserReq true "请求" -// @Produce json -// @Success 0 {object} api.UpdateOrganizationUserResp -// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" -// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" -// @Router /organization/update_organization_user [post] -func UpdateOrganizationUser(c *gin.Context) { - params := api.UpdateOrganizationUserReq{} - if err := c.BindJSON(¶ms); err != nil { - log.NewError("0", "BindJSON failed ", err.Error()) - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - - req := &rpc.UpdateOrganizationUserReq{OrganizationUser: &open_im_sdk.OrganizationUser{}} - utils.CopyStructFields(req, ¶ms) - utils.CopyStructFields(req.OrganizationUser, ¶ms) - err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) - req.OpUserID = opUserID - if err != nil { - errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token") - log.NewError(req.OperationID, errMsg, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) - if etcdConn == nil { - errMsg := req.OperationID + "getcdv3.GetDefaultConn == nil" - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - client := rpc.NewOrganizationClient(etcdConn) - RpcResp, err := client.UpdateOrganizationUser(context.Background(), req) - if err != nil { - errMsg := "rpc UpdateOrganizationUser failed " + err.Error() + req.String() - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - apiResp := api.UpdateOrganizationUserResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) - c.JSON(http.StatusOK, apiResp) -} - -// @Summary 创建部门用户 -// @Description 创建部门用户 -// @Tags 组织架构相关 -// @ID CreateDepartmentMember -// @Accept json -// @Param token header string true "im token" -// @Param req body api.CreateDepartmentMemberReq true "请求" -// @Produce json -// @Success 0 {object} api.CreateDepartmentMemberResp -// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" -// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" -// @Router /organization/create_department_member [post] -func CreateDepartmentMember(c *gin.Context) { - params := api.CreateDepartmentMemberReq{} - if err := c.BindJSON(¶ms); err != nil { - log.NewError("0", "BindJSON failed ", err.Error()) - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - - req := &rpc.CreateDepartmentMemberReq{DepartmentMember: &open_im_sdk.DepartmentMember{}} - utils.CopyStructFields(req, ¶ms) - utils.CopyStructFields(req.DepartmentMember, ¶ms) - - err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) - req.OpUserID = opUserID - if err != nil { - errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token") - log.NewError(req.OperationID, errMsg, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) - if etcdConn == nil { - errMsg := req.OperationID + "getcdv3.GetDefaultConn == nil" - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - client := rpc.NewOrganizationClient(etcdConn) - RpcResp, err := client.CreateDepartmentMember(context.Background(), req) - if err != nil { - errMsg := "rpc CreateDepartmentMember failed " + err.Error() + req.String() - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - - apiResp := api.CreateDepartmentMemberResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) - c.JSON(http.StatusOK, apiResp) -} - -// @Summary 获取部门中的所有用户 -// @Description 获取部门中的所有用户 -// @Tags 组织架构相关 -// @ID GetUserInDepartment -// @Accept json -// @Param token header string true "im token" -// @Param req body api.GetUserInDepartmentReq true "请求" -// @Produce json -// @Success 0 {object} api.GetUserInDepartmentResp{data=open_im_sdk.UserInDepartment} -// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" -// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" -// @Router /organization/get_user_in_department [post] -func GetUserInDepartment(c *gin.Context) { - params := api.GetUserInDepartmentReq{} - if err := c.BindJSON(¶ms); err != nil { - log.NewError("0", "BindJSON failed ", err.Error()) - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - - req := &rpc.GetUserInDepartmentReq{} - utils.CopyStructFields(req, ¶ms) - - err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) - req.OpUserID = opUserID - if err != nil { - errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token") - log.NewError(req.OperationID, errMsg, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) - if etcdConn == nil { - errMsg := req.OperationID + "getcdv3.GetDefaultConn == nil" - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - client := rpc.NewOrganizationClient(etcdConn) - RpcResp, err := client.GetUserInDepartment(context.Background(), req) - if err != nil { - errMsg := "rpc GetUserInDepartment failed " + err.Error() + req.String() - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - - apiResp := api.GetUserInDepartmentResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, UserInDepartment: RpcResp.UserInDepartment} - apiResp.Data = jsonData.JsonDataOne(RpcResp.UserInDepartment) - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) - c.JSON(http.StatusOK, apiResp) -} - -// @Summary 更新部门中某个用户 -// @Description 更新部门中某个用户 -// @Tags 组织架构相关 -// @ID UpdateUserInDepartment -// @Accept json -// @Param token header string true "im token" -// @Param req body api.UpdateUserInDepartmentReq true "请求" -// @Produce json -// @Success 0 {object} api.UpdateUserInDepartmentResp -// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" -// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" -// @Router /organization/update_user_in_department [post] -func UpdateUserInDepartment(c *gin.Context) { - params := api.UpdateUserInDepartmentReq{} - if err := c.BindJSON(¶ms); err != nil { - log.NewError("0", "BindJSON failed ", err.Error()) - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - - req := &rpc.UpdateUserInDepartmentReq{DepartmentMember: &open_im_sdk.DepartmentMember{}} - utils.CopyStructFields(req.DepartmentMember, ¶ms) - utils.CopyStructFields(req, ¶ms) - err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) - req.OpUserID = opUserID - if err != nil { - errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token") - log.NewError(req.OperationID, errMsg, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) - if etcdConn == nil { - errMsg := req.OperationID + "getcdv3.GetDefaultConn == nil" - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - client := rpc.NewOrganizationClient(etcdConn) - RpcResp, err := client.UpdateUserInDepartment(context.Background(), req) - if err != nil { - errMsg := "rpc UpdateUserInDepartment failed " + err.Error() + req.String() - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - - apiResp := api.UpdateUserInDepartmentResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) - c.JSON(http.StatusOK, apiResp) -} - -// @Summary 删除组织架构中某个用户 -// @Description 删除组织架构中某个用户 -// @Tags 组织架构相关 -// @ID DeleteOrganizationUser -// @Accept json -// @Param token header string true "im token" -// @Param req body api.DeleteOrganizationUserReq true "请求" -// @Produce json -// @Success 0 {object} api.DeleteOrganizationUserResp -// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" -// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" -// @Router /organization/delete_organization_user [post] -func DeleteOrganizationUser(c *gin.Context) { - params := api.DeleteOrganizationUserReq{} - if err := c.BindJSON(¶ms); err != nil { - log.NewError("0", "BindJSON failed ", err.Error()) - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - - req := &rpc.DeleteOrganizationUserReq{} - utils.CopyStructFields(req, ¶ms) - - err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) - req.OpUserID = opUserID - if err != nil { - errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token") - log.NewError(req.OperationID, errMsg, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) - if etcdConn == nil { - errMsg := req.OperationID + "getcdv3.GetDefaultConn == nil" - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - client := rpc.NewOrganizationClient(etcdConn) - RpcResp, err := client.DeleteOrganizationUser(context.Background(), req) - if err != nil { - errMsg := "rpc DeleteOrganizationUser failed " + err.Error() + req.String() - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - - apiResp := api.DeleteOrganizationUserResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) - c.JSON(http.StatusOK, apiResp) -} - -// @Summary 获取部门中所有成员 -// @Description 获取部门中所有成员 -// @Tags 组织架构相关 -// @ID GetDepartmentMember -// @Accept json -// @Param token header string true "im token" -// @Param req body api.GetDepartmentMemberReq true "请求" -// @Produce json -// @Success 0 {object} api.GetDepartmentMemberResp{data=[]open_im_sdk.UserDepartmentMember} -// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" -// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" -// @Router /organization/get_department_member [post] -func GetDepartmentMember(c *gin.Context) { - params := api.GetDepartmentMemberReq{} - if err := c.BindJSON(¶ms); err != nil { - log.NewError("0", "BindJSON failed ", err.Error()) - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &rpc.GetDepartmentMemberReq{} - utils.CopyStructFields(req, ¶ms) - - err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) - req.OpUserID = opUserID - if err != nil { - errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token") - log.NewError(req.OperationID, errMsg, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) - if etcdConn == nil { - errMsg := req.OperationID + "getcdv3.GetDefaultConn == nil" - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - client := rpc.NewOrganizationClient(etcdConn) - RpcResp, err := client.GetDepartmentMember(context.Background(), req) - if err != nil { - errMsg := "rpc GetDepartmentMember failed " + err.Error() + req.String() - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - - apiResp := api.GetDepartmentMemberResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, UserInDepartmentList: RpcResp.UserDepartmentMemberList} - apiResp.Data = jsonData.JsonDataList(RpcResp.UserDepartmentMemberList) - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) - c.JSON(http.StatusOK, apiResp) -} - -// @Summary 删除部门中某个用户 -// @Description 删除部门中某个用户 -// @Tags 组织架构相关 -// @ID DeleteUserInDepartment -// @Accept json -// @Param token header string true "im token" -// @Param req body api.DeleteUserInDepartmentReq true "请求" -// @Produce json -// @Success 0 {object} api.DeleteUserInDepartmentResp -// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误" -// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等" -// @Router /organization/delete_user_in_department [post] -func DeleteUserInDepartment(c *gin.Context) { - params := api.DeleteUserInDepartmentReq{} - if err := c.BindJSON(¶ms); err != nil { - log.NewError("0", "BindJSON failed ", err.Error()) - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - req := &rpc.DeleteUserInDepartmentReq{} - utils.CopyStructFields(req, ¶ms) - - err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) - req.OpUserID = opUserID - if err != nil { - errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token") - log.NewError(req.OperationID, errMsg, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) - etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) - if etcdConn == nil { - errMsg := req.OperationID + "getcdv3.GetDefaultConn == nil" - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - client := rpc.NewOrganizationClient(etcdConn) - RpcResp, err := client.DeleteUserInDepartment(context.Background(), req) - if err != nil { - errMsg := "rpc DeleteUserInDepartment failed " + err.Error() + req.String() - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - - apiResp := api.DeleteUserInDepartmentResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) - c.JSON(http.StatusOK, apiResp) -} - -func GetUserInOrganization(c *gin.Context) { - req := api.GetUserInOrganizationReq{} - if err := c.BindJSON(&req); err != nil { - log.NewError(req.OperationID, "BindJSON failed ", err.Error()) - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) - err, _ := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) - if err != nil { - errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token") - log.NewError(req.OperationID, errMsg, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, req.OperationID) - if etcdConn == nil { - errMsg := req.OperationID + "getcdv3.GetDefaultConn == nil" - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - reqPb := &rpc.GetUserInOrganizationReq{OperationID: req.OperationID, UserIDList: req.UserIDList} - client := rpc.NewOrganizationClient(etcdConn) - respPb, err := client.GetUserInOrganization(context.Background(), reqPb) - if err != nil { - errMsg := "rpc DeleteUserInDepartment failed " + err.Error() + reqPb.String() - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) - return - } - apiResp := api.GetUserInOrganizationResp{CommResp: api.CommResp{ErrCode: respPb.ErrCode, ErrMsg: respPb.ErrMsg}, OrganizationUserList: respPb.OrganizationUsers} - apiResp.Data = jsonData.JsonDataList(apiResp.OrganizationUserList) - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) - c.JSON(http.StatusOK, apiResp) -} diff --git a/internal/demo/register/check_login.go b/internal/demo/register/check_login.go deleted file mode 100644 index 8cb051baf..000000000 --- a/internal/demo/register/check_login.go +++ /dev/null @@ -1,89 +0,0 @@ -package register - -import ( - "Open_IM/pkg/common/constant" - imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - "Open_IM/pkg/utils" - "errors" - "net/http" - - "github.com/gin-gonic/gin" - "gorm.io/gorm" -) - -type CheckLoginLimitReq struct { - OperationID string `json:"operationID"` - UserID string `json:"userID"` -} - -type CheckLoginLimitResp struct { -} - -func CheckLoginLimit(c *gin.Context) { - req := CheckLoginLimitReq{} - if err := c.BindJSON(&req); err != nil { - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), err.Error()) - c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) - return - } - ip := c.Request.Header.Get("X-Forward-For") - if ip == "" { - ip = c.ClientIP() - } - log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "IP: ", ip) - user, err := imdb.GetUserIPLimit(req.UserID) - if err != nil && !errors.Is(gorm.ErrRecordNotFound, err) { - errMsg := req.OperationID + " imdb.GetUserByUserID failed " + err.Error() + req.UserID - log.NewError(req.OperationID, errMsg) - c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.ErrDB.ErrCode, "errMsg": errMsg}) - return - } - - if err := imdb.UpdateIpReocord(req.UserID, ip); err != nil { - log.NewError(req.OperationID, err.Error(), req.UserID, ip) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrDB.ErrCode, "errMsg": err.Error()}) - return - } - - var Limited bool - var LimitError error - // 指定账户指定ip才能登录 - Limited, LimitError = imdb.IsLimitUserLoginIp(user.UserID, ip) - if LimitError != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), LimitError, ip) - c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.ErrDB.ErrCode, "errMsg": LimitError}) - return - } - if Limited { - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), Limited, ip, req.UserID) - c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.LoginLimit, "errMsg": "user ip limited Login"}) - return - } - - // 该ip不能登录 - Limited, LimitError = imdb.IsLimitLoginIp(ip) - if LimitError != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), LimitError, ip) - c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.ErrDB.ErrCode, "errMsg": LimitError}) - return - } - if Limited { - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), Limited, ip, req.UserID) - c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.LoginLimit, "errMsg": "ip limited Login"}) - return - } - - Limited, LimitError = imdb.UserIsBlock(user.UserID) - if LimitError != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), LimitError, user.UserID) - c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.ErrDB.ErrCode, "errMsg": LimitError}) - return - } - if Limited { - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), Limited, ip, req.UserID) - c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.LoginLimit, "errMsg": "user is block"}) - return - } - c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": ""}) -} diff --git a/internal/demo/register/invitation_code.go b/internal/demo/register/invitation_code.go deleted file mode 100644 index 092f45191..000000000 --- a/internal/demo/register/invitation_code.go +++ /dev/null @@ -1,123 +0,0 @@ -package register - -import ( - apiStruct "Open_IM/pkg/base_info" - "Open_IM/pkg/common/constant" - imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - "Open_IM/pkg/utils" - "net/http" - "time" - - "github.com/gin-gonic/gin" -) - -type InvitationCode struct { - InvitationCode string `json:"invitationCode"` - CreateTime time.Time `json:"createTime"` - UserID string `json:"userID"` - LastTime time.Time `json:"lastTime"` - Status int32 `json:"status"` -} - -type GenerateInvitationCodeReq struct { - CodesNum int `json:"codesNum" binding:"required"` - CodeLen int `json:"codeLen" binding:"required"` - OperationID string `json:"operationID" binding:"required"` -} - -type GenerateInvitationCodeResp struct { - Codes []string `json:"codes"` -} - -func GenerateInvitationCode(c *gin.Context) { - req := GenerateInvitationCodeReq{} - resp := GenerateInvitationCodeResp{} - if err := c.BindJSON(&req); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()}) - return - } - var err error - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req) - resp.Codes, err = imdb.BatchCreateInvitationCodes(req.CodesNum, req.CodeLen) - if err != nil { - log.NewError(req.OperationID, "BatchCreateInvitationCodes failed", req.CodesNum, req.CodeLen) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrDB, "errMsg": "Verification code error!"}) - return - } - c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": "", "data": resp}) -} - -type QueryInvitationCodeReq struct { - Code string `json:"code" binding:"required"` - OperationID string `json:"operationID" binding:"required"` -} - -type QueryInvitationCodeResp struct { - InvitationCode -} - -func QueryInvitationCode(c *gin.Context) { - req := QueryInvitationCodeReq{} - resp := QueryInvitationCodeResp{} - if err := c.BindJSON(&req); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()}) - return - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req) - invitation, err := imdb.GetInvitationCode(req.Code) - if err != nil { - log.NewError(req.OperationID, "GetInvitationCode failed", req.Code) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrDB, "errMsg": "Verification code error!"}) - return - } - resp.UserID = invitation.UserID - resp.CreateTime = invitation.CreateTime - resp.Status = invitation.Status - resp.LastTime = invitation.LastTime - resp.InvitationCode.InvitationCode = invitation.InvitationCode - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp:", resp) - c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": "", "data": resp}) -} - -type GetInvitationCodesReq struct { - Status int32 `json:"status"` - OperationID string `json:"operationID" binding:"required"` - apiStruct.Pagination -} - -type GetInvitationCodesResp struct { - apiStruct.Pagination - Codes []InvitationCode `json:"codes"` - CodeNums int64 `json:"codeNums"` -} - -func GetInvitationCodes(c *gin.Context) { - req := GetInvitationCodesReq{} - resp := GetInvitationCodesResp{} - if err := c.BindJSON(&req); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()}) - return - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req) - codes, count, err := imdb.GetInvitationCodes(req.ShowNumber, req.PageNumber, req.Status) - if err != nil { - log.NewError(req.OperationID, "GetInvitationCode failed", req.ShowNumber, req.PageNumber, req.Status) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrDB, "errMsg": "Verification code error!"}) - return - } - resp.Pagination.PageNumber = req.PageNumber - resp.Pagination.ShowNumber = req.ShowNumber - for _, v := range codes { - resp.Codes = append(resp.Codes, InvitationCode{ - InvitationCode: v.InvitationCode, - CreateTime: v.CreateTime, - UserID: v.UserID, - LastTime: v.LastTime, - Status: v.Status, - }) - } - resp.CodeNums = count - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp:", resp) - c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": "", "data": resp}) -} diff --git a/internal/demo/register/ip_limit.go b/internal/demo/register/ip_limit.go deleted file mode 100644 index 3569bc8fb..000000000 --- a/internal/demo/register/ip_limit.go +++ /dev/null @@ -1,223 +0,0 @@ -package register - -import ( - //api "Open_IM/pkg/base_info" - "Open_IM/pkg/common/constant" - imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - "Open_IM/pkg/utils" - - "github.com/gin-gonic/gin" - - "net/http" - "time" -) - -type QueryIPRegisterReq struct { - OperationID string `json:"operationID"` - IP string `json:"ip"` -} - -type QueryIPRegisterResp struct { - IP string `json:"ip"` - RegisterNum int `json:"num"` - Status int `json:"status"` - UserIDList []string `json:"userIDList"` -} - -func QueryIPRegister(c *gin.Context) { - req := QueryIPRegisterReq{} - resp := QueryIPRegisterResp{} - if err := c.BindJSON(&req); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()}) - return - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req) - userIDList, err := imdb.GetRegisterUserNum(req.IP) - if err != nil { - log.NewError(req.OperationID, "GetInvitationCode failed", req.IP) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrDB.ErrCode, "errMsg": "GetRegisterUserNum error!"}) - return - } - resp.IP = req.IP - resp.RegisterNum = len(userIDList) - resp.UserIDList = userIDList - ipLimit, err := imdb.QueryIPLimits(req.IP) - if err != nil { - log.NewError(req.OperationID, "QueryIPLimits failed", req.IP, err.Error()) - } else { - if ipLimit != nil { - if ipLimit.Ip != "" { - resp.Status = 1 - } - } - - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp:", resp) - c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": "", "data": resp}) -} - -type AddIPLimitReq struct { - OperationID string `json:"operationID"` - IP string `json:"ip"` - LimitTime int32 `json:"limitTime"` -} - -type AddIPLimitResp struct { -} - -func AddIPLimit(c *gin.Context) { - req := AddIPLimitReq{} - //resp := AddIPLimitResp{} - if err := c.BindJSON(&req); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()}) - return - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req) - if err := imdb.InsertOneIntoIpLimits(imdb.IpLimit{ - Ip: req.IP, - LimitRegister: 1, - LimitLogin: 1, - CreateTime: time.Now(), - LimitTime: utils.UnixSecondToTime(int64(req.LimitTime)), - }); err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.IP, req.LimitTime) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrDB.ErrCode, "errMsg": "InsertOneIntoIpLimits error!"}) - return - } - c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": ""}) -} - -type RemoveIPLimitReq struct { - OperationID string `json:"operationID"` - IP string `json:"ip"` -} - -type RemoveIPLimitResp struct { -} - -func RemoveIPLimit(c *gin.Context) { - req := RemoveIPLimitReq{} - //resp := AddIPLimitResp{} - if err := c.BindJSON(&req); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.ErrArgs, "errMsg": err.Error()}) - return - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req) - if err := imdb.DeleteOneFromIpLimits(req.IP); err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.IP) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrDB.ErrCode, "errMsg": "InsertOneIntoIpLimits error!"}) - return - } - c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": ""}) -} - -// ===========================================sk ========================== - -type QueryUserIDIPLimitLoginReq struct { - UserID string `json:"userID" binding:"required"` - OperationID string `json:"operationID" binding:"required"` -} - -//type QueryUserIDIPLimitLoginResp struct { -// UserIpLimit []db.UserIpLimit `json:"userIpLimit"` -//} - -func QueryUserIDLimitLogin(c *gin.Context) { - req := QueryUserIDIPLimitLoginReq{} - if err := c.BindJSON(&req); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()}) - return - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req) - resp, err := imdb.GetIpLimitsLoginByUserID(req.UserID) - if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.UserID) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrDB.ErrCode, "errMsg": "GetIpLimitsByUserID error!"}) - return - } - if len(resp) > 0 { - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp:", resp) - c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": "", "data": resp}) - return - } - c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": "", "data": gin.H{"limit": resp}}) -} - -type AddUserIPLimitLoginReq struct { - UserID string `json:"userID" binding:"required"` - OperationID string `json:"operationID" binding:"required"` - IP string `json:"ip"` -} - -type AddUserIPLimitLoginResp struct { -} - -// 添加ip 特定用户才能登录 user_ip_limits 表 -func AddUserIPLimitLogin(c *gin.Context) { - req := AddUserIPLimitLoginReq{} - if err := c.BindJSON(&req); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()}) - return - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req) - userIp := imdb.UserIpLimit{UserID: req.UserID, Ip: req.IP} - err := imdb.UpdateUserInfo(imdb.User{ - UserID: req.UserID, - // LoginLimit: 1, - }) - if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.UserID) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrDB, "errMsg": "InsertUserIpLimitsLogin error!"}) - return - } - err = imdb.InsertUserIpLimitsLogin(&userIp) - if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.UserID) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrDB, "errMsg": "InsertUserIpLimitsLogin error!"}) - return - } - c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": ""}) -} - -type RemoveUserIPLimitReq struct { - UserID string `json:"userID" binding:"required"` - OperationID string `json:"operationID" binding:"required"` - IP string `json:"ip"` -} - -type RemoveUserIPLimitResp struct { -} - -// 删除ip 特定用户才能登录 user_ip_limits 表 -func RemoveUserIPLimitLogin(c *gin.Context) { - req := RemoveUserIPLimitReq{} - if err := c.BindJSON(&req); err != nil { - c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()}) - return - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req) - err := imdb.DeleteUserIpLimitsLogin(req.UserID, req.IP) - if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.UserID) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrDB, "errMsg": "DeleteUserIpLimitsLogin error!"}) - return - } - ips, err := imdb.GetIpLimitsLoginByUserID(req.UserID) - if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.UserID) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrDB, "errMsg": "GetIpLimitsLoginByUserID error!"}) - return - } - if len(ips) == 0 { - err := imdb.UpdateUserInfoByMap(imdb.User{ - UserID: req.UserID, - }, map[string]interface{}{"login_limit": 0}) - if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.UserID) - c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrDB, "errMsg": "UpdateUserInfo error!"}) - return - } - } - c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": ""}) -} diff --git a/internal/demo/register/onboarding_process.go b/internal/demo/register/onboarding_process.go deleted file mode 100644 index 754c8db80..000000000 --- a/internal/demo/register/onboarding_process.go +++ /dev/null @@ -1,313 +0,0 @@ -package register - -import ( - "Open_IM/internal/api/manage" - "Open_IM/internal/rpc/msg" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/constant" - imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - "Open_IM/pkg/common/log" - "Open_IM/pkg/getcdv3" - groupRpc "Open_IM/pkg/proto/group" - - organizationRpc "Open_IM/pkg/proto/organization" - commonPb "Open_IM/pkg/proto/sdk_ws" - "Open_IM/pkg/utils" - "context" - "errors" - "fmt" - "math/rand" - "strings" - "time" - - "github.com/golang/protobuf/proto" -) - -type OnboardingProcessReq struct { - OperationID string - UserID string - NickName string - FaceURL string - PhoneNumber string - Email string -} - -var Ch chan OnboardingProcessReq - -func init() { - Ch = make(chan OnboardingProcessReq, 1000) -} - -func OnboardingProcessRoutine() { - for { - req := <-Ch - go func() { - onboardingProcess(req.OperationID, req.UserID, req.NickName, req.FaceURL, req.PhoneNumber, req.Email) - }() - } -} - -func onboardingProcess(operationID, userID, userName, faceURL, phoneNumber, email string) { - log.NewInfo(operationID, utils.GetSelfFuncName(), userName, userID, faceURL) - - var joinDepartmentIDList []string - if len(config.Config.Demo.JoinDepartmentIDList) == 0 { - departmentID, err := imdb.GetRandomDepartmentID() - if err != nil { - log.NewError(utils.GetSelfFuncName(), "GetRandomDepartmentID failed", err.Error()) - return - } - joinDepartmentIDList = []string{departmentID} - } else { - joinDepartmentIDList = config.Config.Demo.JoinDepartmentIDList - } - if config.Config.Demo.CreateOrganizationUserAndJoinDepartment && len(joinDepartmentIDList) > 0 { - if err := createOrganizationUser(operationID, userID, userName, phoneNumber, email); err != nil { - log.NewError(operationID, utils.GetSelfFuncName(), "createOrganizationUser failed", err.Error()) - } - for _, departmentID := range joinDepartmentIDList { - if err := joinTestDepartment(operationID, userID, departmentID); err != nil { - log.NewError(operationID, utils.GetSelfFuncName(), "joinTestDepartment failed", err.Error()) - } - } - } - - if config.Config.Demo.JoinDepartmentGroups { - for _, departmentID := range joinDepartmentIDList { - groupIDList, err := GetDepartmentGroupIDList(operationID, departmentID) - if err != nil { - log.NewError(operationID, utils.GetSelfFuncName(), err.Error()) - } - log.Debug(operationID, utils.GetSelfFuncName(), "getjoinGroupIDListdepartmentID", groupIDList) - joinGroups(operationID, userID, userName, faceURL, groupIDList) - log.NewInfo(operationID, utils.GetSelfFuncName(), "fineshed") - } - } - - if config.Config.Demo.OaNotification { - oaNotification(operationID, userID) - } -} - -func createOrganizationUser(operationID, userID, userName, phoneNumber, email string) error { - defer func() { - log.NewInfo(operationID, utils.GetSelfFuncName(), userID) - }() - log.NewInfo(operationID, utils.GetSelfFuncName(), "start createOrganizationUser") - etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, operationID) - if etcdConn == nil { - errMsg := operationID + "getcdv3.GetDefaultConn == nil" - log.NewError(operationID, errMsg) - return errors.New(errMsg) - } - client := organizationRpc.NewOrganizationClient(etcdConn) - req := &organizationRpc.CreateOrganizationUserReq{ - OrganizationUser: &commonPb.OrganizationUser{ - UserID: userID, - Nickname: userName, - EnglishName: randomEnglishName(), - Gender: constant.Male, - CreateTime: uint32(time.Now().Unix()), - Telephone: phoneNumber, - Mobile: phoneNumber, - Email: email, - }, - OperationID: operationID, - OpUserID: config.Config.Manager.AppManagerUid[0], - IsRegister: false, - } - - resp, err := client.CreateOrganizationUser(context.Background(), req) - if err != nil { - log.NewError(operationID, utils.GetSelfFuncName(), err.Error()) - return err - } - if resp.ErrCode != 0 { - log.NewError(req.OperationID, utils.GetSelfFuncName(), resp) - return errors.New(resp.ErrMsg) - } - return nil -} - -func joinTestDepartment(operationID, userID, departmentID string) error { - defer func() { - log.NewInfo(operationID, utils.GetSelfFuncName(), userID) - }() - etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, operationID) - if etcdConn == nil { - errMsg := operationID + "getcdv3.GetDefaultConn == nil" - log.NewError(operationID, errMsg) - return errors.New(errMsg) - } - client := organizationRpc.NewOrganizationClient(etcdConn) - req := &organizationRpc.CreateDepartmentMemberReq{ - DepartmentMember: &commonPb.DepartmentMember{ - UserID: userID, - DepartmentID: departmentID, - Position: randomPosition(), - }, - OperationID: operationID, - OpUserID: config.Config.Manager.AppManagerUid[0], - } - resp, err := client.CreateDepartmentMember(context.Background(), req) - if err != nil { - log.NewError(operationID, utils.GetSelfFuncName(), err.Error()) - return err - } - if resp.ErrCode != 0 { - log.NewError(req.OperationID, utils.GetSelfFuncName(), resp) - return errors.New(resp.ErrMsg) - } - return nil -} - -func GetDepartmentGroupIDList(operationID, departmentID string) ([]string, error) { - defer func() { - log.NewInfo(operationID, utils.GetSelfFuncName(), departmentID) - }() - etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName, operationID) - if etcdConn == nil { - errMsg := operationID + "getcdv3.GetDefaultConn == nil" - log.NewError(operationID, errMsg) - return nil, errors.New(errMsg) - } - client := organizationRpc.NewOrganizationClient(etcdConn) - req := organizationRpc.GetDepartmentParentIDListReq{ - DepartmentID: departmentID, - OperationID: operationID, - } - resp, err := client.GetDepartmentParentIDList(context.Background(), &req) - if err != nil { - log.NewError(operationID, utils.GetSelfFuncName(), err.Error(), req.String()) - return nil, err - } - if resp.ErrCode != 0 { - log.NewError(req.OperationID, utils.GetSelfFuncName(), resp) - return nil, errors.New(resp.ErrMsg) - } - - resp.ParentIDList = append(resp.ParentIDList, departmentID) - getDepartmentRelatedGroupIDListReq := organizationRpc.GetDepartmentRelatedGroupIDListReq{OperationID: operationID, DepartmentIDList: resp.ParentIDList} - getDepartmentParentIDListResp, err := client.GetDepartmentRelatedGroupIDList(context.Background(), &getDepartmentRelatedGroupIDListReq) - if err != nil { - log.NewError(operationID, utils.GetSelfFuncName(), err.Error(), getDepartmentRelatedGroupIDListReq.String()) - return nil, err - } - if getDepartmentParentIDListResp.ErrCode != 0 { - log.NewError(req.OperationID, utils.GetSelfFuncName(), getDepartmentParentIDListResp) - return nil, errors.New(getDepartmentParentIDListResp.ErrMsg) - } - return getDepartmentParentIDListResp.GroupIDList, nil -} - -func joinGroups(operationID, userID, userName, faceURL string, groupIDList []string) { - defer func() { - log.NewInfo(operationID, utils.GetSelfFuncName(), userID, groupIDList) - }() - etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, operationID) - if etcdConn == nil { - errMsg := operationID + "getcdv3.GetDefaultConn == nil" - log.NewError(operationID, errMsg) - return - } - client := groupRpc.NewGroupClient(etcdConn) - for _, groupID := range groupIDList { - req := &groupRpc.InviteUserToGroupReq{ - OperationID: operationID, - GroupID: groupID, - Reason: "register auto join", - InvitedUserIDList: []string{userID}, - OpUserID: config.Config.Manager.AppManagerUid[1], - } - resp, err := client.InviteUserToGroup(context.Background(), req) - if err != nil { - log.NewError(operationID, utils.GetSelfFuncName(), err.Error(), req.String()) - continue - } - if resp.ErrCode != 0 { - log.NewError(req.OperationID, utils.GetSelfFuncName(), resp) - continue - } - onboardingProcessNotification(operationID, userID, groupID, userName, faceURL) - } -} - -// welcome user join department notification -func onboardingProcessNotification(operationID, userID, groupID, userName, faceURL string) { - defer func() { - log.NewInfo(operationID, utils.GetSelfFuncName(), userID, groupID) - }() - //var tips commonPb.TipsComm - //tips.DefaultTips = config.Config.Notification.JoinDepartmentNotification.DefaultTips.Tips - //tips.JsonDetail = "" - //content, err := proto.Marshal(&tips) - //if err != nil { - // log.NewError(operationID, utils.GetSelfFuncName(), err.Error(), "proto marshal failed") - // return - //} - welcomeString := fmt.Sprintf("欢迎%s加入部门", userName) - notification := &msg.NotificationMsg{ - SendID: userID, - RecvID: groupID, - Content: []byte(welcomeString), - MsgFrom: constant.UserMsgType, - ContentType: constant.Text, - SessionType: constant.SuperGroupChatType, - OperationID: operationID, - SenderNickname: userName, - SenderFaceURL: faceURL, - } - - // notification user join group - msg.Notification(notification) - -} - -func oaNotification(operationID, userID string) { - var err error - elem := manage.OANotificationElem{ - NotificationName: "入职通知", - NotificationFaceURL: "", - NotificationType: 1, - Text: "欢迎你入职公司", - Url: "", - MixType: 0, - PictureElem: manage.PictureElem{}, - SoundElem: manage.SoundElem{}, - VideoElem: manage.VideoElem{}, - FileElem: manage.FileElem{}, - Ex: "", - } - sysNotification := &msg.NotificationMsg{ - SendID: config.Config.Manager.AppManagerUid[0], - RecvID: userID, - MsgFrom: constant.SysMsgType, - ContentType: constant.OANotification, - SessionType: constant.NotificationChatType, - OperationID: operationID, - } - var tips commonPb.TipsComm - tips.JsonDetail = utils.StructToJsonString(elem) - sysNotification.Content, err = proto.Marshal(&tips) - if err != nil { - log.NewError(operationID, utils.GetSelfFuncName(), "elem: ", elem, err.Error()) - return - } - - msg.Notification(sysNotification) -} - -func randomEnglishName() string { - l := []string{"abandon", "entail", "nebula", "shrink", "accumulate", "etch", "nostalgia", "slide", - "feudal", "adverse", "exploit", "occupy", "solve", "amazing", "fantasy", "orchid", "spiky", "approve", "flap"} - rand.Seed(time.Now().UnixNano()) - index := rand.Intn(len(l) - 1) - return l[index] -} - -func randomPosition() string { - l := []string{"后端工程师", "前端工程师", "设计师"} - rand.Seed(time.Now().UnixNano()) - index := rand.Intn(len(l) - 1) - return l[index] -} diff --git a/internal/msg_gateway/gate/callback.go b/internal/msg_gateway/gate/callback.go index 20d4837f1..345e8c732 100644 --- a/internal/msg_gateway/gate/callback.go +++ b/internal/msg_gateway/gate/callback.go @@ -1,7 +1,7 @@ package gate import ( - cbApi "Open_IM/pkg/call_back_struct" + cbApi "Open_IM/pkg/callback_struct" "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" "Open_IM/pkg/common/http" diff --git a/internal/push/logic/callback.go b/internal/push/logic/callback.go index 0f0649558..661a98261 100644 --- a/internal/push/logic/callback.go +++ b/internal/push/logic/callback.go @@ -1,7 +1,7 @@ package logic import ( - cbApi "Open_IM/pkg/call_back_struct" + cbApi "Open_IM/pkg/callback_struct" "Open_IM/pkg/common/callback" "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" diff --git a/internal/rpc/friend/callback.go b/internal/rpc/friend/callback.go index 8e75a44b4..7ff50381d 100644 --- a/internal/rpc/friend/callback.go +++ b/internal/rpc/friend/callback.go @@ -1,7 +1,7 @@ package friend import ( - cbApi "Open_IM/pkg/call_back_struct" + cbApi "Open_IM/pkg/callback_struct" "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" "Open_IM/pkg/common/http" diff --git a/internal/rpc/group/callback.go b/internal/rpc/group/callback.go index 4240bd2ab..0c87535c0 100644 --- a/internal/rpc/group/callback.go +++ b/internal/rpc/group/callback.go @@ -1,7 +1,7 @@ package group import ( - cbApi "Open_IM/pkg/call_back_struct" + cbApi "Open_IM/pkg/callback_struct" "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" "Open_IM/pkg/common/db/mysql_model/im_mysql_model" diff --git a/internal/rpc/msg/callback.go b/internal/rpc/msg/callback.go index 4570449e3..ea742e189 100644 --- a/internal/rpc/msg/callback.go +++ b/internal/rpc/msg/callback.go @@ -1,7 +1,7 @@ package msg import ( - cbApi "Open_IM/pkg/call_back_struct" + cbApi "Open_IM/pkg/callback_struct" "Open_IM/pkg/common/callback" "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" diff --git a/internal/rpc/msg/extend_msg_callback.go b/internal/rpc/msg/extend_msg_callback.go index eccb3b38b..ceb65c3fc 100644 --- a/internal/rpc/msg/extend_msg_callback.go +++ b/internal/rpc/msg/extend_msg_callback.go @@ -1,7 +1,7 @@ package msg import ( - cbApi "Open_IM/pkg/call_back_struct" + cbApi "Open_IM/pkg/callback_struct" "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" "Open_IM/pkg/common/http" diff --git a/internal/rpc/organization/organization.go b/internal/rpc/organization/organization.go deleted file mode 100644 index c4547d5a0..000000000 --- a/internal/rpc/organization/organization.go +++ /dev/null @@ -1,574 +0,0 @@ -package organization - -import ( - chat "Open_IM/internal/rpc/msg" - "Open_IM/pkg/common/config" - "Open_IM/pkg/common/constant" - imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" - rocksCache "Open_IM/pkg/common/db/rocks_cache" - "Open_IM/pkg/common/log" - promePkg "Open_IM/pkg/common/prometheus" - "Open_IM/pkg/common/token_verify" - "Open_IM/pkg/getcdv3" - pbAuth "Open_IM/pkg/proto/auth" - groupRpc "Open_IM/pkg/proto/group" - rpc "Open_IM/pkg/proto/organization" - open_im_sdk "Open_IM/pkg/proto/sdk_ws" - "Open_IM/pkg/utils" - "context" - "net" - "strconv" - "strings" - "time" - - grpcPrometheus "github.com/grpc-ecosystem/go-grpc-prometheus" - - "google.golang.org/grpc" -) - -type organizationServer struct { - rpcPort int - rpcRegisterName string - etcdSchema string - etcdAddr []string -} - -func NewServer(port int) *organizationServer { - log.NewPrivateLog(constant.LogFileName) - return &organizationServer{ - rpcPort: port, - rpcRegisterName: config.Config.RpcRegisterName.OpenImOrganizationName, - etcdSchema: config.Config.Etcd.EtcdSchema, - etcdAddr: config.Config.Etcd.EtcdAddr, - } -} - -func (s *organizationServer) Run() { - log.NewInfo("", "organization rpc start ") - listenIP := "" - if config.Config.ListenIP == "" { - listenIP = "0.0.0.0" - } else { - listenIP = config.Config.ListenIP - } - address := listenIP + ":" + strconv.Itoa(s.rpcPort) - //listener network - listener, err := net.Listen("tcp", address) - if err != nil { - panic("listening err:" + err.Error() + s.rpcRegisterName) - } - log.NewInfo("", "listen network success, ", address, listener) - defer listener.Close() - //grpc server - var grpcOpts []grpc.ServerOption - if config.Config.Prometheus.Enable { - promePkg.NewGrpcRequestCounter() - promePkg.NewGrpcRequestFailedCounter() - promePkg.NewGrpcRequestSuccessCounter() - grpcOpts = append(grpcOpts, []grpc.ServerOption{ - // grpc.UnaryInterceptor(promePkg.UnaryServerInterceptorProme), - grpc.StreamInterceptor(grpcPrometheus.StreamServerInterceptor), - grpc.UnaryInterceptor(grpcPrometheus.UnaryServerInterceptor), - }...) - } - srv := grpc.NewServer(grpcOpts...) - defer srv.GracefulStop() - //Service registers with etcd - rpc.RegisterOrganizationServer(srv, s) - rpcRegisterIP := config.Config.RpcRegisterIP - if config.Config.RpcRegisterIP == "" { - rpcRegisterIP, err = utils.GetLocalIP() - if err != nil { - log.Error("", "GetLocalIP failed ", err.Error()) - } - } - log.NewInfo("", "rpcRegisterIP", rpcRegisterIP) - err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) - if err != nil { - log.NewError("", "RegisterEtcd failed ", err.Error()) - panic(utils.Wrap(err, "register organization module rpc to etcd err")) - } - log.NewInfo("", "organization rpc RegisterEtcd success", rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10) - err = srv.Serve(listener) - if err != nil { - log.NewError("", "Serve failed ", err.Error()) - return - } - log.NewInfo("", "organization rpc success") -} - -func (s *organizationServer) CreateDepartment(ctx context.Context, req *rpc.CreateDepartmentReq) (*rpc.CreateDepartmentResp, error) { - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) - if !token_verify.IsManagerUserID(req.OpUserID) { - errMsg := req.OperationID + " " + req.OpUserID + " is not app manager" - log.Error(req.OperationID, errMsg) - return &rpc.CreateDepartmentResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}, nil - } - - department := imdb.Department{} - utils.CopyStructFields(&department, req.DepartmentInfo) - if department.DepartmentID == "" { - department.DepartmentID = utils.Md5(strconv.FormatInt(time.Now().UnixNano(), 10)) - } - log.Debug(req.OperationID, "dst ", department, "src ", req.DepartmentInfo) - if err := imdb.CreateDepartment(&department); err != nil { - errMsg := req.OperationID + " " + "CreateDepartment failed " + err.Error() - log.Error(req.OperationID, errMsg) - return &rpc.CreateDepartmentResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil - } - createdDepartment, err := imdb.GetDepartment(department.DepartmentID) - if err != nil { - errMsg := req.OperationID + " " + "GetDepartment failed " + err.Error() + department.DepartmentID - log.Error(req.OperationID, errMsg) - return &rpc.CreateDepartmentResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil - } - log.Debug(req.OperationID, "GetDepartment ", department.DepartmentID, *createdDepartment) - resp := &rpc.CreateDepartmentResp{DepartmentInfo: &open_im_sdk.Department{}} - utils.CopyStructFields(resp.DepartmentInfo, createdDepartment) - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", *resp) - if err := rocksCache.DelAllDepartmentsFromCache(); err != nil { - errMsg := req.OperationID + " " + "UpdateDepartment failed " + err.Error() - log.Error(req.OperationID, errMsg) - return &rpc.CreateDepartmentResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil - } - chat.OrganizationNotificationToAll(req.OpUserID, req.OperationID) - etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, req.OperationID) - if etcdConn == nil { - errMsg := req.OperationID + "getcdv3.GetDefaultConn == nil" - log.NewError(req.OperationID, errMsg) - resp.ErrCode = constant.ErrInternal.ErrCode - resp.ErrMsg = errMsg - return resp, nil - } - client := groupRpc.NewGroupClient(etcdConn) - createGroupReq := &groupRpc.CreateGroupReq{ - InitMemberList: []*groupRpc.GroupAddMemberInfo{}, - GroupInfo: &open_im_sdk.GroupInfo{ - Introduction: req.DepartmentInfo.Name, - GroupName: req.DepartmentInfo.Name, - FaceURL: req.DepartmentInfo.FaceURL, - CreateTime: uint32(time.Now().Unix()), - CreatorUserID: req.OpUserID, - GroupType: constant.NormalGroup, - OwnerUserID: req.OpUserID, - }, - OperationID: req.OperationID, - OpUserID: req.OpUserID, - OwnerUserID: req.OpUserID, - } - createGroupResp, err := client.CreateGroup(context.Background(), createGroupReq) - if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), "CreateGroup rpc failed", createGroupReq, err.Error()) - resp.ErrCode = constant.ErrDB.ErrCode - resp.ErrMsg = constant.ErrDB.ErrMsg + " createGroup failed " + err.Error() - return resp, nil - } - if createGroupResp.ErrCode != 0 { - log.NewError(req.OperationID, utils.GetSelfFuncName(), resp) - resp.ErrCode = constant.ErrDB.ErrCode - resp.ErrMsg = constant.ErrDB.ErrMsg + " createGroup failed " + createGroupResp.ErrMsg - return resp, nil - } - if err := imdb.SetDepartmentRelatedGroupID(createGroupResp.GroupInfo.GroupID, department.DepartmentID); err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetDepartmentRelatedGroupID failed", err.Error()) - } - return resp, nil -} - -func (s *organizationServer) UpdateDepartment(ctx context.Context, req *rpc.UpdateDepartmentReq) (*rpc.UpdateDepartmentResp, error) { - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) - if !token_verify.IsManagerUserID(req.OpUserID) { - errMsg := req.OperationID + " " + req.OpUserID + " is not app manager" - log.Error(req.OperationID, errMsg) - return &rpc.UpdateDepartmentResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}, nil - } - - department := imdb.Department{} - utils.CopyStructFields(&department, req.DepartmentInfo) - log.Debug(req.OperationID, "dst ", department, "src ", req.DepartmentInfo) - if err := imdb.UpdateDepartment(&department, nil); err != nil { - errMsg := req.OperationID + " " + "UpdateDepartment failed " + err.Error() - log.Error(req.OperationID, errMsg, department) - return &rpc.UpdateDepartmentResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil - } - if err := rocksCache.DelAllDepartmentsFromCache(); err != nil { - errMsg := req.OperationID + " " + "UpdateDepartment failed " + err.Error() - log.Error(req.OperationID, errMsg) - return &rpc.UpdateDepartmentResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil - } - resp := &rpc.UpdateDepartmentResp{} - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", *resp) - chat.OrganizationNotificationToAll(req.OpUserID, req.OperationID) - return resp, nil -} - -func (s *organizationServer) GetSubDepartment(ctx context.Context, req *rpc.GetSubDepartmentReq) (*rpc.GetSubDepartmentResp, error) { - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) - var departmentList []imdb.Department - var err error - if req.DepartmentID == "-1" { - departmentList, err = rocksCache.GetAllDepartmentsFromCache() - if err != nil { - errMsg := req.OperationID + " " + "GetDepartment failed " + err.Error() - log.Error(req.OperationID, errMsg) - return &rpc.GetSubDepartmentResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil - } - } else { - departmentList, err = imdb.GetSubDepartmentList(req.DepartmentID) - if err != nil { - errMsg := req.OperationID + " " + "GetDepartment failed " + err.Error() - log.Error(req.OperationID, errMsg) - return &rpc.GetSubDepartmentResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil - } - } - - log.Debug(req.OperationID, "GetSubDepartmentList ", req.DepartmentID, departmentList) - resp := &rpc.GetSubDepartmentResp{} - for _, v := range departmentList { - v1 := open_im_sdk.Department{} - utils.CopyStructFields(&v1, v) - log.Debug(req.OperationID, "src ", v, "dst ", v1) - err, v1.MemberNum = imdb.GetDepartmentMemberNum(v1.DepartmentID) - if err != nil { - log.Error(req.OperationID, "GetDepartmentMemberNum failed ", err.Error(), v1.DepartmentID) - continue - } - err, v1.SubDepartmentNum = imdb.GetSubDepartmentNum(v1.DepartmentID) - if err != nil { - log.Error(req.OperationID, "GetSubDepartmentNum failed ", err.Error(), v1.DepartmentID) - continue - } - resp.DepartmentList = append(resp.DepartmentList, &v1) - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", *resp) - return resp, nil -} - -func (s *organizationServer) DeleteDepartment(ctx context.Context, req *rpc.DeleteDepartmentReq) (*rpc.DeleteDepartmentResp, error) { - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) - if !token_verify.IsManagerUserID(req.OpUserID) { - errMsg := req.OperationID + " " + req.OpUserID + " is not app manager" - log.Error(req.OperationID, errMsg) - return &rpc.DeleteDepartmentResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}, nil - } - err := imdb.DeleteDepartment(req.DepartmentID) - if err != nil { - errMsg := req.OperationID + " " + "DeleteDepartment failed " + err.Error() - log.Error(req.OperationID, errMsg, req.DepartmentID) - return &rpc.DeleteDepartmentResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil - } - log.Debug(req.OperationID, "DeleteDepartment ", req.DepartmentID) - - if err := rocksCache.DelAllDepartmentsFromCache(); err != nil { - errMsg := req.OperationID + " " + "UpdateDepartment failed " + err.Error() - log.Error(req.OperationID, errMsg) - return &rpc.DeleteDepartmentResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil - } - resp := &rpc.DeleteDepartmentResp{} - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", resp) - chat.OrganizationNotificationToAll(req.OpUserID, req.OperationID) - return resp, nil -} - -func (s *organizationServer) CreateOrganizationUser(ctx context.Context, req *rpc.CreateOrganizationUserReq) (*rpc.CreateOrganizationUserResp, error) { - authReq := &pbAuth.UserRegisterReq{UserInfo: &open_im_sdk.UserInfo{}} - utils.CopyStructFields(authReq.UserInfo, req.OrganizationUser) - authReq.OperationID = req.OperationID - if req.IsRegister { - etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName, req.OperationID) - if etcdConn == nil { - errMsg := req.OperationID + "getcdv3.GetDefaultConn == nil" - log.NewError(req.OperationID, errMsg) - return &rpc.CreateOrganizationUserResp{ErrCode: constant.ErrInternal.ErrCode, ErrMsg: errMsg}, nil - } - client := pbAuth.NewAuthClient(etcdConn) - reply, err := client.UserRegister(context.Background(), authReq) - if err != nil { - errMsg := "UserRegister failed " + err.Error() - log.NewError(req.OperationID, errMsg) - return &rpc.CreateOrganizationUserResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil - } - if reply.CommonResp.ErrCode != 0 { - errMsg := "UserRegister failed " + reply.CommonResp.ErrMsg - log.NewError(req.OperationID, errMsg) - return &rpc.CreateOrganizationUserResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil - } - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) - if !token_verify.IsManagerUserID(req.OpUserID) { - errMsg := req.OperationID + " " + req.OpUserID + " is not app manager" - log.Error(req.OperationID, errMsg) - return &rpc.CreateOrganizationUserResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}, nil - } - organizationUser := imdb.OrganizationUser{} - utils.CopyStructFields(&organizationUser, req.OrganizationUser) - organizationUser.Birth = utils.UnixSecondToTime(int64(req.OrganizationUser.Birth)) - log.Debug(req.OperationID, "src ", *req.OrganizationUser, "dst ", organizationUser) - err := imdb.CreateOrganizationUser(&organizationUser) - if err != nil { - errMsg := req.OperationID + " " + "CreateOrganizationUser failed " + err.Error() - log.Error(req.OperationID, errMsg, organizationUser) - return &rpc.CreateOrganizationUserResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil - } - log.Debug(req.OperationID, "CreateOrganizationUser ", organizationUser) - resp := &rpc.CreateOrganizationUserResp{} - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", *resp) - //chat.OrganizationNotificationToAll(req.OpUserID, req.OperationID) - return resp, nil -} - -func (s *organizationServer) UpdateOrganizationUser(ctx context.Context, req *rpc.UpdateOrganizationUserReq) (*rpc.UpdateOrganizationUserResp, error) { - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) - if !token_verify.IsManagerUserID(req.OpUserID) && req.OpUserID != req.OrganizationUser.UserID { - errMsg := req.OperationID + " " + req.OpUserID + " is not app manager" - log.Error(req.OperationID, errMsg) - return &rpc.UpdateOrganizationUserResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}, nil - } - organizationUser := imdb.OrganizationUser{} - utils.CopyStructFields(&organizationUser, req.OrganizationUser) - if req.OrganizationUser.Birth != 0 { - organizationUser.Birth = utils.UnixSecondToTime(int64(req.OrganizationUser.Birth)) - log.Debug(req.OperationID, "time: ", organizationUser.Birth, req.OrganizationUser.Birth) - } - - log.Debug(req.OperationID, "src ", *req.OrganizationUser, "dst ", organizationUser) - err := imdb.UpdateOrganizationUser(&organizationUser, nil) - if err != nil { - errMsg := req.OperationID + " " + "CreateOrganizationUser failed " + err.Error() - log.Error(req.OperationID, errMsg, organizationUser) - return &rpc.UpdateOrganizationUserResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil - } - log.Debug(req.OperationID, "UpdateOrganizationUser ", organizationUser) - resp := &rpc.UpdateOrganizationUserResp{} - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", resp) - chat.OrganizationNotificationToAll(req.OpUserID, req.OperationID) - return resp, nil -} - -func (s *organizationServer) CreateDepartmentMember(ctx context.Context, req *rpc.CreateDepartmentMemberReq) (*rpc.CreateDepartmentMemberResp, error) { - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) - if !token_verify.IsManagerUserID(req.OpUserID) { - errMsg := req.OperationID + " " + req.OpUserID + " is not app manager" - log.Error(req.OperationID, errMsg) - return &rpc.CreateDepartmentMemberResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}, nil - } - - err, _ := imdb.GetOrganizationUser(req.DepartmentMember.UserID) - if err != nil { - errMsg := req.OperationID + " " + req.DepartmentMember.UserID + " is not exist" - log.Error(req.OperationID, errMsg) - return &rpc.CreateDepartmentMemberResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}, nil - } - - departmentMember := imdb.DepartmentMember{} - utils.CopyStructFields(&departmentMember, req.DepartmentMember) - log.Debug(req.OperationID, "src ", *req.DepartmentMember, "dst ", departmentMember) - err = imdb.CreateDepartmentMember(&departmentMember) - if err != nil { - errMsg := req.OperationID + " " + "CreateDepartmentMember failed " + err.Error() - log.Error(req.OperationID, errMsg, departmentMember) - return &rpc.CreateDepartmentMemberResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil - } - log.Debug(req.OperationID, "UpdateOrganizationUser ", departmentMember) - if err := rocksCache.DelAllDepartmentMembersFromCache(); err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error()) - } - resp := &rpc.CreateDepartmentMemberResp{} - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", *resp) - chat.OrganizationNotificationToAll(req.OpUserID, req.OperationID) - return resp, nil -} - -func (s *organizationServer) GetDepartmentParentIDList(_ context.Context, req *rpc.GetDepartmentParentIDListReq) (resp *rpc.GetDepartmentParentIDListResp, err error) { - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req.String()) - resp = &rpc.GetDepartmentParentIDListResp{} - parentIDList, err := imdb.GetDepartmentParentIDList(req.DepartmentID) - if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetDepartmentParentIDList failed", err.Error()) - resp.ErrMsg = constant.ErrDB.ErrMsg + ": " + err.Error() - resp.ErrCode = constant.ErrDB.ErrCode - return resp, nil - } - resp.ParentIDList = parentIDList - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp:", resp.String()) - return resp, nil -} - -func (s *organizationServer) GetUserInDepartmentByUserID(userID string, operationID string) (*open_im_sdk.UserInDepartment, error) { - err, organizationUser := imdb.GetOrganizationUser(userID) - if err != nil { - return nil, utils.Wrap(err, "GetOrganizationUser failed") - } - err, departmentMemberList := imdb.GetUserInDepartment(userID) - if err != nil { - return nil, utils.Wrap(err, "GetUserInDepartment failed") - } - log.Debug(operationID, "GetUserInDepartment ", departmentMemberList) - resp := &open_im_sdk.UserInDepartment{OrganizationUser: &open_im_sdk.OrganizationUser{}} - utils.CopyStructFields(resp.OrganizationUser, organizationUser) - for _, v := range departmentMemberList { - v1 := open_im_sdk.DepartmentMember{} - utils.CopyStructFields(&v1, v) - log.Debug(operationID, "DepartmentMember src ", v, "dst ", v1) - resp.DepartmentMemberList = append(resp.DepartmentMemberList, &v1) - } - return resp, nil -} - -func (s *organizationServer) GetUserInDepartment(ctx context.Context, req *rpc.GetUserInDepartmentReq) (*rpc.GetUserInDepartmentResp, error) { - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) - r, err := s.GetUserInDepartmentByUserID(req.UserID, req.OperationID) - if err != nil { - errMsg := req.OperationID + " " + "GetUserInDepartmentByUserID failed " + err.Error() - log.Error(req.OperationID, errMsg, req.UserID) - return &rpc.GetUserInDepartmentResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil - } - log.Debug(req.OperationID, "GetUserInDepartmentByUserID success ", req.UserID, r) - resp := rpc.GetUserInDepartmentResp{UserInDepartment: &open_im_sdk.UserInDepartment{OrganizationUser: &open_im_sdk.OrganizationUser{}}} - resp.UserInDepartment.DepartmentMemberList = r.DepartmentMemberList - resp.UserInDepartment.OrganizationUser = r.OrganizationUser - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", resp) - return &resp, nil -} - -func (s *organizationServer) UpdateUserInDepartment(ctx context.Context, req *rpc.UpdateUserInDepartmentReq) (*rpc.UpdateUserInDepartmentResp, error) { - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) - if !token_verify.IsManagerUserID(req.OpUserID) { - errMsg := req.OperationID + " " + req.OpUserID + " is not app manager" - log.Error(req.OperationID, errMsg) - return &rpc.UpdateUserInDepartmentResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}, nil - } - departmentMember := &imdb.DepartmentMember{} - utils.CopyStructFields(departmentMember, req.DepartmentMember) - log.Debug(req.OperationID, "dst ", departmentMember, "src ", req.DepartmentMember) - err := imdb.UpdateUserInDepartment(departmentMember, nil) - if err != nil { - errMsg := req.OperationID + " " + "UpdateUserInDepartment failed " + err.Error() - log.Error(req.OperationID, errMsg, *departmentMember) - return &rpc.UpdateUserInDepartmentResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil - } - resp := &rpc.UpdateUserInDepartmentResp{} - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", *resp) - chat.OrganizationNotificationToAll(req.OpUserID, req.OperationID) - return resp, nil -} - -func (s *organizationServer) DeleteUserInDepartment(ctx context.Context, req *rpc.DeleteUserInDepartmentReq) (*rpc.DeleteUserInDepartmentResp, error) { - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) - if !token_verify.IsManagerUserID(req.OpUserID) { - errMsg := req.OperationID + " " + req.OpUserID + " is not app manager" - log.Error(req.OperationID, errMsg) - return &rpc.DeleteUserInDepartmentResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}, nil - } - - err := imdb.DeleteUserInDepartment(req.DepartmentID, req.UserID) - if err != nil { - errMsg := req.OperationID + " " + "DeleteUserInDepartment failed " + err.Error() - log.Error(req.OperationID, errMsg, req.DepartmentID, req.UserID) - return &rpc.DeleteUserInDepartmentResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil - } - log.Debug(req.OperationID, "DeleteUserInDepartment success ", req.DepartmentID, req.UserID) - resp := &rpc.DeleteUserInDepartmentResp{} - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", *resp) - chat.OrganizationNotificationToAll(req.OpUserID, req.OperationID) - return resp, nil -} - -func (s *organizationServer) DeleteOrganizationUser(ctx context.Context, req *rpc.DeleteOrganizationUserReq) (*rpc.DeleteOrganizationUserResp, error) { - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) - if !token_verify.IsManagerUserID(req.OpUserID) { - errMsg := req.OperationID + " " + req.OpUserID + " is not app manager" - log.Error(req.OperationID, errMsg) - return &rpc.DeleteOrganizationUserResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}, nil - } - err := imdb.DeleteOrganizationUser(req.UserID) - if err != nil { - errMsg := req.OperationID + " " + "DeleteOrganizationUser failed " + err.Error() - log.Error(req.OperationID, errMsg, req.UserID) - return &rpc.DeleteOrganizationUserResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil - } - log.Debug(req.OperationID, "DeleteOrganizationUser success ", req.UserID) - resp := &rpc.DeleteOrganizationUserResp{} - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", *resp) - chat.OrganizationNotificationToAll(req.OpUserID, req.OperationID) - return resp, nil -} - -func (s *organizationServer) GetDepartmentMember(ctx context.Context, req *rpc.GetDepartmentMemberReq) (*rpc.GetDepartmentMemberResp, error) { - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) - var departmentMemberList []imdb.DepartmentMember - var err error - if req.DepartmentID == "-1" { - departmentMemberList, err = rocksCache.GetAllDepartmentMembersFromCache() - if err != nil { - errMsg := req.OperationID + " " + req.OpUserID + " is not app manager" - log.Error(req.OperationID, errMsg) - return &rpc.GetDepartmentMemberResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}, nil - } - } else { - departmentMemberList, err = imdb.GetDepartmentMemberList(req.DepartmentID) - if err != nil { - errMsg := req.OperationID + " " + req.OpUserID + " is not app manager" - log.Error(req.OperationID, errMsg) - return &rpc.GetDepartmentMemberResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: errMsg}, nil - } - } - - log.Debug(req.OperationID, "GetDepartmentMemberList ", departmentMemberList) - resp := rpc.GetDepartmentMemberResp{} - for _, v := range departmentMemberList { - err, organizationUser := imdb.GetOrganizationUser(v.UserID) - if err != nil { - log.Error(req.OperationID, "GetOrganizationUser failed ", err.Error()) - continue - } - respOrganizationUser := &open_im_sdk.OrganizationUser{} - respDepartmentMember := &open_im_sdk.DepartmentMember{} - - utils.CopyStructFields(respOrganizationUser, organizationUser) - utils.CopyStructFields(respDepartmentMember, &v) - userDepartmentMember := open_im_sdk.UserDepartmentMember{OrganizationUser: respOrganizationUser, DepartmentMember: respDepartmentMember} - - log.Debug(req.OperationID, "GetUserInDepartmentByUserID success ", userDepartmentMember) - resp.UserDepartmentMemberList = append(resp.UserDepartmentMemberList, &userDepartmentMember) - } - - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", resp) - return &resp, nil -} - -func (s *organizationServer) GetDepartmentRelatedGroupIDList(ctx context.Context, req *rpc.GetDepartmentRelatedGroupIDListReq) (resp *rpc.GetDepartmentRelatedGroupIDListResp, err error) { - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) - resp = &rpc.GetDepartmentRelatedGroupIDListResp{} - groupIDList, err := imdb.GetDepartmentRelatedGroupIDList(req.DepartmentIDList) - if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error()) - resp.ErrMsg = constant.ErrDB.ErrMsg + " GetDepartMentRelatedGroupIDList failed " + err.Error() - resp.ErrCode = constant.ErrDB.ErrCode - return resp, nil - } - resp.GroupIDList = groupIDList - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) - return resp, nil -} - -func (s *organizationServer) GetUserInOrganization(_ context.Context, req *rpc.GetUserInOrganizationReq) (resp *rpc.GetUserInOrganizationResp, err error) { - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) - resp = &rpc.GetUserInOrganizationResp{} - organizationUserList, err := imdb.GetOrganizationUsers(req.UserIDList) - if err != nil { - log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.UserIDList) - resp.ErrCode = constant.ErrDB.ErrCode - resp.ErrMsg = err.Error() - return resp, nil - } - for _, v := range organizationUserList { - organizationUser := &open_im_sdk.OrganizationUser{} - utils.CopyStructFields(organizationUser, v) - organizationUser.CreateTime = uint32(v.CreateTime.Unix()) - organizationUser.Birth = uint32(v.CreateTime.Unix()) - resp.OrganizationUsers = append(resp.OrganizationUsers, organizationUser) - } - log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) - return resp, nil -} diff --git a/pkg/call_back_struct/common.go b/pkg/callback_struct/common.go similarity index 98% rename from pkg/call_back_struct/common.go rename to pkg/callback_struct/common.go index 73e0f39e0..d83988a7a 100644 --- a/pkg/call_back_struct/common.go +++ b/pkg/callback_struct/common.go @@ -1,4 +1,4 @@ -package call_back_struct +package callback_struct import ( "Open_IM/pkg/common/constant" diff --git a/pkg/call_back_struct/friend.go b/pkg/callback_struct/friend.go similarity index 92% rename from pkg/call_back_struct/friend.go rename to pkg/callback_struct/friend.go index 4340fdbb2..74de6feac 100644 --- a/pkg/call_back_struct/friend.go +++ b/pkg/callback_struct/friend.go @@ -1,4 +1,4 @@ -package call_back_struct +package callback_struct type CallbackBeforeAddFriendReq struct { CallbackCommand string `json:"callbackCommand"` diff --git a/pkg/call_back_struct/group.go b/pkg/callback_struct/group.go similarity index 98% rename from pkg/call_back_struct/group.go rename to pkg/callback_struct/group.go index a040adcf0..6b239b15e 100644 --- a/pkg/call_back_struct/group.go +++ b/pkg/callback_struct/group.go @@ -1,4 +1,4 @@ -package call_back_struct +package callback_struct import ( "Open_IM/pkg/proto/group" diff --git a/pkg/call_back_struct/message.go b/pkg/callback_struct/message.go similarity index 99% rename from pkg/call_back_struct/message.go rename to pkg/callback_struct/message.go index 00e142878..b97d3446e 100644 --- a/pkg/call_back_struct/message.go +++ b/pkg/callback_struct/message.go @@ -1,4 +1,4 @@ -package call_back_struct +package callback_struct import ( "Open_IM/pkg/proto/msg" diff --git a/pkg/call_back_struct/msg_gateway.go b/pkg/callback_struct/msg_gateway.go similarity index 96% rename from pkg/call_back_struct/msg_gateway.go rename to pkg/callback_struct/msg_gateway.go index 65d173829..a3d7ee2b8 100644 --- a/pkg/call_back_struct/msg_gateway.go +++ b/pkg/callback_struct/msg_gateway.go @@ -1,4 +1,4 @@ -package call_back_struct +package callback_struct type CallbackUserOnlineReq struct { UserStatusCallbackReq diff --git a/pkg/call_back_struct/push.go b/pkg/callback_struct/push.go similarity index 98% rename from pkg/call_back_struct/push.go rename to pkg/callback_struct/push.go index 68510efda..3f2c8c4e5 100644 --- a/pkg/call_back_struct/push.go +++ b/pkg/callback_struct/push.go @@ -1,4 +1,4 @@ -package call_back_struct +package callback_struct import commonPb "Open_IM/pkg/proto/sdk_ws" diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index 1913bac79..7d3d8aa57 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -629,41 +629,138 @@ type usualConfig struct { var UsualConfig usualConfig -func unmarshalConfig(config interface{}, configName string) { - var env string - if configName == "config.yaml" { - env = "CONFIG_NAME" - } else if configName == "usualConfig.yaml" { - env = "USUAL_CONFIG_NAME" +func unmarshalConfig(config interface{}, configPath string) { + bytes, err := ioutil.ReadFile(configPath) + if err != nil { + panic(err.Error() + configPath) } - cfgName := os.Getenv(env) - if len(cfgName) != 0 { - bytes, err := ioutil.ReadFile(filepath.Join(cfgName, "config", configName)) - if err != nil { - bytes, err = ioutil.ReadFile(filepath.Join(Root, "config", configName)) - if err != nil { - panic(err.Error() + " config: " + filepath.Join(cfgName, "config", configName)) - } - } else { - Root = cfgName - } - if err = yaml.Unmarshal(bytes, config); err != nil { - panic(err.Error()) - } - } else { - bytes, err := ioutil.ReadFile(fmt.Sprintf("../config/%s", configName)) - if err != nil { - panic(err.Error() + configName) - } - if err = yaml.Unmarshal(bytes, config); err != nil { - panic(err.Error()) - } + if err = yaml.Unmarshal(bytes, config); err != nil { + panic(err.Error()) } } -func init() { - unmarshalConfig(&Config, "config.yaml") - unmarshalConfig(&UsualConfig, "usualConfig.yaml") +func initConfig(config interface{}, configName, configPath string) { + var env string + if configPath == "" { + if configName == "config.yaml" { + env = "CONFIG_NAME" + } else if configName == "usualConfig.yaml" { + env = "USUAL_CONFIG_NAME" + } + cfgName := os.Getenv(env) + if len(cfgName) != 0 { + bytes, err := ioutil.ReadFile(filepath.Join(cfgName, "config", configName)) + if err != nil { + bytes, err = ioutil.ReadFile(filepath.Join(Root, "config", configName)) + if err != nil { + panic(err.Error() + " config: " + filepath.Join(cfgName, "config", configName)) + } + } else { + Root = cfgName + } + if err = yaml.Unmarshal(bytes, config); err != nil { + panic(err.Error()) + } + return + } else { + bytes, err := ioutil.ReadFile(fmt.Sprintf("../config/%s", configName)) + if err != nil { + panic(err.Error() + configName) + } + if err = yaml.Unmarshal(bytes, config); err != nil { + panic(err.Error()) + } + } + } else { + + } + + unmarshalConfig(config, configPath) +} + +func InitConfig(configPath string) { + initConfig(&Config, "config.yaml", configPath) + initConfig(&UsualConfig, "usualConfig.yaml", configPath) + if Config.Etcd.UserName == "" { + Config.Etcd.UserName = UsualConfig.Etcd.UserName + } + if Config.Etcd.Password == "" { + Config.Etcd.Password = UsualConfig.Etcd.Password + } + if Config.Etcd.Secret == "" { + Config.Etcd.Secret = UsualConfig.Etcd.Secret + } + + if Config.Mysql.DBUserName == "" { + Config.Mysql.DBUserName = UsualConfig.Mysql.DBUserName + } + if Config.Mysql.DBPassword == "" { + Config.Mysql.DBPassword = UsualConfig.Mysql.DBPassword + } + + if Config.Redis.DBUserName == "" { + Config.Redis.DBUserName = UsualConfig.Redis.DBUserName + } + if Config.Redis.DBPassWord == "" { + Config.Redis.DBPassWord = UsualConfig.Redis.DBPassword + } + + if Config.Mongo.DBUserName == "" { + Config.Mongo.DBUserName = UsualConfig.Mongo.DBUserName + } + if Config.Mongo.DBPassword == "" { + Config.Mongo.DBPassword = UsualConfig.Mongo.DBPassword + } + + if Config.Kafka.SASLUserName == "" { + Config.Kafka.SASLUserName = UsualConfig.Kafka.SASLUserName + } + if Config.Kafka.SASLPassword == "" { + Config.Kafka.SASLPassword = UsualConfig.Kafka.SASLPassword + } + + if Config.Credential.Minio.AccessKeyID == "" { + Config.Credential.Minio.AccessKeyID = UsualConfig.Credential.Minio.AccessKeyID + } + if Config.Credential.Minio.SecretAccessKey == "" { + Config.Credential.Minio.SecretAccessKey = UsualConfig.Credential.Minio.SecretAccessKey + } + if Config.Credential.Minio.Endpoint == "" { + Config.Credential.Minio.Endpoint = UsualConfig.Credential.Minio.Endpoint + } + + if Config.MessageVerify.FriendVerify == nil { + Config.MessageVerify.FriendVerify = &UsualConfig.Messageverify.FriendVerify + } + + if Config.Push.Getui.MasterSecret == "" { + Config.Push.Getui.MasterSecret = UsualConfig.Push.Getui.MasterSecret + } + if Config.Push.Getui.AppKey == "" { + Config.Push.Getui.AppKey = UsualConfig.Push.Getui.AppKey + } + if Config.Push.Getui.PushUrl == "" { + Config.Push.Getui.PushUrl = UsualConfig.Push.Getui.PushUrl + } + if Config.Push.Getui.Enable == nil { + Config.Push.Getui.Enable = &UsualConfig.Push.Getui.Enable + } + + if Config.Secret == "" { + Config.Secret = UsualConfig.Secret + } + + if Config.TokenPolicy.AccessExpire == 0 { + Config.TokenPolicy.AccessExpire = UsualConfig.Tokenpolicy.AccessExpire + } + if Config.TokenPolicy.AccessSecret == "" { + Config.TokenPolicy.AccessSecret = UsualConfig.Tokenpolicy.AccessSecret + } +} + +func init() { + initConfig(&Config, "config.yaml", "") + initConfig(&UsualConfig, "usualConfig.yaml", "") if Config.Etcd.UserName == "" { Config.Etcd.UserName = UsualConfig.Etcd.UserName } diff --git a/pkg/common/db/mysql.go b/pkg/common/db/mysql.go index c04124f9d..c87d3f6f7 100644 --- a/pkg/common/db/mysql.go +++ b/pkg/common/db/mysql.go @@ -37,7 +37,6 @@ func initMysqlDB() { panic(err1.Error() + " open failed " + dsn) } } - sql := fmt.Sprintf("CREATE DATABASE IF NOT EXISTS %s default charset utf8 COLLATE utf8_general_ci;", config.Config.Mysql.DBDatabaseName) err = db.Exec(sql).Error if err != nil { @@ -112,39 +111,7 @@ func initMysqlDB() { if !db.Migrator().HasTable(&im_mysql_model.Conversation{}) { db.Migrator().CreateTable(&im_mysql_model.Conversation{}) } - if !db.Migrator().HasTable(&im_mysql_model.Department{}) { - db.Migrator().CreateTable(&im_mysql_model.Department{}) - } - if !db.Migrator().HasTable(&im_mysql_model.OrganizationUser{}) { - db.Migrator().CreateTable(&im_mysql_model.OrganizationUser{}) - } - if !db.Migrator().HasTable(&im_mysql_model.DepartmentMember{}) { - db.Migrator().CreateTable(&im_mysql_model.DepartmentMember{}) - } - if !db.Migrator().HasTable(&im_mysql_model.AppVersion{}) { - db.Migrator().CreateTable(&im_mysql_model.AppVersion{}) - } - if !db.Migrator().HasTable(&im_mysql_model.BlackList{}) { - db.Migrator().CreateTable(&im_mysql_model.BlackList{}) - } - if !db.Migrator().HasTable(&im_mysql_model.IpLimit{}) { - db.Migrator().CreateTable(&im_mysql_model.IpLimit{}) - } - if !db.Migrator().HasTable(&im_mysql_model.UserIpLimit{}) { - db.Migrator().CreateTable(&im_mysql_model.UserIpLimit{}) - } - if !db.Migrator().HasTable(&im_mysql_model.RegisterAddFriend{}) { - db.Migrator().CreateTable(&im_mysql_model.RegisterAddFriend{}) - } - if !db.Migrator().HasTable(&im_mysql_model.Invitation{}) { - db.Migrator().CreateTable(&im_mysql_model.Invitation{}) - } - if !db.Migrator().HasTable(&im_mysql_model.ClientInitConfig{}) { - db.Migrator().CreateTable(&im_mysql_model.ClientInitConfig{}) - } - if !db.Migrator().HasTable(&im_mysql_model.UserIpRecord{}) { - db.Migrator().CreateTable(&im_mysql_model.UserIpRecord{}) - } + DB.MysqlDB.db = db im_mysql_model.GroupDB = db.Table("groups") im_mysql_model.GroupMemberDB = db.Table("group_members") @@ -158,7 +125,6 @@ func initMysqlDB() { im_mysql_model.FriendDB = db.Table("friends") im_mysql_model.FriendRequestDB = db.Table("friend_requests") im_mysql_model.GroupRequestDB = db.Table("group_requests") - im_mysql_model.AppDB = db.Table("app_db") InitManager() } diff --git a/pkg/common/db/mysql_model/im_mysql_model/client_config.go b/pkg/common/db/mysql_model/im_mysql_model/client_config.go deleted file mode 100644 index bf334e6fc..000000000 --- a/pkg/common/db/mysql_model/im_mysql_model/client_config.go +++ /dev/null @@ -1,26 +0,0 @@ -package im_mysql_model - -import ( - "gorm.io/gorm" -) - -var InitConfigDB *gorm.DB - -func SetClientInitConfig(m map[string]interface{}) error { - result := InitConfigDB.Model(&ClientInitConfig{}).Where("1=1").Updates(m) - if result.Error != nil { - return result.Error - } - if result.RowsAffected == 0 { - err := InitConfigDB.Model(&ClientInitConfig{}).Create(m).Error - return err - } - - return nil -} - -func GetClientInitConfig() (ClientInitConfig, error) { - var config ClientInitConfig - err := InitConfigDB.Model(&ClientInitConfig{}).First(&config).Error - return config, err -} diff --git a/pkg/common/db/mysql_model/im_mysql_model/demo_model.go b/pkg/common/db/mysql_model/im_mysql_model/demo_model.go index 4695f0bfb..da3dbda25 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/demo_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/demo_model.go @@ -1,7 +1,6 @@ package im_mysql_model import ( - "errors" "gorm.io/gorm" ) @@ -23,11 +22,6 @@ func GetRegister(account, areaCode, userID string) (*Register, error) { userID, "", account, account, areaCode).Take(&r).Error } -func GetRegisterInfo(userID string) (*Register, error) { - var r Register - return &r, RegisterDB.Table("registers").Where("user_id = ?", userID).Take(&r).Error -} - func SetPassword(account, password, ex, userID, areaCode, ip string) error { r := Register{ Account: account, @@ -46,49 +40,3 @@ func ResetPassword(account, password string) error { } return RegisterDB.Table("registers").Where("account = ?", account).Updates(&r).Error } - -func GetRegisterAddFriendList(showNumber, pageNumber int32) ([]string, error) { - var IDList []string - var err error - model := RegisterDB.Model(&RegisterAddFriend{}) - if showNumber == 0 { - err = model.Pluck("user_id", &IDList).Error - } else { - err = model.Limit(int(showNumber)).Offset(int(showNumber*(pageNumber-1))).Pluck("user_id", &IDList).Error - } - return IDList, err -} - -func AddUserRegisterAddFriendIDList(userIDList ...string) error { - var list []RegisterAddFriend - for _, v := range userIDList { - list = append(list, RegisterAddFriend{UserID: v}) - } - result := RegisterDB.Create(list) - if int(result.RowsAffected) < len(userIDList) { - return errors.New("some line insert failed") - } - err := result.Error - return err -} - -func ReduceUserRegisterAddFriendIDList(userIDList ...string) error { - var list []RegisterAddFriend - for _, v := range userIDList { - list = append(list, RegisterAddFriend{UserID: v}) - } - err := RegisterDB.Delete(list).Error - return err -} - -func DeleteAllRegisterAddFriendIDList() error { - err := RegisterDB.Where("1 = 1").Delete(&RegisterAddFriend{}).Error - return err -} - -func GetUserIPLimit(userID string) (UserIpLimit, error) { - var limit UserIpLimit - limit.UserID = userID - err := RegisterDB.Model(&UserIpLimit{}).Take(&limit).Error - return limit, err -} diff --git a/pkg/common/db/mysql_model/im_mysql_model/file_model.go b/pkg/common/db/mysql_model/im_mysql_model/file_model.go index e43571957..95bd65807 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/file_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/file_model.go @@ -7,6 +7,20 @@ import ( var AppDB *gorm.DB +type AppVersion struct { + Version string `gorm:"column:version;size:64" json:"version"` + Type int `gorm:"column:type;primary_key" json:"type"` + UpdateTime int `gorm:"column:update_time" json:"update_time"` + ForceUpdate bool `gorm:"column:force_update" json:"force_update"` + FileName string `gorm:"column:file_name" json:"file_name"` + YamlName string `gorm:"column:yaml_name" json:"yaml_name"` + UpdateLog string `gorm:"column:update_log" json:"update_log"` +} + +func (AppVersion) TableName() string { + return "app_version" +} + func UpdateAppVersion(appType int, version string, forceUpdate bool, fileName, yamlName, updateLog string) error { updateTime := int(time.Now().Unix()) app := AppVersion{ diff --git a/pkg/common/db/mysql_model/im_mysql_model/group_request_model_k.go b/pkg/common/db/mysql_model/im_mysql_model/group_request_model_k.go index 2cda93fee..1b4ae79a7 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/group_request_model_k.go +++ b/pkg/common/db/mysql_model/im_mysql_model/group_request_model_k.go @@ -25,6 +25,10 @@ type GroupRequest struct { Ex string `gorm:"column:ex;size:1024"` } +func (GroupRequest) TableName() string { + return "friend_requests" +} + func (*GroupRequest) Create(ctx context.Context, groupRequests []*GroupRequest) (err error) { defer func() { trace_log.SetCtxDebug(ctx, utils.GetSelfFuncName(), err, "groupRequests", groupRequests) diff --git a/pkg/common/db/mysql_model/im_mysql_model/invitation_model.go b/pkg/common/db/mysql_model/im_mysql_model/invitation_model.go deleted file mode 100644 index 8f95948d4..000000000 --- a/pkg/common/db/mysql_model/im_mysql_model/invitation_model.go +++ /dev/null @@ -1,122 +0,0 @@ -package im_mysql_model - -import ( - "errors" - "gorm.io/gorm" - "math/rand" - "time" -) - -var InvitationDB *gorm.DB - -type Invitation struct { - InvitationCode string `gorm:"column:invitation_code;primary_key;type:varchar(32)"` - CreateTime time.Time `gorm:"column:create_time"` - UserID string `gorm:"column:user_id;index:userID"` - LastTime time.Time `gorm:"column:last_time"` - Status int32 `gorm:"column:status"` -} - -/** - * 批量生成邀请码 - */ -func BatchCreateInvitationCodes(CodeNums int, CodeLen int) ([]string, error) { - i := CodeNums - var codes []string - for { - if i == 0 { - break - } - code := CreateRandomString(CodeLen) - invitation := new(Invitation) - invitation.CreateTime = time.Now() - invitation.InvitationCode = code - invitation.LastTime = time.Now() - invitation.Status = 0 - invitation.UserID = "" - result := InvitationDB.Table("invitations").Create(&invitation) - if result.Error != nil { - continue - } - if result.RowsAffected > 0 { - i = i - 1 - } - codes = append(codes, code) - } - return codes, nil -} - -/** - * 检查邀请码 - */ -func CheckInvitationCode(code string) error { - var invitationCode Invitation - err := InvitationDB.Table("invitations").Where("invitation_code=?", code).Take(&invitationCode).Error - if err != nil { - return err - } - if invitationCode.InvitationCode != code { - return errors.New("邀请码不存在") - } - if invitationCode.Status != 0 { - return errors.New("邀请码已经被使用") - } - return nil -} - -/** - * 尝试加锁模式解决邀请码抢占的问题 - */ -func TryLockInvitationCode(Code string, UserID string) bool { - Data := make(map[string]interface{}, 0) - Data["user_id"] = UserID - Data["status"] = 1 - Data["last_time"] = time.Now() - result := InvitationDB.Table("invitations").Where("invitation_code=? and user_id=? and status=?", Code, "", 0).Updates(Data) - if result.Error != nil { - return false - } - return result.RowsAffected > 0 -} - -/** - * 完成邀请码的状态 - */ -func FinishInvitationCode(Code string, UserId string) bool { - Data := make(map[string]interface{}, 0) - Data["status"] = 2 - result := InvitationDB.Table("invitations").Where("invitation_code=? and user_id=? and status=?", Code, UserId, 1).Updates(Data) - if result.Error != nil { - return false - } - return result.RowsAffected > 0 -} - -func GetInvitationCode(code string) (*Invitation, error) { - invitation := &Invitation{ - InvitationCode: code, - } - err := InvitationDB.Model(invitation).Find(invitation).Error - return invitation, err -} - -func CreateRandomString(strlen int) string { - str := "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" - bytes := []byte(str) - result := []byte{} - r := rand.New(rand.NewSource(time.Now().UnixNano())) - for i := 0; i < strlen; i++ { - result = append(result, bytes[r.Intn(len(bytes))]) - } - return string(result) -} - -func GetInvitationCodes(showNumber, pageNumber, status int32) ([]Invitation, int64, error) { - var invitationList []Invitation - db := InvitationDB.Model(Invitation{}).Where("status=?", status) - var count int64 - err := db.Count(&count).Error - err = db.Limit(int(showNumber)).Offset(int(showNumber * (pageNumber - 1))). - Order("create_time desc").Find(&invitationList).Error - return invitationList, count, err -} diff --git a/pkg/common/db/mysql_model/im_mysql_model/ip_model.go b/pkg/common/db/mysql_model/im_mysql_model/ip_model.go deleted file mode 100644 index 4d5cf3bf3..000000000 --- a/pkg/common/db/mysql_model/im_mysql_model/ip_model.go +++ /dev/null @@ -1,131 +0,0 @@ -package im_mysql_model - -import ( - "Open_IM/pkg/utils" - "time" - - "gorm.io/gorm" -) - -var IPDB *gorm.DB - -type UserIpRecord struct { - UserID string `gorm:"column:user_id;primary_key;size:64"` - CreateIp string `gorm:"column:create_ip;size:15"` - LastLoginTime time.Time `gorm:"column:last_login_time"` - LastLoginIp string `gorm:"column:last_login_ip;size:15"` - LoginTimes int32 `gorm:"column:login_times"` -} - -// ip limit login -type IpLimit struct { - Ip string `gorm:"column:ip;primary_key;size:15"` - LimitRegister int32 `gorm:"column:limit_register;size:1"` - LimitLogin int32 `gorm:"column:limit_login;size:1"` - CreateTime time.Time `gorm:"column:create_time"` - LimitTime time.Time `gorm:"column:limit_time"` -} - -// ip login -type UserIpLimit struct { - UserID string `gorm:"column:user_id;primary_key;size:64"` - Ip string `gorm:"column:ip;primary_key;size:15"` - CreateTime time.Time `gorm:"column:create_time"` -} - -func IsLimitRegisterIp(RegisterIp string) (bool, error) { - //如果已经存在则限制 - var count int64 - if err := IPDB.Table("ip_limits").Where("ip=? and limit_register=? and limit_time>now()", RegisterIp, 1).Count(&count).Error; err != nil { - return false, err - } - return count > 0, nil -} - -func IsLimitLoginIp(LoginIp string) (bool, error) { - //如果已经存在则限制 - var count int64 - if err := IPDB.Table("ip_limits").Where("ip=? and limit_login=? and limit_time>now()", LoginIp, 1).Count(&count).Error; err != nil { - return false, err - } - return count > 0, nil -} - -func IsLimitUserLoginIp(userID string, loginIp string) (limit bool, err error) { - //如果已经存在则放行 - var count int64 - result := IPDB.Table("user_ip_limits").Where("user_id=?", userID).Count(&count) - if err := result.Error; err != nil { - return true, err - } - if count < 1 { - return false, nil - } - result = IPDB.Table("user_ip_limits").Where("user_id=? and ip = ?", userID, loginIp).Count(&count) - if err := result.Error; err != nil { - return true, err - } - - return count > 0, nil -} - -func QueryIPLimits(ip string) (*IpLimit, error) { - var ipLimit IpLimit - err := IPDB.Model(&IpLimit{}).Where("ip=?", ip).First(&ipLimit).Error - return &ipLimit, err -} - -func QueryUserIPLimits(ip string) ([]UserIpLimit, error) { - var ips []UserIpLimit - err := IPDB.Model(&UserIpLimit{}).Where("ip=?", ip).Find(&ips).Error - return ips, err -} - -func InsertOneIntoIpLimits(ipLimits IpLimit) error { - return IPDB.Model(&IpLimit{}).Create(ipLimits).Error -} - -func DeleteOneFromIpLimits(ip string) error { - ipLimits := &IpLimit{Ip: ip} - return IPDB.Model(ipLimits).Where("ip=?", ip).Delete(ipLimits).Error -} - -func GetIpLimitsLoginByUserID(userID string) ([]UserIpLimit, error) { - var ips []UserIpLimit - err := IPDB.Model(&UserIpLimit{}).Where("user_id=?", userID).Find(&ips).Error - return ips, err -} - -func InsertUserIpLimitsLogin(userIp *UserIpLimit) error { - userIp.CreateTime = time.Now() - return IPDB.Model(&UserIpLimit{}).Create(userIp).Error -} - -func DeleteUserIpLimitsLogin(userID, ip string) error { - userIp := UserIpLimit{UserID: userID, Ip: ip} - return IPDB.Model(&UserIpLimit{}).Delete(&userIp).Error -} - -func GetRegisterUserNum(ip string) ([]string, error) { - var userIDList []string - err := IPDB.Model(&Register{}).Where("register_ip=?", ip).Pluck("user_id", &userIDList).Error - return userIDList, err -} - -func InsertIpRecord(userID, createIp string) error { - record := &UserIpRecord{UserID: userID, CreateIp: createIp, LastLoginTime: time.Now(), LoginTimes: 1} - err := IPDB.Model(&UserIpRecord{}).Create(record).Error - return err -} - -func UpdateIpReocord(userID, ip string) (err error) { - record := &UserIpRecord{UserID: userID, LastLoginIp: ip, LastLoginTime: time.Now()} - result := IPDB.Model(&UserIpRecord{}).Where("user_id=?", userID).Updates(record).Update("login_times", gorm.Expr("login_times+?", 1)) - if result.Error != nil { - return utils.Wrap(result.Error, "") - } - if result.RowsAffected == 0 { - err = InsertIpRecord(userID, ip) - } - return utils.Wrap(err, "") -} diff --git a/pkg/common/db/mysql_model/im_mysql_model/model_struct.go b/pkg/common/db/mysql_model/im_mysql_model/model_struct.go index 40b05d1f1..b88b19602 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/model_struct.go +++ b/pkg/common/db/mysql_model/im_mysql_model/model_struct.go @@ -1,9 +1,5 @@ package im_mysql_model -import ( - "time" -) - //type Register struct { // Account string `gorm:"column:account;primary_key;type:char(255)" json:"account"` // Password string `gorm:"column:password;type:varchar(255)" json:"password"` @@ -277,82 +273,3 @@ import ( //func (Conversation) TableName() string { // return "conversations" //} - -type Department struct { - DepartmentID string `gorm:"column:department_id;primary_key;size:64" json:"departmentID"` - FaceURL string `gorm:"column:face_url;size:255" json:"faceURL"` - Name string `gorm:"column:name;size:256" json:"name" binding:"required"` - ParentID string `gorm:"column:parent_id;size:64" json:"parentID" binding:"required"` // "0" or Real parent id - Order int32 `gorm:"column:order" json:"order" ` // 1, 2, ... - DepartmentType int32 `gorm:"column:department_type" json:"departmentType"` //1, 2... - RelatedGroupID string `gorm:"column:related_group_id;size:64" json:"relatedGroupID"` - CreateTime time.Time `gorm:"column:create_time" json:"createTime"` - Ex string `gorm:"column:ex;type:varchar(1024)" json:"ex"` -} - -func (Department) TableName() string { - return "departments" -} - -type OrganizationUser struct { - UserID string `gorm:"column:user_id;primary_key;size:64"` - Nickname string `gorm:"column:nickname;size:256"` - EnglishName string `gorm:"column:english_name;size:256"` - FaceURL string `gorm:"column:face_url;size:256"` - Gender int32 `gorm:"column:gender"` //1 ,2 - Mobile string `gorm:"column:mobile;size:32"` - Telephone string `gorm:"column:telephone;size:32"` - Birth time.Time `gorm:"column:birth"` - Email string `gorm:"column:email;size:64"` - CreateTime time.Time `gorm:"column:create_time"` - Ex string `gorm:"column:ex;size:1024"` -} - -func (OrganizationUser) TableName() string { - return "organization_users" -} - -type DepartmentMember struct { - UserID string `gorm:"column:user_id;primary_key;size:64"` - DepartmentID string `gorm:"column:department_id;primary_key;size:64"` - Order int32 `gorm:"column:order" json:"order"` //1,2 - Position string `gorm:"column:position;size:256" json:"position"` - Leader int32 `gorm:"column:leader" json:"leader"` //-1, 1 - Status int32 `gorm:"column:status" json:"status"` //-1, 1 - CreateTime time.Time `gorm:"column:create_time"` - Ex string `gorm:"column:ex;type:varchar(1024)" json:"ex"` -} - -func (DepartmentMember) TableName() string { - return "department_members" -} - -type AppVersion struct { - Version string `gorm:"column:version;size:64" json:"version"` - Type int `gorm:"column:type;primary_key" json:"type"` - UpdateTime int `gorm:"column:update_time" json:"update_time"` - ForceUpdate bool `gorm:"column:force_update" json:"force_update"` - FileName string `gorm:"column:file_name" json:"file_name"` - YamlName string `gorm:"column:yaml_name" json:"yaml_name"` - UpdateLog string `gorm:"column:update_log" json:"update_log"` -} - -func (AppVersion) TableName() string { - return "app_version" -} - -type RegisterAddFriend struct { - UserID string `gorm:"column:user_id;primary_key;size:64"` -} - -func (RegisterAddFriend) TableName() string { - return "register_add_friend" -} - -type ClientInitConfig struct { - DiscoverPageURL string `gorm:"column:discover_page_url;size:64" json:"version"` -} - -func (ClientInitConfig) TableName() string { - return "client_init_config" -} diff --git a/pkg/common/db/mysql_model/im_mysql_model/organization_model.go b/pkg/common/db/mysql_model/im_mysql_model/organization_model.go deleted file mode 100644 index 03b960b1d..000000000 --- a/pkg/common/db/mysql_model/im_mysql_model/organization_model.go +++ /dev/null @@ -1,224 +0,0 @@ -package im_mysql_model - -import ( - "Open_IM/pkg/utils" - "gorm.io/gorm" - "time" -) - -var OrgDB *gorm.DB - -func CreateDepartment(department *Department) error { - department.CreateTime = time.Now() - return OrgDB.Table("departments").Create(department).Error -} - -func GetDepartment(departmentID string) (*Department, error) { - var department Department - err := OrgDB.Table("departments").Where("department_id=?", departmentID).Find(&department).Error - return &department, err -} - -func UpdateDepartment(department *Department, args map[string]interface{}) error { - if err := OrgDB.Table("departments").Where("department_id=?", department.DepartmentID).Updates(department).Error; err != nil { - return err - } - if args != nil { - return OrgDB.Table("departments").Where("department_id=?", department.DepartmentID).Updates(args).Error - } - return nil -} - -func GetSubDepartmentList(departmentID string) ([]Department, error) { - var departmentList []Department - var err error - if departmentID == "-1" { - err = OrgDB.Table("departments").Find(&departmentList).Error - } else { - err = OrgDB.Table("departments").Where("parent_id=?", departmentID).Find(&departmentList).Error - } - - return departmentList, err -} - -func DeleteDepartment(departmentID string) error { - var err error - if err = OrgDB.Table("departments").Where("department_id=?", departmentID).Delete(Department{}).Error; err != nil { - return err - } - if err = OrgDB.Table("department_members").Where("department_id=?", departmentID).Delete(DepartmentMember{}).Error; err != nil { - return err - } - return nil -} - -func CreateOrganizationUser(organizationUser *OrganizationUser) error { - organizationUser.CreateTime = time.Now() - return OrgDB.Table("organization_users").Create(organizationUser).Error -} - -func GetOrganizationUser(userID string) (error, *OrganizationUser) { - organizationUser := OrganizationUser{} - err := OrgDB.Table("organization_users").Where("user_id=?", userID).Take(&organizationUser).Error - return err, &organizationUser -} - -func GetOrganizationUsers(userIDList []string) ([]*OrganizationUser, error) { - var organizationUserList []*OrganizationUser - err := OrgDB.Table("organization_users").Where("user_id in (?)", userIDList).Find(&organizationUserList).Error - return organizationUserList, err -} - -func UpdateOrganizationUser(organizationUser *OrganizationUser, args map[string]interface{}) error { - if err := OrgDB.Table("organization_users").Where("user_id=?", organizationUser.UserID).Updates(organizationUser).Error; err != nil { - return err - } - if args != nil { - return OrgDB.Table("organization_users").Where("user_id=?", organizationUser.UserID).Updates(args).Error - } - return nil -} - -func CreateDepartmentMember(departmentMember *DepartmentMember) error { - departmentMember.CreateTime = time.Now() - return OrgDB.Table("department_members").Create(departmentMember).Error -} - -func GetUserInDepartment(userID string) (error, []DepartmentMember) { - var departmentMemberList []DepartmentMember - err := OrgDB.Where("user_id=?", userID).Find(&departmentMemberList).Error - return err, departmentMemberList -} - -func UpdateUserInDepartment(departmentMember *DepartmentMember, args map[string]interface{}) error { - if err := OrgDB.Where("department_id=? AND user_id=?", departmentMember.DepartmentID, departmentMember.UserID). - Updates(departmentMember).Error; err != nil { - return err - } - if args != nil { - return OrgDB.Where("department_id=? AND user_id=?", departmentMember.DepartmentID, departmentMember.UserID). - Updates(args).Error - } - return nil -} - -func DeleteUserInDepartment(departmentID, userID string) error { - return OrgDB.Table("department_members").Where("department_id=? AND user_id=?", departmentID, userID).Delete(DepartmentMember{}).Error -} - -func DeleteUserInAllDepartment(userID string) error { - return OrgDB.Table("department_members").Where("user_id=?", userID).Delete(DepartmentMember{}).Error -} - -func DeleteOrganizationUser(OrganizationUserID string) error { - if err := DeleteUserInAllDepartment(OrganizationUserID); err != nil { - return err - } - return OrgDB.Table("organization_users").Where("user_id=?", OrganizationUserID).Delete(OrganizationUser{}).Error -} - -func GetDepartmentMemberUserIDList(departmentID string) (error, []string) { - var departmentMemberList []DepartmentMember - err := OrgDB.Table("department_members").Where("department_id=?", departmentID).Take(&departmentMemberList).Error - if err != nil { - return err, nil - } - var userIDList []string = make([]string, 0) - for _, v := range departmentMemberList { - userIDList = append(userIDList, v.UserID) - } - return err, userIDList -} - -func GetDepartmentMemberList(departmentID string) ([]DepartmentMember, error) { - var departmentMemberList []DepartmentMember - var err error - if departmentID == "-1" { - err = OrgDB.Table("department_members").Find(&departmentMemberList).Error - } else { - err = OrgDB.Table("department_members").Where("department_id=?", departmentID).Find(&departmentMemberList).Error - } - - if err != nil { - return nil, err - } - return departmentMemberList, err -} - -func GetAllOrganizationUserID() (error, []string) { - var OrganizationUser OrganizationUser - var result []string - return OrgDB.Model(&OrganizationUser).Pluck("user_id", &result).Error, result -} - -func GetDepartmentMemberNum(departmentID string) (error, uint32) { - var number int64 - err := OrgDB.Table("department_members").Where("department_id=?", departmentID).Count(&number).Error - if err != nil { - return utils.Wrap(err, ""), 0 - } - return nil, uint32(number) - -} - -func GetSubDepartmentNum(departmentID string) (error, uint32) { - var number int64 - err := OrgDB.Table("departments").Where("parent_id=?", departmentID).Count(&number).Error - if err != nil { - return utils.Wrap(err, ""), 0 - } - return nil, uint32(number) -} - -func SetDepartmentRelatedGroupID(groupID, departmentID string) error { - department := &Department{RelatedGroupID: groupID} - return OrgDB.Model(&department).Where("department_id=?", departmentID).Updates(department).Error -} - -func GetDepartmentRelatedGroupIDList(departmentIDList []string) ([]string, error) { - var groupIDList []string - err := OrgDB.Table("departments").Where("department_id IN (?) ", departmentIDList).Pluck("related_group_id", &groupIDList).Error - return groupIDList, err -} - -func getDepartmentParent(departmentID string, dbConn *gorm.DB) (*Department, error) { - var department Department - var parentDepartment Department - //var parentID string - err := OrgDB.Model(&department).Where("department_id=?", departmentID).Select("parent_id").First(&department).Error - if err != nil { - return nil, utils.Wrap(err, "") - } - if department.ParentID != "" { - err = dbConn.Model(&parentDepartment).Where("department_id = ?", department.ParentID).Find(&parentDepartment).Error - } - return &parentDepartment, utils.Wrap(err, "") -} - -func GetDepartmentParent(departmentID string, dbConn *gorm.DB, parentIDList *[]string) error { - department, err := getDepartmentParent(departmentID, dbConn) - if err != nil { - return err - } - if department.DepartmentID != "" { - *parentIDList = append(*parentIDList, department.DepartmentID) - err = GetDepartmentParent(department.DepartmentID, dbConn, parentIDList) - if err != nil { - return err - } - } - return nil -} - -func GetDepartmentParentIDList(departmentID string) ([]string, error) { - dbConn := OrgDB - var parentIDList []string - err := GetDepartmentParent(departmentID, dbConn, &parentIDList) - return parentIDList, err -} - -func GetRandomDepartmentID() (string, error) { - department := &Department{} - err := OrgDB.Model(department).Order("RAND()").Where("related_group_id != ? AND department_id != ? AND department_type = ?", "", "0", 1).First(department).Error - return department.DepartmentID, err -} diff --git a/pkg/common/db/rocks_cache/rocks_cache.go b/pkg/common/db/rocks_cache/rocks_cache.go index 639377562..5d8a4d812 100644 --- a/pkg/common/db/rocks_cache/rocks_cache.go +++ b/pkg/common/db/rocks_cache/rocks_cache.go @@ -27,8 +27,6 @@ const ( groupMemberInfoCache = "GROUP_MEMBER_INFO_CACHE:" groupAllMemberInfoCache = "GROUP_ALL_MEMBER_INFO_CACHE:" allFriendInfoCache = "ALL_FRIEND_INFO_CACHE:" - allDepartmentCache = "ALL_DEPARTMENT_CACHE:" - allDepartmentMemberCache = "ALL_DEPARTMENT_MEMBER_CACHE:" joinedSuperGroupListCache = "JOINED_SUPER_GROUP_LIST_CACHE:" groupMemberListHashCache = "GROUP_MEMBER_LIST_HASH_CACHE:" groupMemberNumCache = "GROUP_MEMBER_NUM_CACHE:" @@ -39,7 +37,7 @@ const ( ) func DelKeys() { - fmt.Println("init to del old keys") + fmt.Println("cache init to del old keys") for _, key := range []string{groupCache, friendRelationCache, blackListCache, userInfoCache, groupInfoCache, groupOwnerIDCache, joinedGroupListCache, groupMemberInfoCache, groupAllMemberInfoCache, allFriendInfoCache} { fName := utils.GetSelfFuncName() @@ -100,27 +98,27 @@ func DelFriendIDListFromCache(ctx context.Context, userID string) (err error) { return db.DB.Rc.TagAsDeleted(friendRelationCache + userID) } -func GetBlackListFromCache(ctx context.Context, userID string) (blackIDList []string, err error) { +func GetBlackListFromCache(ctx context.Context, userID string) (blackIDs []string, err error) { getBlackIDList := func() (string, error) { - blackIDList, err := imdb.GetBlackIDListByUserID(userID) + blackIDs, err := imdb.GetBlackIDListByUserID(userID) if err != nil { return "", utils.Wrap(err, "") } - bytes, err := json.Marshal(blackIDList) + bytes, err := json.Marshal(blackIDs) if err != nil { return "", utils.Wrap(err, "") } return string(bytes), nil } defer func() { - trace_log.SetCtxDebug(ctx, utils.GetFuncName(1), err, "userID", userID, "blackIDList", blackIDList) + trace_log.SetCtxDebug(ctx, utils.GetFuncName(1), err, "userID", userID, "blackIDList", blackIDs) }() blackIDListStr, err := db.DB.Rc.Fetch(blackListCache+userID, time.Second*30*60, getBlackIDList) if err != nil { return nil, utils.Wrap(err, "") } - err = json.Unmarshal([]byte(blackIDListStr), &blackIDList) - return blackIDList, utils.Wrap(err, "") + err = json.Unmarshal([]byte(blackIDListStr), &blackIDs) + return blackIDs, utils.Wrap(err, "") } func DelBlackIDListFromCache(ctx context.Context, userID string) (err error) { @@ -415,56 +413,6 @@ func DelAllFriendsInfoFromCache(ctx context.Context, userID string) (err error) return db.DB.Rc.TagAsDeleted(allFriendInfoCache + userID) } -func GetAllDepartmentsFromCache() ([]imdb.Department, error) { - getAllDepartments := func() (string, error) { - departmentList, err := imdb.GetSubDepartmentList("-1") - if err != nil { - return "", utils.Wrap(err, "") - } - bytes, err := json.Marshal(departmentList) - if err != nil { - return "", utils.Wrap(err, "") - } - return string(bytes), nil - } - allDepartmentsStr, err := db.DB.Rc.Fetch(allDepartmentCache, time.Second*30*60, getAllDepartments) - if err != nil { - return nil, utils.Wrap(err, "") - } - var allDepartments []imdb.Department - err = json.Unmarshal([]byte(allDepartmentsStr), &allDepartments) - return allDepartments, utils.Wrap(err, "") -} - -func DelAllDepartmentsFromCache() error { - return db.DB.Rc.TagAsDeleted(allDepartmentCache) -} - -func GetAllDepartmentMembersFromCache() ([]imdb.DepartmentMember, error) { - getAllDepartmentMembers := func() (string, error) { - departmentMembers, err := imdb.GetDepartmentMemberList("-1") - if err != nil { - return "", utils.Wrap(err, "") - } - bytes, err := json.Marshal(departmentMembers) - if err != nil { - return "", utils.Wrap(err, "") - } - return string(bytes), nil - } - allDepartmentMembersStr, err := db.DB.Rc.Fetch(allDepartmentMemberCache, time.Second*30*60, getAllDepartmentMembers) - if err != nil { - return nil, utils.Wrap(err, "") - } - var allDepartmentMembers []imdb.DepartmentMember - err = json.Unmarshal([]byte(allDepartmentMembersStr), &allDepartmentMembers) - return allDepartmentMembers, utils.Wrap(err, "") -} - -func DelAllDepartmentMembersFromCache() error { - return db.DB.Rc.TagAsDeleted(allDepartmentMemberCache) -} - func GetJoinedSuperGroupListFromCache(ctx context.Context, userID string) (joinedSuperGroupIDs []string, err error) { getJoinedSuperGroupIDList := func() (string, error) { userToSuperGroup, err := db.DB.GetSuperGroupByUserID(userID) diff --git a/pkg/common/http/http_client.go b/pkg/common/http/http_client.go index 5d677b23b..289c234c2 100644 --- a/pkg/common/http/http_client.go +++ b/pkg/common/http/http_client.go @@ -7,7 +7,7 @@ package http import ( - cbApi "Open_IM/pkg/call_back_struct" + cbApi "Open_IM/pkg/callback_struct" "Open_IM/pkg/common/constant" "bytes" "encoding/json" diff --git a/pkg/proto/organization/organization.pb.go b/pkg/proto/organization/organization.pb.go deleted file mode 100644 index 2bf0bbe16..000000000 --- a/pkg/proto/organization/organization.pb.go +++ /dev/null @@ -1,3263 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.1 -// protoc v3.15.5 -// source: organization/organization.proto - -package organization - -import ( - sdk_ws "Open_IM/pkg/proto/sdk_ws" - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type CreateDepartmentReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - DepartmentInfo *sdk_ws.Department `protobuf:"bytes,1,opt,name=departmentInfo,proto3" json:"departmentInfo,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID,proto3" json:"operationID,omitempty"` - OpUserID string `protobuf:"bytes,3,opt,name=opUserID,proto3" json:"opUserID,omitempty"` -} - -func (x *CreateDepartmentReq) Reset() { - *x = CreateDepartmentReq{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateDepartmentReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateDepartmentReq) ProtoMessage() {} - -func (x *CreateDepartmentReq) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateDepartmentReq.ProtoReflect.Descriptor instead. -func (*CreateDepartmentReq) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{0} -} - -func (x *CreateDepartmentReq) GetDepartmentInfo() *sdk_ws.Department { - if x != nil { - return x.DepartmentInfo - } - return nil -} - -func (x *CreateDepartmentReq) GetOperationID() string { - if x != nil { - return x.OperationID - } - return "" -} - -func (x *CreateDepartmentReq) GetOpUserID() string { - if x != nil { - return x.OpUserID - } - return "" -} - -type CreateDepartmentResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ErrCode int32 `protobuf:"varint,1,opt,name=errCode,proto3" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg,proto3" json:"errMsg,omitempty"` - DepartmentInfo *sdk_ws.Department `protobuf:"bytes,3,opt,name=departmentInfo,proto3" json:"departmentInfo,omitempty"` -} - -func (x *CreateDepartmentResp) Reset() { - *x = CreateDepartmentResp{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateDepartmentResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateDepartmentResp) ProtoMessage() {} - -func (x *CreateDepartmentResp) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateDepartmentResp.ProtoReflect.Descriptor instead. -func (*CreateDepartmentResp) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{1} -} - -func (x *CreateDepartmentResp) GetErrCode() int32 { - if x != nil { - return x.ErrCode - } - return 0 -} - -func (x *CreateDepartmentResp) GetErrMsg() string { - if x != nil { - return x.ErrMsg - } - return "" -} - -func (x *CreateDepartmentResp) GetDepartmentInfo() *sdk_ws.Department { - if x != nil { - return x.DepartmentInfo - } - return nil -} - -type UpdateDepartmentReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - DepartmentInfo *sdk_ws.Department `protobuf:"bytes,1,opt,name=departmentInfo,proto3" json:"departmentInfo,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID,proto3" json:"operationID,omitempty"` - OpUserID string `protobuf:"bytes,3,opt,name=opUserID,proto3" json:"opUserID,omitempty"` -} - -func (x *UpdateDepartmentReq) Reset() { - *x = UpdateDepartmentReq{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateDepartmentReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateDepartmentReq) ProtoMessage() {} - -func (x *UpdateDepartmentReq) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateDepartmentReq.ProtoReflect.Descriptor instead. -func (*UpdateDepartmentReq) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{2} -} - -func (x *UpdateDepartmentReq) GetDepartmentInfo() *sdk_ws.Department { - if x != nil { - return x.DepartmentInfo - } - return nil -} - -func (x *UpdateDepartmentReq) GetOperationID() string { - if x != nil { - return x.OperationID - } - return "" -} - -func (x *UpdateDepartmentReq) GetOpUserID() string { - if x != nil { - return x.OpUserID - } - return "" -} - -type UpdateDepartmentResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ErrCode int32 `protobuf:"varint,1,opt,name=errCode,proto3" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg,proto3" json:"errMsg,omitempty"` -} - -func (x *UpdateDepartmentResp) Reset() { - *x = UpdateDepartmentResp{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateDepartmentResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateDepartmentResp) ProtoMessage() {} - -func (x *UpdateDepartmentResp) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateDepartmentResp.ProtoReflect.Descriptor instead. -func (*UpdateDepartmentResp) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{3} -} - -func (x *UpdateDepartmentResp) GetErrCode() int32 { - if x != nil { - return x.ErrCode - } - return 0 -} - -func (x *UpdateDepartmentResp) GetErrMsg() string { - if x != nil { - return x.ErrMsg - } - return "" -} - -type GetSubDepartmentReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - DepartmentID string `protobuf:"bytes,1,opt,name=departmentID,proto3" json:"departmentID,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID,proto3" json:"operationID,omitempty"` - OpUserID string `protobuf:"bytes,3,opt,name=opUserID,proto3" json:"opUserID,omitempty"` -} - -func (x *GetSubDepartmentReq) Reset() { - *x = GetSubDepartmentReq{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSubDepartmentReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSubDepartmentReq) ProtoMessage() {} - -func (x *GetSubDepartmentReq) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSubDepartmentReq.ProtoReflect.Descriptor instead. -func (*GetSubDepartmentReq) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{4} -} - -func (x *GetSubDepartmentReq) GetDepartmentID() string { - if x != nil { - return x.DepartmentID - } - return "" -} - -func (x *GetSubDepartmentReq) GetOperationID() string { - if x != nil { - return x.OperationID - } - return "" -} - -func (x *GetSubDepartmentReq) GetOpUserID() string { - if x != nil { - return x.OpUserID - } - return "" -} - -type GetSubDepartmentResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ErrCode int32 `protobuf:"varint,1,opt,name=errCode,proto3" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg,proto3" json:"errMsg,omitempty"` - DepartmentList []*sdk_ws.Department `protobuf:"bytes,3,rep,name=departmentList,proto3" json:"departmentList,omitempty"` -} - -func (x *GetSubDepartmentResp) Reset() { - *x = GetSubDepartmentResp{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSubDepartmentResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSubDepartmentResp) ProtoMessage() {} - -func (x *GetSubDepartmentResp) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSubDepartmentResp.ProtoReflect.Descriptor instead. -func (*GetSubDepartmentResp) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{5} -} - -func (x *GetSubDepartmentResp) GetErrCode() int32 { - if x != nil { - return x.ErrCode - } - return 0 -} - -func (x *GetSubDepartmentResp) GetErrMsg() string { - if x != nil { - return x.ErrMsg - } - return "" -} - -func (x *GetSubDepartmentResp) GetDepartmentList() []*sdk_ws.Department { - if x != nil { - return x.DepartmentList - } - return nil -} - -type DeleteDepartmentReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - DepartmentID string `protobuf:"bytes,1,opt,name=departmentID,proto3" json:"departmentID,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID,proto3" json:"operationID,omitempty"` - OpUserID string `protobuf:"bytes,3,opt,name=opUserID,proto3" json:"opUserID,omitempty"` -} - -func (x *DeleteDepartmentReq) Reset() { - *x = DeleteDepartmentReq{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteDepartmentReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteDepartmentReq) ProtoMessage() {} - -func (x *DeleteDepartmentReq) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteDepartmentReq.ProtoReflect.Descriptor instead. -func (*DeleteDepartmentReq) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{6} -} - -func (x *DeleteDepartmentReq) GetDepartmentID() string { - if x != nil { - return x.DepartmentID - } - return "" -} - -func (x *DeleteDepartmentReq) GetOperationID() string { - if x != nil { - return x.OperationID - } - return "" -} - -func (x *DeleteDepartmentReq) GetOpUserID() string { - if x != nil { - return x.OpUserID - } - return "" -} - -type DeleteDepartmentResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ErrCode int32 `protobuf:"varint,1,opt,name=errCode,proto3" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg,proto3" json:"errMsg,omitempty"` -} - -func (x *DeleteDepartmentResp) Reset() { - *x = DeleteDepartmentResp{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteDepartmentResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteDepartmentResp) ProtoMessage() {} - -func (x *DeleteDepartmentResp) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteDepartmentResp.ProtoReflect.Descriptor instead. -func (*DeleteDepartmentResp) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{7} -} - -func (x *DeleteDepartmentResp) GetErrCode() int32 { - if x != nil { - return x.ErrCode - } - return 0 -} - -func (x *DeleteDepartmentResp) GetErrMsg() string { - if x != nil { - return x.ErrMsg - } - return "" -} - -type GetDepartmentParentIDListReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - DepartmentID string `protobuf:"bytes,1,opt,name=departmentID,proto3" json:"departmentID,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID,proto3" json:"operationID,omitempty"` -} - -func (x *GetDepartmentParentIDListReq) Reset() { - *x = GetDepartmentParentIDListReq{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetDepartmentParentIDListReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDepartmentParentIDListReq) ProtoMessage() {} - -func (x *GetDepartmentParentIDListReq) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetDepartmentParentIDListReq.ProtoReflect.Descriptor instead. -func (*GetDepartmentParentIDListReq) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{8} -} - -func (x *GetDepartmentParentIDListReq) GetDepartmentID() string { - if x != nil { - return x.DepartmentID - } - return "" -} - -func (x *GetDepartmentParentIDListReq) GetOperationID() string { - if x != nil { - return x.OperationID - } - return "" -} - -type GetDepartmentParentIDListResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ErrCode int32 `protobuf:"varint,1,opt,name=errCode,proto3" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg,proto3" json:"errMsg,omitempty"` - ParentIDList []string `protobuf:"bytes,3,rep,name=parentIDList,proto3" json:"parentIDList,omitempty"` -} - -func (x *GetDepartmentParentIDListResp) Reset() { - *x = GetDepartmentParentIDListResp{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetDepartmentParentIDListResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDepartmentParentIDListResp) ProtoMessage() {} - -func (x *GetDepartmentParentIDListResp) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetDepartmentParentIDListResp.ProtoReflect.Descriptor instead. -func (*GetDepartmentParentIDListResp) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{9} -} - -func (x *GetDepartmentParentIDListResp) GetErrCode() int32 { - if x != nil { - return x.ErrCode - } - return 0 -} - -func (x *GetDepartmentParentIDListResp) GetErrMsg() string { - if x != nil { - return x.ErrMsg - } - return "" -} - -func (x *GetDepartmentParentIDListResp) GetParentIDList() []string { - if x != nil { - return x.ParentIDList - } - return nil -} - -type CreateOrganizationUserReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - OrganizationUser *sdk_ws.OrganizationUser `protobuf:"bytes,1,opt,name=organizationUser,proto3" json:"organizationUser,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID,proto3" json:"operationID,omitempty"` - OpUserID string `protobuf:"bytes,3,opt,name=opUserID,proto3" json:"opUserID,omitempty"` - IsRegister bool `protobuf:"varint,4,opt,name=IsRegister,proto3" json:"IsRegister,omitempty"` -} - -func (x *CreateOrganizationUserReq) Reset() { - *x = CreateOrganizationUserReq{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateOrganizationUserReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateOrganizationUserReq) ProtoMessage() {} - -func (x *CreateOrganizationUserReq) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateOrganizationUserReq.ProtoReflect.Descriptor instead. -func (*CreateOrganizationUserReq) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{10} -} - -func (x *CreateOrganizationUserReq) GetOrganizationUser() *sdk_ws.OrganizationUser { - if x != nil { - return x.OrganizationUser - } - return nil -} - -func (x *CreateOrganizationUserReq) GetOperationID() string { - if x != nil { - return x.OperationID - } - return "" -} - -func (x *CreateOrganizationUserReq) GetOpUserID() string { - if x != nil { - return x.OpUserID - } - return "" -} - -func (x *CreateOrganizationUserReq) GetIsRegister() bool { - if x != nil { - return x.IsRegister - } - return false -} - -type CreateOrganizationUserResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ErrCode int32 `protobuf:"varint,1,opt,name=errCode,proto3" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg,proto3" json:"errMsg,omitempty"` -} - -func (x *CreateOrganizationUserResp) Reset() { - *x = CreateOrganizationUserResp{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateOrganizationUserResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateOrganizationUserResp) ProtoMessage() {} - -func (x *CreateOrganizationUserResp) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateOrganizationUserResp.ProtoReflect.Descriptor instead. -func (*CreateOrganizationUserResp) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{11} -} - -func (x *CreateOrganizationUserResp) GetErrCode() int32 { - if x != nil { - return x.ErrCode - } - return 0 -} - -func (x *CreateOrganizationUserResp) GetErrMsg() string { - if x != nil { - return x.ErrMsg - } - return "" -} - -type UpdateOrganizationUserReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - OrganizationUser *sdk_ws.OrganizationUser `protobuf:"bytes,1,opt,name=organizationUser,proto3" json:"organizationUser,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID,proto3" json:"operationID,omitempty"` - OpUserID string `protobuf:"bytes,3,opt,name=opUserID,proto3" json:"opUserID,omitempty"` -} - -func (x *UpdateOrganizationUserReq) Reset() { - *x = UpdateOrganizationUserReq{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateOrganizationUserReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateOrganizationUserReq) ProtoMessage() {} - -func (x *UpdateOrganizationUserReq) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateOrganizationUserReq.ProtoReflect.Descriptor instead. -func (*UpdateOrganizationUserReq) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{12} -} - -func (x *UpdateOrganizationUserReq) GetOrganizationUser() *sdk_ws.OrganizationUser { - if x != nil { - return x.OrganizationUser - } - return nil -} - -func (x *UpdateOrganizationUserReq) GetOperationID() string { - if x != nil { - return x.OperationID - } - return "" -} - -func (x *UpdateOrganizationUserReq) GetOpUserID() string { - if x != nil { - return x.OpUserID - } - return "" -} - -type UpdateOrganizationUserResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ErrCode int32 `protobuf:"varint,1,opt,name=errCode,proto3" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg,proto3" json:"errMsg,omitempty"` -} - -func (x *UpdateOrganizationUserResp) Reset() { - *x = UpdateOrganizationUserResp{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateOrganizationUserResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateOrganizationUserResp) ProtoMessage() {} - -func (x *UpdateOrganizationUserResp) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateOrganizationUserResp.ProtoReflect.Descriptor instead. -func (*UpdateOrganizationUserResp) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{13} -} - -func (x *UpdateOrganizationUserResp) GetErrCode() int32 { - if x != nil { - return x.ErrCode - } - return 0 -} - -func (x *UpdateOrganizationUserResp) GetErrMsg() string { - if x != nil { - return x.ErrMsg - } - return "" -} - -type CreateDepartmentMemberReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - DepartmentMember *sdk_ws.DepartmentMember `protobuf:"bytes,1,opt,name=departmentMember,proto3" json:"departmentMember,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID,proto3" json:"operationID,omitempty"` - OpUserID string `protobuf:"bytes,3,opt,name=opUserID,proto3" json:"opUserID,omitempty"` -} - -func (x *CreateDepartmentMemberReq) Reset() { - *x = CreateDepartmentMemberReq{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateDepartmentMemberReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateDepartmentMemberReq) ProtoMessage() {} - -func (x *CreateDepartmentMemberReq) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateDepartmentMemberReq.ProtoReflect.Descriptor instead. -func (*CreateDepartmentMemberReq) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{14} -} - -func (x *CreateDepartmentMemberReq) GetDepartmentMember() *sdk_ws.DepartmentMember { - if x != nil { - return x.DepartmentMember - } - return nil -} - -func (x *CreateDepartmentMemberReq) GetOperationID() string { - if x != nil { - return x.OperationID - } - return "" -} - -func (x *CreateDepartmentMemberReq) GetOpUserID() string { - if x != nil { - return x.OpUserID - } - return "" -} - -type CreateDepartmentMemberResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ErrCode int32 `protobuf:"varint,1,opt,name=errCode,proto3" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg,proto3" json:"errMsg,omitempty"` -} - -func (x *CreateDepartmentMemberResp) Reset() { - *x = CreateDepartmentMemberResp{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateDepartmentMemberResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateDepartmentMemberResp) ProtoMessage() {} - -func (x *CreateDepartmentMemberResp) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateDepartmentMemberResp.ProtoReflect.Descriptor instead. -func (*CreateDepartmentMemberResp) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{15} -} - -func (x *CreateDepartmentMemberResp) GetErrCode() int32 { - if x != nil { - return x.ErrCode - } - return 0 -} - -func (x *CreateDepartmentMemberResp) GetErrMsg() string { - if x != nil { - return x.ErrMsg - } - return "" -} - -type GetUserInDepartmentReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID,proto3" json:"operationID,omitempty"` - OpUserID string `protobuf:"bytes,3,opt,name=opUserID,proto3" json:"opUserID,omitempty"` -} - -func (x *GetUserInDepartmentReq) Reset() { - *x = GetUserInDepartmentReq{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetUserInDepartmentReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUserInDepartmentReq) ProtoMessage() {} - -func (x *GetUserInDepartmentReq) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetUserInDepartmentReq.ProtoReflect.Descriptor instead. -func (*GetUserInDepartmentReq) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{16} -} - -func (x *GetUserInDepartmentReq) GetUserID() string { - if x != nil { - return x.UserID - } - return "" -} - -func (x *GetUserInDepartmentReq) GetOperationID() string { - if x != nil { - return x.OperationID - } - return "" -} - -func (x *GetUserInDepartmentReq) GetOpUserID() string { - if x != nil { - return x.OpUserID - } - return "" -} - -type GetUserInDepartmentResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ErrCode int32 `protobuf:"varint,1,opt,name=errCode,proto3" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg,proto3" json:"errMsg,omitempty"` - UserInDepartment *sdk_ws.UserInDepartment `protobuf:"bytes,3,opt,name=userInDepartment,proto3" json:"userInDepartment,omitempty"` -} - -func (x *GetUserInDepartmentResp) Reset() { - *x = GetUserInDepartmentResp{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetUserInDepartmentResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUserInDepartmentResp) ProtoMessage() {} - -func (x *GetUserInDepartmentResp) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetUserInDepartmentResp.ProtoReflect.Descriptor instead. -func (*GetUserInDepartmentResp) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{17} -} - -func (x *GetUserInDepartmentResp) GetErrCode() int32 { - if x != nil { - return x.ErrCode - } - return 0 -} - -func (x *GetUserInDepartmentResp) GetErrMsg() string { - if x != nil { - return x.ErrMsg - } - return "" -} - -func (x *GetUserInDepartmentResp) GetUserInDepartment() *sdk_ws.UserInDepartment { - if x != nil { - return x.UserInDepartment - } - return nil -} - -type UpdateUserInDepartmentReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - DepartmentMember *sdk_ws.DepartmentMember `protobuf:"bytes,1,opt,name=departmentMember,proto3" json:"departmentMember,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID,proto3" json:"operationID,omitempty"` - OpUserID string `protobuf:"bytes,3,opt,name=opUserID,proto3" json:"opUserID,omitempty"` -} - -func (x *UpdateUserInDepartmentReq) Reset() { - *x = UpdateUserInDepartmentReq{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateUserInDepartmentReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateUserInDepartmentReq) ProtoMessage() {} - -func (x *UpdateUserInDepartmentReq) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateUserInDepartmentReq.ProtoReflect.Descriptor instead. -func (*UpdateUserInDepartmentReq) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{18} -} - -func (x *UpdateUserInDepartmentReq) GetDepartmentMember() *sdk_ws.DepartmentMember { - if x != nil { - return x.DepartmentMember - } - return nil -} - -func (x *UpdateUserInDepartmentReq) GetOperationID() string { - if x != nil { - return x.OperationID - } - return "" -} - -func (x *UpdateUserInDepartmentReq) GetOpUserID() string { - if x != nil { - return x.OpUserID - } - return "" -} - -type UpdateUserInDepartmentResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ErrCode int32 `protobuf:"varint,1,opt,name=errCode,proto3" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg,proto3" json:"errMsg,omitempty"` -} - -func (x *UpdateUserInDepartmentResp) Reset() { - *x = UpdateUserInDepartmentResp{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateUserInDepartmentResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateUserInDepartmentResp) ProtoMessage() {} - -func (x *UpdateUserInDepartmentResp) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateUserInDepartmentResp.ProtoReflect.Descriptor instead. -func (*UpdateUserInDepartmentResp) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{19} -} - -func (x *UpdateUserInDepartmentResp) GetErrCode() int32 { - if x != nil { - return x.ErrCode - } - return 0 -} - -func (x *UpdateUserInDepartmentResp) GetErrMsg() string { - if x != nil { - return x.ErrMsg - } - return "" -} - -type DeleteUserInDepartmentReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID,proto3" json:"operationID,omitempty"` - OpUserID string `protobuf:"bytes,3,opt,name=opUserID,proto3" json:"opUserID,omitempty"` - DepartmentID string `protobuf:"bytes,4,opt,name=departmentID,proto3" json:"departmentID,omitempty"` -} - -func (x *DeleteUserInDepartmentReq) Reset() { - *x = DeleteUserInDepartmentReq{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteUserInDepartmentReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteUserInDepartmentReq) ProtoMessage() {} - -func (x *DeleteUserInDepartmentReq) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteUserInDepartmentReq.ProtoReflect.Descriptor instead. -func (*DeleteUserInDepartmentReq) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{20} -} - -func (x *DeleteUserInDepartmentReq) GetUserID() string { - if x != nil { - return x.UserID - } - return "" -} - -func (x *DeleteUserInDepartmentReq) GetOperationID() string { - if x != nil { - return x.OperationID - } - return "" -} - -func (x *DeleteUserInDepartmentReq) GetOpUserID() string { - if x != nil { - return x.OpUserID - } - return "" -} - -func (x *DeleteUserInDepartmentReq) GetDepartmentID() string { - if x != nil { - return x.DepartmentID - } - return "" -} - -type DeleteUserInDepartmentResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ErrCode int32 `protobuf:"varint,1,opt,name=errCode,proto3" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg,proto3" json:"errMsg,omitempty"` -} - -func (x *DeleteUserInDepartmentResp) Reset() { - *x = DeleteUserInDepartmentResp{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteUserInDepartmentResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteUserInDepartmentResp) ProtoMessage() {} - -func (x *DeleteUserInDepartmentResp) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteUserInDepartmentResp.ProtoReflect.Descriptor instead. -func (*DeleteUserInDepartmentResp) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{21} -} - -func (x *DeleteUserInDepartmentResp) GetErrCode() int32 { - if x != nil { - return x.ErrCode - } - return 0 -} - -func (x *DeleteUserInDepartmentResp) GetErrMsg() string { - if x != nil { - return x.ErrMsg - } - return "" -} - -type DeleteOrganizationUserReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID,proto3" json:"operationID,omitempty"` - OpUserID string `protobuf:"bytes,3,opt,name=opUserID,proto3" json:"opUserID,omitempty"` -} - -func (x *DeleteOrganizationUserReq) Reset() { - *x = DeleteOrganizationUserReq{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteOrganizationUserReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteOrganizationUserReq) ProtoMessage() {} - -func (x *DeleteOrganizationUserReq) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteOrganizationUserReq.ProtoReflect.Descriptor instead. -func (*DeleteOrganizationUserReq) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{22} -} - -func (x *DeleteOrganizationUserReq) GetUserID() string { - if x != nil { - return x.UserID - } - return "" -} - -func (x *DeleteOrganizationUserReq) GetOperationID() string { - if x != nil { - return x.OperationID - } - return "" -} - -func (x *DeleteOrganizationUserReq) GetOpUserID() string { - if x != nil { - return x.OpUserID - } - return "" -} - -type DeleteOrganizationUserResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ErrCode int32 `protobuf:"varint,1,opt,name=errCode,proto3" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg,proto3" json:"errMsg,omitempty"` -} - -func (x *DeleteOrganizationUserResp) Reset() { - *x = DeleteOrganizationUserResp{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteOrganizationUserResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteOrganizationUserResp) ProtoMessage() {} - -func (x *DeleteOrganizationUserResp) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteOrganizationUserResp.ProtoReflect.Descriptor instead. -func (*DeleteOrganizationUserResp) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{23} -} - -func (x *DeleteOrganizationUserResp) GetErrCode() int32 { - if x != nil { - return x.ErrCode - } - return 0 -} - -func (x *DeleteOrganizationUserResp) GetErrMsg() string { - if x != nil { - return x.ErrMsg - } - return "" -} - -type GetDepartmentMemberReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - DepartmentID string `protobuf:"bytes,1,opt,name=departmentID,proto3" json:"departmentID,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID,proto3" json:"operationID,omitempty"` - OpUserID string `protobuf:"bytes,3,opt,name=opUserID,proto3" json:"opUserID,omitempty"` -} - -func (x *GetDepartmentMemberReq) Reset() { - *x = GetDepartmentMemberReq{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetDepartmentMemberReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDepartmentMemberReq) ProtoMessage() {} - -func (x *GetDepartmentMemberReq) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[24] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetDepartmentMemberReq.ProtoReflect.Descriptor instead. -func (*GetDepartmentMemberReq) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{24} -} - -func (x *GetDepartmentMemberReq) GetDepartmentID() string { - if x != nil { - return x.DepartmentID - } - return "" -} - -func (x *GetDepartmentMemberReq) GetOperationID() string { - if x != nil { - return x.OperationID - } - return "" -} - -func (x *GetDepartmentMemberReq) GetOpUserID() string { - if x != nil { - return x.OpUserID - } - return "" -} - -type GetDepartmentMemberResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ErrCode int32 `protobuf:"varint,1,opt,name=errCode,proto3" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg,proto3" json:"errMsg,omitempty"` - UserDepartmentMemberList []*sdk_ws.UserDepartmentMember `protobuf:"bytes,3,rep,name=userDepartmentMemberList,proto3" json:"userDepartmentMemberList,omitempty"` -} - -func (x *GetDepartmentMemberResp) Reset() { - *x = GetDepartmentMemberResp{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetDepartmentMemberResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDepartmentMemberResp) ProtoMessage() {} - -func (x *GetDepartmentMemberResp) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[25] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetDepartmentMemberResp.ProtoReflect.Descriptor instead. -func (*GetDepartmentMemberResp) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{25} -} - -func (x *GetDepartmentMemberResp) GetErrCode() int32 { - if x != nil { - return x.ErrCode - } - return 0 -} - -func (x *GetDepartmentMemberResp) GetErrMsg() string { - if x != nil { - return x.ErrMsg - } - return "" -} - -func (x *GetDepartmentMemberResp) GetUserDepartmentMemberList() []*sdk_ws.UserDepartmentMember { - if x != nil { - return x.UserDepartmentMemberList - } - return nil -} - -type GetDepartmentRelatedGroupIDListReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - OperationID string `protobuf:"bytes,1,opt,name=operationID,proto3" json:"operationID,omitempty"` - DepartmentIDList []string `protobuf:"bytes,2,rep,name=departmentIDList,proto3" json:"departmentIDList,omitempty"` -} - -func (x *GetDepartmentRelatedGroupIDListReq) Reset() { - *x = GetDepartmentRelatedGroupIDListReq{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetDepartmentRelatedGroupIDListReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDepartmentRelatedGroupIDListReq) ProtoMessage() {} - -func (x *GetDepartmentRelatedGroupIDListReq) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[26] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetDepartmentRelatedGroupIDListReq.ProtoReflect.Descriptor instead. -func (*GetDepartmentRelatedGroupIDListReq) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{26} -} - -func (x *GetDepartmentRelatedGroupIDListReq) GetOperationID() string { - if x != nil { - return x.OperationID - } - return "" -} - -func (x *GetDepartmentRelatedGroupIDListReq) GetDepartmentIDList() []string { - if x != nil { - return x.DepartmentIDList - } - return nil -} - -type GetDepartmentRelatedGroupIDListResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ErrCode int32 `protobuf:"varint,1,opt,name=errCode,proto3" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg,proto3" json:"errMsg,omitempty"` - GroupIDList []string `protobuf:"bytes,3,rep,name=groupIDList,proto3" json:"groupIDList,omitempty"` -} - -func (x *GetDepartmentRelatedGroupIDListResp) Reset() { - *x = GetDepartmentRelatedGroupIDListResp{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetDepartmentRelatedGroupIDListResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDepartmentRelatedGroupIDListResp) ProtoMessage() {} - -func (x *GetDepartmentRelatedGroupIDListResp) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[27] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetDepartmentRelatedGroupIDListResp.ProtoReflect.Descriptor instead. -func (*GetDepartmentRelatedGroupIDListResp) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{27} -} - -func (x *GetDepartmentRelatedGroupIDListResp) GetErrCode() int32 { - if x != nil { - return x.ErrCode - } - return 0 -} - -func (x *GetDepartmentRelatedGroupIDListResp) GetErrMsg() string { - if x != nil { - return x.ErrMsg - } - return "" -} - -func (x *GetDepartmentRelatedGroupIDListResp) GetGroupIDList() []string { - if x != nil { - return x.GroupIDList - } - return nil -} - -type GetUserInOrganizationReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - UserIDList []string `protobuf:"bytes,1,rep,name=userIDList,proto3" json:"userIDList,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=operationID,proto3" json:"operationID,omitempty"` -} - -func (x *GetUserInOrganizationReq) Reset() { - *x = GetUserInOrganizationReq{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetUserInOrganizationReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUserInOrganizationReq) ProtoMessage() {} - -func (x *GetUserInOrganizationReq) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[28] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetUserInOrganizationReq.ProtoReflect.Descriptor instead. -func (*GetUserInOrganizationReq) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{28} -} - -func (x *GetUserInOrganizationReq) GetUserIDList() []string { - if x != nil { - return x.UserIDList - } - return nil -} - -func (x *GetUserInOrganizationReq) GetOperationID() string { - if x != nil { - return x.OperationID - } - return "" -} - -type GetUserInOrganizationResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ErrCode int32 `protobuf:"varint,1,opt,name=errCode,proto3" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg,proto3" json:"errMsg,omitempty"` - OrganizationUsers []*sdk_ws.OrganizationUser `protobuf:"bytes,3,rep,name=organizationUsers,proto3" json:"organizationUsers,omitempty"` -} - -func (x *GetUserInOrganizationResp) Reset() { - *x = GetUserInOrganizationResp{} - if protoimpl.UnsafeEnabled { - mi := &file_organization_organization_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetUserInOrganizationResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUserInOrganizationResp) ProtoMessage() {} - -func (x *GetUserInOrganizationResp) ProtoReflect() protoreflect.Message { - mi := &file_organization_organization_proto_msgTypes[29] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetUserInOrganizationResp.ProtoReflect.Descriptor instead. -func (*GetUserInOrganizationResp) Descriptor() ([]byte, []int) { - return file_organization_organization_proto_rawDescGZIP(), []int{29} -} - -func (x *GetUserInOrganizationResp) GetErrCode() int32 { - if x != nil { - return x.ErrCode - } - return 0 -} - -func (x *GetUserInOrganizationResp) GetErrMsg() string { - if x != nil { - return x.ErrMsg - } - return "" -} - -func (x *GetUserInOrganizationResp) GetOrganizationUsers() []*sdk_ws.OrganizationUser { - if x != nil { - return x.OrganizationUsers - } - return nil -} - -var File_organization_organization_proto protoreflect.FileDescriptor - -var file_organization_organization_proto_rawDesc = []byte{ - 0x0a, 0x1f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6f, - 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, - 0x28, 0x4f, 0x70, 0x65, 0x6e, 0x2d, 0x49, 0x4d, 0x2d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, - 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x64, 0x6b, 0x5f, 0x77, 0x73, - 0x2f, 0x77, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9a, 0x01, 0x0a, 0x13, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, - 0x71, 0x12, 0x45, 0x0a, 0x0e, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x49, - 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x44, 0x65, - 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0e, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, - 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, - 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, - 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x22, 0x8f, 0x01, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x18, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, - 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, - 0x67, 0x12, 0x45, 0x0a, 0x0e, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x49, - 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x44, 0x65, - 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0e, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, - 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x9a, 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, - 0x12, 0x45, 0x0a, 0x0e, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, - 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x44, 0x65, 0x70, - 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0e, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, - 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x55, - 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x55, - 0x73, 0x65, 0x72, 0x49, 0x44, 0x22, 0x48, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, - 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, - 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, - 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, - 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, - 0x77, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, - 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, - 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, - 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, - 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x22, 0x8f, 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, - 0x53, 0x75, 0x62, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, - 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, - 0x4d, 0x73, 0x67, 0x12, 0x45, 0x0a, 0x0e, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, - 0x74, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, - 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0e, 0x64, 0x65, 0x70, 0x61, - 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x77, 0x0a, 0x13, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, - 0x71, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x49, - 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, - 0x65, 0x6e, 0x74, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, - 0x72, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, - 0x72, 0x49, 0x44, 0x22, 0x48, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x65, 0x70, - 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x65, - 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, - 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x64, 0x0a, - 0x1c, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x22, 0x0a, - 0x0c, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x49, - 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x49, 0x44, 0x22, 0x75, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, - 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, - 0x0a, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x22, 0x0a, 0x0c, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x22, 0xca, 0x01, 0x0a, 0x19, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x4f, 0x0a, 0x10, 0x6f, 0x72, 0x67, 0x61, - 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x10, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x6f, - 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, - 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x49, 0x73, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x49, 0x73, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x22, 0x4e, 0x0a, 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0xaa, 0x01, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x4f, 0x0a, 0x10, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x23, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x55, 0x73, 0x65, 0x72, 0x52, 0x10, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x55, 0x73, - 0x65, 0x72, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x55, 0x73, - 0x65, 0x72, 0x49, 0x44, 0x22, 0x4e, 0x0a, 0x1a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, - 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, - 0x72, 0x4d, 0x73, 0x67, 0x22, 0xaa, 0x01, 0x0a, 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, - 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x12, 0x4f, 0x0a, 0x10, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, - 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x2e, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, - 0x72, 0x52, 0x10, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x6d, - 0x62, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, - 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, - 0x44, 0x22, 0x4e, 0x0a, 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x61, 0x72, - 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x18, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, - 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, - 0x67, 0x22, 0x6e, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x44, 0x65, - 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, - 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, - 0x72, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, - 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, - 0x44, 0x22, 0x9c, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x44, - 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, - 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, - 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, - 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, - 0x4f, 0x0a, 0x10, 0x75, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, - 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x55, 0x73, - 0x65, 0x72, 0x49, 0x6e, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x10, - 0x75, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, - 0x22, 0xaa, 0x01, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, - 0x6e, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x4f, - 0x0a, 0x10, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x6d, 0x62, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x44, 0x65, 0x70, - 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x10, 0x64, - 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, - 0x20, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, - 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x22, 0x4e, 0x0a, - 0x1a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x44, 0x65, 0x70, - 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x65, - 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, - 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x95, 0x01, - 0x0a, 0x19, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x44, 0x65, - 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, - 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, - 0x72, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, - 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, - 0x44, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x49, - 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, - 0x65, 0x6e, 0x74, 0x49, 0x44, 0x22, 0x4e, 0x0a, 0x1a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, - 0x73, 0x65, 0x72, 0x49, 0x6e, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, - 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x71, 0x0a, 0x19, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, - 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, - 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x22, 0x4e, 0x0a, 0x1a, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, - 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x7a, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x44, - 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, - 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, - 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x55, 0x73, - 0x65, 0x72, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x55, 0x73, - 0x65, 0x72, 0x49, 0x44, 0x22, 0xb0, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x61, - 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x18, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, - 0x72, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, - 0x73, 0x67, 0x12, 0x63, 0x0a, 0x18, 0x75, 0x73, 0x65, 0x72, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, - 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, - 0x69, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x70, - 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x18, 0x75, - 0x73, 0x65, 0x72, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x6d, - 0x62, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x72, 0x0a, 0x22, 0x47, 0x65, 0x74, 0x44, 0x65, - 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, - 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, - 0x2a, 0x0a, 0x10, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x4c, - 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x64, 0x65, 0x70, 0x61, 0x72, - 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x79, 0x0a, 0x23, 0x47, - 0x65, 0x74, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x6c, 0x61, - 0x74, 0x65, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, - 0x72, 0x4d, 0x73, 0x67, 0x12, 0x20, 0x0a, 0x0b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x4c, - 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x5c, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x49, 0x6e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x4c, 0x69, - 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, - 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x49, 0x44, 0x22, 0xa0, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, - 0x49, 0x6e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, - 0x72, 0x4d, 0x73, 0x67, 0x12, 0x51, 0x0a, 0x11, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x23, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x55, 0x73, 0x65, 0x72, 0x52, 0x11, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x73, 0x32, 0xb9, 0x0c, 0x0a, 0x0c, 0x6f, 0x72, 0x67, 0x61, - 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x59, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x21, 0x2e, 0x6f, - 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, - 0x22, 0x2e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x59, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, - 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x21, 0x2e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, - 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x6f, 0x72, 0x67, - 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x59, - 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, - 0x6e, 0x74, 0x12, 0x21, 0x2e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, - 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x44, 0x65, 0x70, 0x61, 0x72, - 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x59, 0x0a, 0x10, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x21, 0x2e, - 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, - 0x1a, 0x22, 0x2e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x74, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x61, 0x72, - 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x4c, 0x69, 0x73, - 0x74, 0x12, 0x2a, 0x2e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x61, - 0x72, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x2b, 0x2e, - 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, - 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x6b, 0x0a, 0x16, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x55, 0x73, 0x65, 0x72, 0x12, 0x27, 0x2e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x28, 0x2e, - 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x6b, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, - 0x72, 0x12, 0x27, 0x2e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x28, 0x2e, 0x6f, 0x72, 0x67, - 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x6b, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x72, - 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x27, - 0x2e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x28, 0x2e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x72, 0x67, - 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x6b, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x61, 0x72, - 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x27, 0x2e, 0x6f, 0x72, - 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x1a, 0x28, 0x2e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, - 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x62, - 0x0a, 0x13, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x44, 0x65, 0x70, 0x61, 0x72, - 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x24, 0x2e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x44, 0x65, - 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x6f, 0x72, - 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, - 0x65, 0x72, 0x49, 0x6e, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x6b, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, - 0x49, 0x6e, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x27, 0x2e, 0x6f, - 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, - 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x28, 0x2e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, - 0x6e, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x6b, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x44, - 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x27, 0x2e, 0x6f, 0x72, 0x67, 0x61, - 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, - 0x73, 0x65, 0x72, 0x49, 0x6e, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, - 0x65, 0x71, 0x1a, 0x28, 0x2e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x44, 0x65, - 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x62, 0x0a, 0x13, - 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x6d, - 0x62, 0x65, 0x72, 0x12, 0x24, 0x2e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, - 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x6f, 0x72, 0x67, 0x61, - 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x61, - 0x72, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x86, 0x01, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, - 0x6e, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, - 0x4c, 0x69, 0x73, 0x74, 0x12, 0x30, 0x2e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, 0x65, 0x6e, - 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x31, 0x2e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x6d, - 0x65, 0x6e, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, - 0x44, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x68, 0x0a, 0x15, 0x47, 0x65, 0x74, - 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x26, 0x2e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x4f, 0x72, 0x67, 0x61, 0x6e, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x27, 0x2e, 0x6f, 0x72, 0x67, - 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x49, 0x6e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x42, 0x2d, 0x5a, 0x2b, 0x4f, 0x70, 0x65, 0x6e, 0x5f, 0x49, 0x4d, 0x2f, 0x70, - 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_organization_organization_proto_rawDescOnce sync.Once - file_organization_organization_proto_rawDescData = file_organization_organization_proto_rawDesc -) - -func file_organization_organization_proto_rawDescGZIP() []byte { - file_organization_organization_proto_rawDescOnce.Do(func() { - file_organization_organization_proto_rawDescData = protoimpl.X.CompressGZIP(file_organization_organization_proto_rawDescData) - }) - return file_organization_organization_proto_rawDescData -} - -var file_organization_organization_proto_msgTypes = make([]protoimpl.MessageInfo, 30) -var file_organization_organization_proto_goTypes = []interface{}{ - (*CreateDepartmentReq)(nil), // 0: organization.CreateDepartmentReq - (*CreateDepartmentResp)(nil), // 1: organization.CreateDepartmentResp - (*UpdateDepartmentReq)(nil), // 2: organization.UpdateDepartmentReq - (*UpdateDepartmentResp)(nil), // 3: organization.UpdateDepartmentResp - (*GetSubDepartmentReq)(nil), // 4: organization.GetSubDepartmentReq - (*GetSubDepartmentResp)(nil), // 5: organization.GetSubDepartmentResp - (*DeleteDepartmentReq)(nil), // 6: organization.DeleteDepartmentReq - (*DeleteDepartmentResp)(nil), // 7: organization.DeleteDepartmentResp - (*GetDepartmentParentIDListReq)(nil), // 8: organization.GetDepartmentParentIDListReq - (*GetDepartmentParentIDListResp)(nil), // 9: organization.GetDepartmentParentIDListResp - (*CreateOrganizationUserReq)(nil), // 10: organization.CreateOrganizationUserReq - (*CreateOrganizationUserResp)(nil), // 11: organization.CreateOrganizationUserResp - (*UpdateOrganizationUserReq)(nil), // 12: organization.UpdateOrganizationUserReq - (*UpdateOrganizationUserResp)(nil), // 13: organization.UpdateOrganizationUserResp - (*CreateDepartmentMemberReq)(nil), // 14: organization.CreateDepartmentMemberReq - (*CreateDepartmentMemberResp)(nil), // 15: organization.CreateDepartmentMemberResp - (*GetUserInDepartmentReq)(nil), // 16: organization.GetUserInDepartmentReq - (*GetUserInDepartmentResp)(nil), // 17: organization.GetUserInDepartmentResp - (*UpdateUserInDepartmentReq)(nil), // 18: organization.UpdateUserInDepartmentReq - (*UpdateUserInDepartmentResp)(nil), // 19: organization.UpdateUserInDepartmentResp - (*DeleteUserInDepartmentReq)(nil), // 20: organization.DeleteUserInDepartmentReq - (*DeleteUserInDepartmentResp)(nil), // 21: organization.DeleteUserInDepartmentResp - (*DeleteOrganizationUserReq)(nil), // 22: organization.DeleteOrganizationUserReq - (*DeleteOrganizationUserResp)(nil), // 23: organization.DeleteOrganizationUserResp - (*GetDepartmentMemberReq)(nil), // 24: organization.GetDepartmentMemberReq - (*GetDepartmentMemberResp)(nil), // 25: organization.GetDepartmentMemberResp - (*GetDepartmentRelatedGroupIDListReq)(nil), // 26: organization.GetDepartmentRelatedGroupIDListReq - (*GetDepartmentRelatedGroupIDListResp)(nil), // 27: organization.GetDepartmentRelatedGroupIDListResp - (*GetUserInOrganizationReq)(nil), // 28: organization.GetUserInOrganizationReq - (*GetUserInOrganizationResp)(nil), // 29: organization.GetUserInOrganizationResp - (*sdk_ws.Department)(nil), // 30: server_api_params.Department - (*sdk_ws.OrganizationUser)(nil), // 31: server_api_params.OrganizationUser - (*sdk_ws.DepartmentMember)(nil), // 32: server_api_params.DepartmentMember - (*sdk_ws.UserInDepartment)(nil), // 33: server_api_params.UserInDepartment - (*sdk_ws.UserDepartmentMember)(nil), // 34: server_api_params.UserDepartmentMember -} -var file_organization_organization_proto_depIdxs = []int32{ - 30, // 0: organization.CreateDepartmentReq.departmentInfo:type_name -> server_api_params.Department - 30, // 1: organization.CreateDepartmentResp.departmentInfo:type_name -> server_api_params.Department - 30, // 2: organization.UpdateDepartmentReq.departmentInfo:type_name -> server_api_params.Department - 30, // 3: organization.GetSubDepartmentResp.departmentList:type_name -> server_api_params.Department - 31, // 4: organization.CreateOrganizationUserReq.organizationUser:type_name -> server_api_params.OrganizationUser - 31, // 5: organization.UpdateOrganizationUserReq.organizationUser:type_name -> server_api_params.OrganizationUser - 32, // 6: organization.CreateDepartmentMemberReq.departmentMember:type_name -> server_api_params.DepartmentMember - 33, // 7: organization.GetUserInDepartmentResp.userInDepartment:type_name -> server_api_params.UserInDepartment - 32, // 8: organization.UpdateUserInDepartmentReq.departmentMember:type_name -> server_api_params.DepartmentMember - 34, // 9: organization.GetDepartmentMemberResp.userDepartmentMemberList:type_name -> server_api_params.UserDepartmentMember - 31, // 10: organization.GetUserInOrganizationResp.organizationUsers:type_name -> server_api_params.OrganizationUser - 0, // 11: organization.organization.CreateDepartment:input_type -> organization.CreateDepartmentReq - 2, // 12: organization.organization.UpdateDepartment:input_type -> organization.UpdateDepartmentReq - 4, // 13: organization.organization.GetSubDepartment:input_type -> organization.GetSubDepartmentReq - 6, // 14: organization.organization.DeleteDepartment:input_type -> organization.DeleteDepartmentReq - 8, // 15: organization.organization.GetDepartmentParentIDList:input_type -> organization.GetDepartmentParentIDListReq - 10, // 16: organization.organization.CreateOrganizationUser:input_type -> organization.CreateOrganizationUserReq - 12, // 17: organization.organization.UpdateOrganizationUser:input_type -> organization.UpdateOrganizationUserReq - 22, // 18: organization.organization.DeleteOrganizationUser:input_type -> organization.DeleteOrganizationUserReq - 14, // 19: organization.organization.CreateDepartmentMember:input_type -> organization.CreateDepartmentMemberReq - 16, // 20: organization.organization.GetUserInDepartment:input_type -> organization.GetUserInDepartmentReq - 20, // 21: organization.organization.DeleteUserInDepartment:input_type -> organization.DeleteUserInDepartmentReq - 18, // 22: organization.organization.UpdateUserInDepartment:input_type -> organization.UpdateUserInDepartmentReq - 24, // 23: organization.organization.GetDepartmentMember:input_type -> organization.GetDepartmentMemberReq - 26, // 24: organization.organization.GetDepartmentRelatedGroupIDList:input_type -> organization.GetDepartmentRelatedGroupIDListReq - 28, // 25: organization.organization.GetUserInOrganization:input_type -> organization.GetUserInOrganizationReq - 1, // 26: organization.organization.CreateDepartment:output_type -> organization.CreateDepartmentResp - 3, // 27: organization.organization.UpdateDepartment:output_type -> organization.UpdateDepartmentResp - 5, // 28: organization.organization.GetSubDepartment:output_type -> organization.GetSubDepartmentResp - 7, // 29: organization.organization.DeleteDepartment:output_type -> organization.DeleteDepartmentResp - 9, // 30: organization.organization.GetDepartmentParentIDList:output_type -> organization.GetDepartmentParentIDListResp - 11, // 31: organization.organization.CreateOrganizationUser:output_type -> organization.CreateOrganizationUserResp - 13, // 32: organization.organization.UpdateOrganizationUser:output_type -> organization.UpdateOrganizationUserResp - 23, // 33: organization.organization.DeleteOrganizationUser:output_type -> organization.DeleteOrganizationUserResp - 15, // 34: organization.organization.CreateDepartmentMember:output_type -> organization.CreateDepartmentMemberResp - 17, // 35: organization.organization.GetUserInDepartment:output_type -> organization.GetUserInDepartmentResp - 21, // 36: organization.organization.DeleteUserInDepartment:output_type -> organization.DeleteUserInDepartmentResp - 19, // 37: organization.organization.UpdateUserInDepartment:output_type -> organization.UpdateUserInDepartmentResp - 25, // 38: organization.organization.GetDepartmentMember:output_type -> organization.GetDepartmentMemberResp - 27, // 39: organization.organization.GetDepartmentRelatedGroupIDList:output_type -> organization.GetDepartmentRelatedGroupIDListResp - 29, // 40: organization.organization.GetUserInOrganization:output_type -> organization.GetUserInOrganizationResp - 26, // [26:41] is the sub-list for method output_type - 11, // [11:26] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name -} - -func init() { file_organization_organization_proto_init() } -func file_organization_organization_proto_init() { - if File_organization_organization_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_organization_organization_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateDepartmentReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateDepartmentResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateDepartmentReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateDepartmentResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSubDepartmentReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSubDepartmentResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteDepartmentReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteDepartmentResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDepartmentParentIDListReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDepartmentParentIDListResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateOrganizationUserReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateOrganizationUserResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateOrganizationUserReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateOrganizationUserResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateDepartmentMemberReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateDepartmentMemberResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserInDepartmentReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserInDepartmentResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUserInDepartmentReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUserInDepartmentResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteUserInDepartmentReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteUserInDepartmentResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteOrganizationUserReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteOrganizationUserResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDepartmentMemberReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDepartmentMemberResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDepartmentRelatedGroupIDListReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDepartmentRelatedGroupIDListResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserInOrganizationReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_organization_organization_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserInOrganizationResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_organization_organization_proto_rawDesc, - NumEnums: 0, - NumMessages: 30, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_organization_organization_proto_goTypes, - DependencyIndexes: file_organization_organization_proto_depIdxs, - MessageInfos: file_organization_organization_proto_msgTypes, - }.Build() - File_organization_organization_proto = out.File - file_organization_organization_proto_rawDesc = nil - file_organization_organization_proto_goTypes = nil - file_organization_organization_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// OrganizationClient is the client API for Organization service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type OrganizationClient interface { - CreateDepartment(ctx context.Context, in *CreateDepartmentReq, opts ...grpc.CallOption) (*CreateDepartmentResp, error) - UpdateDepartment(ctx context.Context, in *UpdateDepartmentReq, opts ...grpc.CallOption) (*UpdateDepartmentResp, error) - GetSubDepartment(ctx context.Context, in *GetSubDepartmentReq, opts ...grpc.CallOption) (*GetSubDepartmentResp, error) - DeleteDepartment(ctx context.Context, in *DeleteDepartmentReq, opts ...grpc.CallOption) (*DeleteDepartmentResp, error) - GetDepartmentParentIDList(ctx context.Context, in *GetDepartmentParentIDListReq, opts ...grpc.CallOption) (*GetDepartmentParentIDListResp, error) - CreateOrganizationUser(ctx context.Context, in *CreateOrganizationUserReq, opts ...grpc.CallOption) (*CreateOrganizationUserResp, error) - UpdateOrganizationUser(ctx context.Context, in *UpdateOrganizationUserReq, opts ...grpc.CallOption) (*UpdateOrganizationUserResp, error) - DeleteOrganizationUser(ctx context.Context, in *DeleteOrganizationUserReq, opts ...grpc.CallOption) (*DeleteOrganizationUserResp, error) - CreateDepartmentMember(ctx context.Context, in *CreateDepartmentMemberReq, opts ...grpc.CallOption) (*CreateDepartmentMemberResp, error) - GetUserInDepartment(ctx context.Context, in *GetUserInDepartmentReq, opts ...grpc.CallOption) (*GetUserInDepartmentResp, error) - DeleteUserInDepartment(ctx context.Context, in *DeleteUserInDepartmentReq, opts ...grpc.CallOption) (*DeleteUserInDepartmentResp, error) - UpdateUserInDepartment(ctx context.Context, in *UpdateUserInDepartmentReq, opts ...grpc.CallOption) (*UpdateUserInDepartmentResp, error) - GetDepartmentMember(ctx context.Context, in *GetDepartmentMemberReq, opts ...grpc.CallOption) (*GetDepartmentMemberResp, error) - GetDepartmentRelatedGroupIDList(ctx context.Context, in *GetDepartmentRelatedGroupIDListReq, opts ...grpc.CallOption) (*GetDepartmentRelatedGroupIDListResp, error) - GetUserInOrganization(ctx context.Context, in *GetUserInOrganizationReq, opts ...grpc.CallOption) (*GetUserInOrganizationResp, error) -} - -type organizationClient struct { - cc grpc.ClientConnInterface -} - -func NewOrganizationClient(cc grpc.ClientConnInterface) OrganizationClient { - return &organizationClient{cc} -} - -func (c *organizationClient) CreateDepartment(ctx context.Context, in *CreateDepartmentReq, opts ...grpc.CallOption) (*CreateDepartmentResp, error) { - out := new(CreateDepartmentResp) - err := c.cc.Invoke(ctx, "/organization.organization/CreateDepartment", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *organizationClient) UpdateDepartment(ctx context.Context, in *UpdateDepartmentReq, opts ...grpc.CallOption) (*UpdateDepartmentResp, error) { - out := new(UpdateDepartmentResp) - err := c.cc.Invoke(ctx, "/organization.organization/UpdateDepartment", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *organizationClient) GetSubDepartment(ctx context.Context, in *GetSubDepartmentReq, opts ...grpc.CallOption) (*GetSubDepartmentResp, error) { - out := new(GetSubDepartmentResp) - err := c.cc.Invoke(ctx, "/organization.organization/GetSubDepartment", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *organizationClient) DeleteDepartment(ctx context.Context, in *DeleteDepartmentReq, opts ...grpc.CallOption) (*DeleteDepartmentResp, error) { - out := new(DeleteDepartmentResp) - err := c.cc.Invoke(ctx, "/organization.organization/DeleteDepartment", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *organizationClient) GetDepartmentParentIDList(ctx context.Context, in *GetDepartmentParentIDListReq, opts ...grpc.CallOption) (*GetDepartmentParentIDListResp, error) { - out := new(GetDepartmentParentIDListResp) - err := c.cc.Invoke(ctx, "/organization.organization/GetDepartmentParentIDList", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *organizationClient) CreateOrganizationUser(ctx context.Context, in *CreateOrganizationUserReq, opts ...grpc.CallOption) (*CreateOrganizationUserResp, error) { - out := new(CreateOrganizationUserResp) - err := c.cc.Invoke(ctx, "/organization.organization/CreateOrganizationUser", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *organizationClient) UpdateOrganizationUser(ctx context.Context, in *UpdateOrganizationUserReq, opts ...grpc.CallOption) (*UpdateOrganizationUserResp, error) { - out := new(UpdateOrganizationUserResp) - err := c.cc.Invoke(ctx, "/organization.organization/UpdateOrganizationUser", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *organizationClient) DeleteOrganizationUser(ctx context.Context, in *DeleteOrganizationUserReq, opts ...grpc.CallOption) (*DeleteOrganizationUserResp, error) { - out := new(DeleteOrganizationUserResp) - err := c.cc.Invoke(ctx, "/organization.organization/DeleteOrganizationUser", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *organizationClient) CreateDepartmentMember(ctx context.Context, in *CreateDepartmentMemberReq, opts ...grpc.CallOption) (*CreateDepartmentMemberResp, error) { - out := new(CreateDepartmentMemberResp) - err := c.cc.Invoke(ctx, "/organization.organization/CreateDepartmentMember", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *organizationClient) GetUserInDepartment(ctx context.Context, in *GetUserInDepartmentReq, opts ...grpc.CallOption) (*GetUserInDepartmentResp, error) { - out := new(GetUserInDepartmentResp) - err := c.cc.Invoke(ctx, "/organization.organization/GetUserInDepartment", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *organizationClient) DeleteUserInDepartment(ctx context.Context, in *DeleteUserInDepartmentReq, opts ...grpc.CallOption) (*DeleteUserInDepartmentResp, error) { - out := new(DeleteUserInDepartmentResp) - err := c.cc.Invoke(ctx, "/organization.organization/DeleteUserInDepartment", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *organizationClient) UpdateUserInDepartment(ctx context.Context, in *UpdateUserInDepartmentReq, opts ...grpc.CallOption) (*UpdateUserInDepartmentResp, error) { - out := new(UpdateUserInDepartmentResp) - err := c.cc.Invoke(ctx, "/organization.organization/UpdateUserInDepartment", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *organizationClient) GetDepartmentMember(ctx context.Context, in *GetDepartmentMemberReq, opts ...grpc.CallOption) (*GetDepartmentMemberResp, error) { - out := new(GetDepartmentMemberResp) - err := c.cc.Invoke(ctx, "/organization.organization/GetDepartmentMember", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *organizationClient) GetDepartmentRelatedGroupIDList(ctx context.Context, in *GetDepartmentRelatedGroupIDListReq, opts ...grpc.CallOption) (*GetDepartmentRelatedGroupIDListResp, error) { - out := new(GetDepartmentRelatedGroupIDListResp) - err := c.cc.Invoke(ctx, "/organization.organization/GetDepartmentRelatedGroupIDList", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *organizationClient) GetUserInOrganization(ctx context.Context, in *GetUserInOrganizationReq, opts ...grpc.CallOption) (*GetUserInOrganizationResp, error) { - out := new(GetUserInOrganizationResp) - err := c.cc.Invoke(ctx, "/organization.organization/GetUserInOrganization", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// OrganizationServer is the server API for Organization service. -type OrganizationServer interface { - CreateDepartment(context.Context, *CreateDepartmentReq) (*CreateDepartmentResp, error) - UpdateDepartment(context.Context, *UpdateDepartmentReq) (*UpdateDepartmentResp, error) - GetSubDepartment(context.Context, *GetSubDepartmentReq) (*GetSubDepartmentResp, error) - DeleteDepartment(context.Context, *DeleteDepartmentReq) (*DeleteDepartmentResp, error) - GetDepartmentParentIDList(context.Context, *GetDepartmentParentIDListReq) (*GetDepartmentParentIDListResp, error) - CreateOrganizationUser(context.Context, *CreateOrganizationUserReq) (*CreateOrganizationUserResp, error) - UpdateOrganizationUser(context.Context, *UpdateOrganizationUserReq) (*UpdateOrganizationUserResp, error) - DeleteOrganizationUser(context.Context, *DeleteOrganizationUserReq) (*DeleteOrganizationUserResp, error) - CreateDepartmentMember(context.Context, *CreateDepartmentMemberReq) (*CreateDepartmentMemberResp, error) - GetUserInDepartment(context.Context, *GetUserInDepartmentReq) (*GetUserInDepartmentResp, error) - DeleteUserInDepartment(context.Context, *DeleteUserInDepartmentReq) (*DeleteUserInDepartmentResp, error) - UpdateUserInDepartment(context.Context, *UpdateUserInDepartmentReq) (*UpdateUserInDepartmentResp, error) - GetDepartmentMember(context.Context, *GetDepartmentMemberReq) (*GetDepartmentMemberResp, error) - GetDepartmentRelatedGroupIDList(context.Context, *GetDepartmentRelatedGroupIDListReq) (*GetDepartmentRelatedGroupIDListResp, error) - GetUserInOrganization(context.Context, *GetUserInOrganizationReq) (*GetUserInOrganizationResp, error) -} - -// UnimplementedOrganizationServer can be embedded to have forward compatible implementations. -type UnimplementedOrganizationServer struct { -} - -func (*UnimplementedOrganizationServer) CreateDepartment(context.Context, *CreateDepartmentReq) (*CreateDepartmentResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateDepartment not implemented") -} -func (*UnimplementedOrganizationServer) UpdateDepartment(context.Context, *UpdateDepartmentReq) (*UpdateDepartmentResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateDepartment not implemented") -} -func (*UnimplementedOrganizationServer) GetSubDepartment(context.Context, *GetSubDepartmentReq) (*GetSubDepartmentResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSubDepartment not implemented") -} -func (*UnimplementedOrganizationServer) DeleteDepartment(context.Context, *DeleteDepartmentReq) (*DeleteDepartmentResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteDepartment not implemented") -} -func (*UnimplementedOrganizationServer) GetDepartmentParentIDList(context.Context, *GetDepartmentParentIDListReq) (*GetDepartmentParentIDListResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetDepartmentParentIDList not implemented") -} -func (*UnimplementedOrganizationServer) CreateOrganizationUser(context.Context, *CreateOrganizationUserReq) (*CreateOrganizationUserResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateOrganizationUser not implemented") -} -func (*UnimplementedOrganizationServer) UpdateOrganizationUser(context.Context, *UpdateOrganizationUserReq) (*UpdateOrganizationUserResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateOrganizationUser not implemented") -} -func (*UnimplementedOrganizationServer) DeleteOrganizationUser(context.Context, *DeleteOrganizationUserReq) (*DeleteOrganizationUserResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteOrganizationUser not implemented") -} -func (*UnimplementedOrganizationServer) CreateDepartmentMember(context.Context, *CreateDepartmentMemberReq) (*CreateDepartmentMemberResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateDepartmentMember not implemented") -} -func (*UnimplementedOrganizationServer) GetUserInDepartment(context.Context, *GetUserInDepartmentReq) (*GetUserInDepartmentResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetUserInDepartment not implemented") -} -func (*UnimplementedOrganizationServer) DeleteUserInDepartment(context.Context, *DeleteUserInDepartmentReq) (*DeleteUserInDepartmentResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteUserInDepartment not implemented") -} -func (*UnimplementedOrganizationServer) UpdateUserInDepartment(context.Context, *UpdateUserInDepartmentReq) (*UpdateUserInDepartmentResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateUserInDepartment not implemented") -} -func (*UnimplementedOrganizationServer) GetDepartmentMember(context.Context, *GetDepartmentMemberReq) (*GetDepartmentMemberResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetDepartmentMember not implemented") -} -func (*UnimplementedOrganizationServer) GetDepartmentRelatedGroupIDList(context.Context, *GetDepartmentRelatedGroupIDListReq) (*GetDepartmentRelatedGroupIDListResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetDepartmentRelatedGroupIDList not implemented") -} -func (*UnimplementedOrganizationServer) GetUserInOrganization(context.Context, *GetUserInOrganizationReq) (*GetUserInOrganizationResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetUserInOrganization not implemented") -} - -func RegisterOrganizationServer(s *grpc.Server, srv OrganizationServer) { - s.RegisterService(&_Organization_serviceDesc, srv) -} - -func _Organization_CreateDepartment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateDepartmentReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OrganizationServer).CreateDepartment(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/organization.organization/CreateDepartment", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OrganizationServer).CreateDepartment(ctx, req.(*CreateDepartmentReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Organization_UpdateDepartment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateDepartmentReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OrganizationServer).UpdateDepartment(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/organization.organization/UpdateDepartment", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OrganizationServer).UpdateDepartment(ctx, req.(*UpdateDepartmentReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Organization_GetSubDepartment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetSubDepartmentReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OrganizationServer).GetSubDepartment(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/organization.organization/GetSubDepartment", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OrganizationServer).GetSubDepartment(ctx, req.(*GetSubDepartmentReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Organization_DeleteDepartment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteDepartmentReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OrganizationServer).DeleteDepartment(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/organization.organization/DeleteDepartment", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OrganizationServer).DeleteDepartment(ctx, req.(*DeleteDepartmentReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Organization_GetDepartmentParentIDList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetDepartmentParentIDListReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OrganizationServer).GetDepartmentParentIDList(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/organization.organization/GetDepartmentParentIDList", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OrganizationServer).GetDepartmentParentIDList(ctx, req.(*GetDepartmentParentIDListReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Organization_CreateOrganizationUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateOrganizationUserReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OrganizationServer).CreateOrganizationUser(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/organization.organization/CreateOrganizationUser", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OrganizationServer).CreateOrganizationUser(ctx, req.(*CreateOrganizationUserReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Organization_UpdateOrganizationUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateOrganizationUserReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OrganizationServer).UpdateOrganizationUser(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/organization.organization/UpdateOrganizationUser", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OrganizationServer).UpdateOrganizationUser(ctx, req.(*UpdateOrganizationUserReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Organization_DeleteOrganizationUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteOrganizationUserReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OrganizationServer).DeleteOrganizationUser(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/organization.organization/DeleteOrganizationUser", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OrganizationServer).DeleteOrganizationUser(ctx, req.(*DeleteOrganizationUserReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Organization_CreateDepartmentMember_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateDepartmentMemberReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OrganizationServer).CreateDepartmentMember(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/organization.organization/CreateDepartmentMember", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OrganizationServer).CreateDepartmentMember(ctx, req.(*CreateDepartmentMemberReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Organization_GetUserInDepartment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetUserInDepartmentReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OrganizationServer).GetUserInDepartment(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/organization.organization/GetUserInDepartment", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OrganizationServer).GetUserInDepartment(ctx, req.(*GetUserInDepartmentReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Organization_DeleteUserInDepartment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteUserInDepartmentReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OrganizationServer).DeleteUserInDepartment(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/organization.organization/DeleteUserInDepartment", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OrganizationServer).DeleteUserInDepartment(ctx, req.(*DeleteUserInDepartmentReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Organization_UpdateUserInDepartment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateUserInDepartmentReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OrganizationServer).UpdateUserInDepartment(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/organization.organization/UpdateUserInDepartment", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OrganizationServer).UpdateUserInDepartment(ctx, req.(*UpdateUserInDepartmentReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Organization_GetDepartmentMember_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetDepartmentMemberReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OrganizationServer).GetDepartmentMember(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/organization.organization/GetDepartmentMember", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OrganizationServer).GetDepartmentMember(ctx, req.(*GetDepartmentMemberReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Organization_GetDepartmentRelatedGroupIDList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetDepartmentRelatedGroupIDListReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OrganizationServer).GetDepartmentRelatedGroupIDList(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/organization.organization/GetDepartmentRelatedGroupIDList", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OrganizationServer).GetDepartmentRelatedGroupIDList(ctx, req.(*GetDepartmentRelatedGroupIDListReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _Organization_GetUserInOrganization_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetUserInOrganizationReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OrganizationServer).GetUserInOrganization(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/organization.organization/GetUserInOrganization", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OrganizationServer).GetUserInOrganization(ctx, req.(*GetUserInOrganizationReq)) - } - return interceptor(ctx, in, info, handler) -} - -var _Organization_serviceDesc = grpc.ServiceDesc{ - ServiceName: "organization.organization", - HandlerType: (*OrganizationServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateDepartment", - Handler: _Organization_CreateDepartment_Handler, - }, - { - MethodName: "UpdateDepartment", - Handler: _Organization_UpdateDepartment_Handler, - }, - { - MethodName: "GetSubDepartment", - Handler: _Organization_GetSubDepartment_Handler, - }, - { - MethodName: "DeleteDepartment", - Handler: _Organization_DeleteDepartment_Handler, - }, - { - MethodName: "GetDepartmentParentIDList", - Handler: _Organization_GetDepartmentParentIDList_Handler, - }, - { - MethodName: "CreateOrganizationUser", - Handler: _Organization_CreateOrganizationUser_Handler, - }, - { - MethodName: "UpdateOrganizationUser", - Handler: _Organization_UpdateOrganizationUser_Handler, - }, - { - MethodName: "DeleteOrganizationUser", - Handler: _Organization_DeleteOrganizationUser_Handler, - }, - { - MethodName: "CreateDepartmentMember", - Handler: _Organization_CreateDepartmentMember_Handler, - }, - { - MethodName: "GetUserInDepartment", - Handler: _Organization_GetUserInDepartment_Handler, - }, - { - MethodName: "DeleteUserInDepartment", - Handler: _Organization_DeleteUserInDepartment_Handler, - }, - { - MethodName: "UpdateUserInDepartment", - Handler: _Organization_UpdateUserInDepartment_Handler, - }, - { - MethodName: "GetDepartmentMember", - Handler: _Organization_GetDepartmentMember_Handler, - }, - { - MethodName: "GetDepartmentRelatedGroupIDList", - Handler: _Organization_GetDepartmentRelatedGroupIDList_Handler, - }, - { - MethodName: "GetUserInOrganization", - Handler: _Organization_GetUserInOrganization_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "organization/organization.proto", -} diff --git a/pkg/proto/organization/organization.proto b/pkg/proto/organization/organization.proto deleted file mode 100644 index 3dfa9f3bc..000000000 --- a/pkg/proto/organization/organization.proto +++ /dev/null @@ -1,209 +0,0 @@ -syntax = "proto3"; -import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto"; -option go_package = "Open_IM/pkg/proto/organization;organization"; -package organization; - - -message CreateDepartmentReq{ - server_api_params.Department departmentInfo = 1; - string operationID = 2; - string opUserID = 3; -} - -message CreateDepartmentResp{ - int32 errCode = 1; - string errMsg = 2; - server_api_params.Department departmentInfo = 3; -} - -message UpdateDepartmentReq{ - server_api_params.Department departmentInfo = 1; - string operationID = 2; - string opUserID = 3; -} - -message UpdateDepartmentResp{ - int32 errCode = 1; - string errMsg = 2; -} - - -message GetSubDepartmentReq{ - string departmentID = 1; - string operationID = 2; - string opUserID = 3; -} - -message GetSubDepartmentResp{ - int32 errCode = 1; - string errMsg = 2; - repeated server_api_params.Department departmentList = 3; -} - -message DeleteDepartmentReq{ - string departmentID = 1; - string operationID = 2; - string opUserID = 3; -} - -message DeleteDepartmentResp{ - int32 errCode = 1; - string errMsg = 2; -} - -message GetDepartmentParentIDListReq { - string departmentID = 1; - string operationID = 2; -} - -message GetDepartmentParentIDListResp { - int32 errCode = 1; - string errMsg = 2; - repeated string parentIDList = 3; -} - - -message CreateOrganizationUserReq{ - server_api_params.OrganizationUser organizationUser = 1; - string operationID = 2; - string opUserID = 3; - bool IsRegister = 4; -} - - -message CreateOrganizationUserResp{ - int32 errCode = 1; - string errMsg = 2; -} - - -message UpdateOrganizationUserReq{ - server_api_params.OrganizationUser organizationUser = 1; - string operationID = 2; - string opUserID = 3; -} - - -message UpdateOrganizationUserResp{ - int32 errCode = 1; - string errMsg = 2; -} - - - - -message CreateDepartmentMemberReq{ - server_api_params.DepartmentMember departmentMember = 1; - string operationID = 2; - string opUserID = 3; -} -message CreateDepartmentMemberResp{ - int32 errCode = 1; - string errMsg = 2; -} - - -message GetUserInDepartmentReq{ - string userID = 1; - string operationID = 2; - string opUserID = 3; -} -message GetUserInDepartmentResp{ - int32 errCode = 1; - string errMsg = 2; - server_api_params.UserInDepartment userInDepartment = 3; -} - - -message UpdateUserInDepartmentReq{ - server_api_params.DepartmentMember departmentMember = 1; - string operationID = 2; - string opUserID = 3; -} -message UpdateUserInDepartmentResp{ - int32 errCode = 1; - string errMsg = 2; -} - - -message DeleteUserInDepartmentReq{ - string userID = 1; - string operationID = 2; - string opUserID = 3; - string departmentID = 4; -} -message DeleteUserInDepartmentResp{ - int32 errCode = 1; - string errMsg = 2; -} - -message DeleteOrganizationUserReq{ - string userID = 1; - string operationID = 2; - string opUserID = 3; -} -message DeleteOrganizationUserResp{ - int32 errCode = 1; - string errMsg = 2; -} - - -message GetDepartmentMemberReq{ - string departmentID = 1; - string operationID = 2; - string opUserID = 3; -} - -message GetDepartmentMemberResp{ - int32 errCode = 1; - string errMsg = 2; - repeated server_api_params.UserDepartmentMember userDepartmentMemberList = 3; -} - -message GetDepartmentRelatedGroupIDListReq { - string operationID = 1; - repeated string departmentIDList = 2; -} - -message GetDepartmentRelatedGroupIDListResp { - int32 errCode = 1; - string errMsg = 2; - repeated string groupIDList = 3; -} - -message GetUserInOrganizationReq{ - repeated string userIDList = 1; - string operationID = 2; -} - -message GetUserInOrganizationResp{ - int32 errCode = 1; - string errMsg = 2; - repeated server_api_params.OrganizationUser organizationUsers = 3; -} - -service organization{ - rpc CreateDepartment(CreateDepartmentReq) returns(CreateDepartmentResp); - rpc UpdateDepartment(UpdateDepartmentReq) returns(UpdateDepartmentResp); - rpc GetSubDepartment(GetSubDepartmentReq) returns(GetSubDepartmentResp); - rpc DeleteDepartment(DeleteDepartmentReq) returns(DeleteDepartmentResp); - rpc GetDepartmentParentIDList(GetDepartmentParentIDListReq) returns(GetDepartmentParentIDListResp); - - rpc CreateOrganizationUser(CreateOrganizationUserReq) returns(CreateOrganizationUserResp); - rpc UpdateOrganizationUser(UpdateOrganizationUserReq) returns(UpdateOrganizationUserResp); - rpc DeleteOrganizationUser(DeleteOrganizationUserReq) returns(DeleteOrganizationUserResp); - - - rpc CreateDepartmentMember(CreateDepartmentMemberReq) returns(CreateDepartmentMemberResp); - rpc GetUserInDepartment(GetUserInDepartmentReq) returns(GetUserInDepartmentResp); - rpc DeleteUserInDepartment(DeleteUserInDepartmentReq) returns(DeleteUserInDepartmentResp); - rpc UpdateUserInDepartment(UpdateUserInDepartmentReq) returns(UpdateUserInDepartmentResp); - rpc GetDepartmentMember(GetDepartmentMemberReq) returns(GetDepartmentMemberResp); - rpc GetDepartmentRelatedGroupIDList(GetDepartmentRelatedGroupIDListReq) returns(GetDepartmentRelatedGroupIDListResp); - - rpc GetUserInOrganization(GetUserInOrganizationReq) returns(GetUserInOrganizationResp); -} - - - -